Przeglądaj źródła

Merge pull request #771 from Faless/fix/4.x_mingw_export

Rémi Verschelde 3 lat temu
rodzic
commit
7adc5360d7
1 zmienionych plików z 5 dodań i 3 usunięć
  1. 5 3
      include/godot_cpp/core/defs.hpp

+ 5 - 3
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