libco.c 951 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #if defined(__clang__)
  2. #pragma clang diagnostic ignored "-Wparentheses"
  3. /* placing code in section(text) does not mark it executable with Clang. */
  4. #undef LIBCO_MPROTECT
  5. #define LIBCO_MPROTECT
  6. #endif
  7. #if defined(__clang__) || defined(__GNUC__)
  8. #if defined(__i386__)
  9. #include "x86.c"
  10. #elif defined(__amd64__)
  11. #include "amd64.c"
  12. #elif defined(__arm__)
  13. #include "arm.c"
  14. #elif defined(__aarch64__)
  15. #include "aarch64.c"
  16. #elif defined(__powerpc64__) && defined(_CALL_ELF) && _CALL_ELF == 2
  17. #include "ppc64v2.c"
  18. #elif defined(_ARCH_PPC) && !defined(__LITTLE_ENDIAN__)
  19. #include "ppc.c"
  20. #elif defined(_WIN32)
  21. #include "fiber.c"
  22. #else
  23. #include "sjlj.c"
  24. #endif
  25. #elif defined(_MSC_VER)
  26. #if defined(_M_IX86)
  27. #include "x86.c"
  28. #elif defined(_M_AMD64)
  29. #include "amd64.c"
  30. #else
  31. #include "fiber.c"
  32. #endif
  33. #else
  34. #error "libco: unsupported processor, compiler or operating system"
  35. #endif