Skip to content

Commit

Permalink
[fluent#3] libco: Use __declspec(thread) on MSVC
Browse files Browse the repository at this point in the history
Signed-off-by: Fujimoto Seiji <fujimoto@clear-code.com>
  • Loading branch information
Hiroshi Hatake authored and Fujimoto Seiji committed Jan 7, 2019
1 parent c149235 commit c733a40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/flb_libco/amd64.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
extern "C" {
#endif

#ifdef _MSC_VER
#define thread_local __declspec (thread)
#endif

static thread_local long long co_active_buffer[64];
static thread_local cothread_t co_active_handle = 0;
static void (*co_swap)(cothread_t, cothread_t) = 0;
Expand Down
4 changes: 4 additions & 0 deletions lib/flb_libco/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ extern "C" {
#error "libco: please define fastcall macro"
#endif

#ifdef _MSC_VER
#define thread_local __declspec (thread)
#endif

static thread_local long co_active_buffer[64];
static thread_local cothread_t co_active_handle = 0;
static void (fastcall *co_swap)(cothread_t, cothread_t) = 0;
Expand Down

0 comments on commit c733a40

Please sign in to comment.