summaryrefslogtreecommitdiffstats
path: root/src/fluent-bit/lib/flb_libco/settings.h
blob: 0c3db68e07e4071ee12ceffcf51f93fd991b6b9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifdef LIBCO_C

/*[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 */

/*
 * Testing Fluent Bit on Windows when doing co_swap it crash if the
 * option LIBCO_MPROTECT is not defined.
 */
#ifdef _WIN32
#define LIBCO_MPROTECT
#endif

/*[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 */

#ifdef LIBCO_C
  #ifdef LIBCO_MP
    #ifdef _MSC_VER
      #define thread_local __declspec (thread)
    #else
      #define thread_local __thread
    #endif
  #else
    #define thread_local
  #endif
#endif

#if __STDC_VERSION__ >= 201112L
  #ifndef _MSC_VER
    #include <stdalign.h>
  #endif
#else
  #define alignas(bytes)
#endif

#if defined(_MSC_VER)
  #pragma data_seg(".text")
  #define text_section __declspec(allocate(".text"))
#elif defined(__APPLE__) && defined(__MACH__)
  #define text_section __attribute__((section("__TEXT,__text")))
#elif defined(__clang__)
  #define text_section __attribute__((section(".text")))
#else
  #define text_section __attribute__((section(".text#")))
#endif

/* ifdef LIBCO_C */
#endif