From 7200c4951d7bbdc5fd684d94f4252ed25352a1b1 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 29 Apr 2022 16:55:38 -0700 Subject: [PATCH] [wpiutil] SymbolExports: Add WPILIB_IMPORTS for dllimport --- .../src/main/native/include/wpi/SymbolExports.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/wpiutil/src/main/native/include/wpi/SymbolExports.h b/wpiutil/src/main/native/include/wpi/SymbolExports.h index 6b17febe54..9ffc936d1c 100644 --- a/wpiutil/src/main/native/include/wpi/SymbolExports.h +++ b/wpiutil/src/main/native/include/wpi/SymbolExports.h @@ -14,14 +14,28 @@ #define WPILIB_DLLEXPORT __declspec(dllexport) #endif +#elif defined(WPILIB_IMPORTS) + +#ifdef __GNUC__ +#define WPILIB_DLLEXPORT __attribute__((dllimport)) +#else +#define WPILIB_DLLEXPORT __declspec(dllimport) +#endif + #else #define WPILIB_DLLEXPORT #endif -#else +#else // _WIN32 + +#ifdef WPILIB_EXPORTS #define WPILIB_DLLEXPORT __attribute__((visibility("default"))) +#else +#define WPILIB_DLLEXPORT #endif +#endif // _WIN32 + // Synopsis // // This header provides macros for using FOO_EXPORT macros with explicit