settings.h 948 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #if defined(LIBCO_C)
  2. /*[amd64, arm, ppc, x86]:
  3. by default, co_swap_function is marked as a text (code) section
  4. if not supported, uncomment the below line to use mprotect instead */
  5. /* #define LIBCO_MPROTECT */
  6. /*[amd64]:
  7. Win64 only: provides a substantial speed-up, but will thrash XMM regs
  8. do not use this unless you are certain your application won't use SSE */
  9. /* #define LIBCO_NO_SSE */
  10. #if defined(LIBCO_C)
  11. #if defined(LIBCO_MP)
  12. #define thread_local __thread
  13. #else
  14. #define thread_local
  15. #endif
  16. #endif
  17. #if __STDC_VERSION__ >= 201112L
  18. #if !defined(_MSC_VER)
  19. #include <stdalign.h>
  20. #endif
  21. #else
  22. #define alignas(bytes)
  23. #endif
  24. #if defined(_MSC_VER)
  25. #define section(name) __declspec(allocate("." #name))
  26. #elif defined(__APPLE__)
  27. #define section(name) __attribute__((section("__TEXT,__" #name)))
  28. #else
  29. #define section(name) __attribute__((section("." #name "#")))
  30. #endif
  31. /* if defined(LIBCO_C) */
  32. #endif