From 458969de1955db315e858ee5fe9320b17b2c8c94 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Thu, 7 Mar 2019 12:14:16 +0100 Subject: [PATCH] Only expose SEG_ALLOCATE to MSVC Other compilers use `__attribute__((constructor))` --- defs.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/defs.h b/defs.h index 60a658e2a..73729fd34 100644 --- a/defs.h +++ b/defs.h @@ -152,6 +152,7 @@ __inline WORD __ROR2__(WORD value, DWORD count) // Typedef for the function pointer typedef void (*_PVFV)(void); +#if defined(_MSC_VER) && !defined(__APPLE__) // Define our segment names #define SEGMENT_C_INIT ".CRT$XCU" @@ -160,4 +161,6 @@ typedef void (*_PVFV)(void); #pragma data_seg() // Switch back to the default segment // Call function pointer arrays and place them in the segments created above #define SEG_ALLOCATE(SEGMENT) __declspec(allocate(SEGMENT)) - +#else +#define SEG_ALLOCATE(SEGMENT) +#endif