settings.h 948 Bytes
Newer Older
Screwtape's avatar
Screwtape committed
1
#if defined(LIBCO_C)
Screwtape's avatar
Screwtape committed
2 3 4 5 6 7 8 9 10 11 12

/*[amd64, arm, ppc, x86]:
   by default, co_swap_function is marked as a text (code) section
   if not supported, uncomment the below line to use mprotect instead */
/* #define LIBCO_MPROTECT */

/*[amd64]:
   Win64 only: provides a substantial speed-up, but will thrash XMM regs
   do not use this unless you are certain your application won't use SSE */
/* #define LIBCO_NO_SSE */

Screwtape's avatar
Screwtape committed
13 14
#if defined(LIBCO_C)
  #if defined(LIBCO_MP)
Screwtape's avatar
Screwtape committed
15 16 17 18 19 20 21
    #define thread_local __thread
  #else
    #define thread_local
  #endif
#endif

#if __STDC_VERSION__ >= 201112L
Screwtape's avatar
Screwtape committed
22
  #if !defined(_MSC_VER)
Screwtape's avatar
Screwtape committed
23 24 25 26 27 28
    #include <stdalign.h>
  #endif
#else
  #define alignas(bytes)
#endif

Screwtape's avatar
Screwtape committed
29
#if defined(_MSC_VER)
Screwtape's avatar
Screwtape committed
30
  #define section(name) __declspec(allocate("." #name))
Screwtape's avatar
Screwtape committed
31 32 33 34
#elif defined(__APPLE__)
  #define section(name) __attribute__((section("__TEXT,__" #name)))
#else
  #define section(name) __attribute__((section("." #name "#")))
Screwtape's avatar
Screwtape committed
35 36
#endif

Screwtape's avatar
Screwtape committed
37
/* if defined(LIBCO_C) */
Screwtape's avatar
Screwtape committed
38
#endif