diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2022-06-18 14:23:28 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2022-06-18 14:38:18 +0200 |
commit | 5bbcd42378dcd820f9475adf77e40115cdab685d (patch) | |
tree | 25efb2cc996c3b30147b9808acb8a9965b2f24e7 /include/godot_cpp | |
parent | 40f5bfda226b71b629742c8314f2f175da7b523d (diff) | |
download | redot-cpp-5bbcd42378dcd820f9475adf77e40115cdab685d.tar.gz |
Fix GDN_EXPORT define with mingw.
This commit changes the platform detection order to detect mingw
compiling for windows (which defines `__GNUC__`).
This commit also wraps the definition around a guard so it can be
overridden via a define at build-time.
Diffstat (limited to 'include/godot_cpp')
-rw-r--r-- | include/godot_cpp/core/defs.hpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/godot_cpp/core/defs.hpp b/include/godot_cpp/core/defs.hpp index 7243a61..b9e3716 100644 --- a/include/godot_cpp/core/defs.hpp +++ b/include/godot_cpp/core/defs.hpp @@ -34,13 +34,15 @@ #include <cstddef> #include <cstdint> -#ifdef __GNUC__ -#define GDN_EXPORT __attribute__((visibility("default"))) -#elif defined(_WIN32) +#if !defined(GDN_EXPORT) +#if defined(_WIN32) #define GDN_EXPORT __declspec(dllexport) +#elif defined(__GNUC__) +#define GDN_EXPORT __attribute__((visibility("default"))) #else #define GDN_EXPORT #endif +#endif // Turn argument to string constant: // https://gcc.gnu.org/onlinedocs/cpp/Stringizing.html#Stringizing |