Skip to content

Commit be69039

Browse files
authored
make export cross platforms (#464)
1 parent 70941cc commit be69039

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

async_simple/CommonMacros.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@
3131
#define AS_INLINE __attribute__((__always_inline__)) inline
3232
#endif
3333

34+
#ifdef _WIN32
35+
#define AS_EXPORT __declspec(dllexport)
36+
#else
37+
#define AS_EXPORT __attribute__((__visibility__("default")))
38+
#endif
39+
3440
#ifdef __clang__
3541
#if __has_feature(address_sanitizer)
3642
#define AS_INTERNAL_USE_ASAN 1

async_simple/uthread/internal/thread_impl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ struct transfer_t {
3737
fcontext_t fctx;
3838
void* data;
3939
};
40-
extern "C" __attribute__((__visibility__("default"))) transfer_t
41-
_fl_jump_fcontext(fcontext_t const to, void* vp);
42-
extern "C" __attribute__((__visibility__("default"))) fcontext_t
43-
_fl_make_fcontext(void* sp, std::size_t size, void (*fn)(transfer_t));
40+
extern "C" AS_EXPORT transfer_t _fl_jump_fcontext(fcontext_t const to,
41+
void* vp);
42+
extern "C" AS_EXPORT fcontext_t _fl_make_fcontext(void* sp, std::size_t size,
43+
void (*fn)(transfer_t));
4444

4545
class thread_context;
4646

0 commit comments

Comments
 (0)