summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Freund2022-09-28 17:16:49 +0000
committerAndres Freund2022-09-30 17:50:05 +0000
commit0e497eadb1f4028b147b5c58dc08cea7e73675e1 (patch)
tree380f50610e254822206bb0e645d5f3ff898c925f
parent4e4f7b9fcc9ad0b023b6e698e978882d022b94c4 (diff)
mingw: Define PGDLLEXPORT as __declspec (dllexport) as done for msvc
While mingw would otherwise fall back to __attribute__((visibility("default"))), that appears to only work as long as no symbols are declared with __declspec(dllexport). But we can end up with some, e.g. plpython's Py_Init. It's quite possible we should do the same for cygwin, but I don't have a test environment for that... Discussion: http://postgr.es/m/[email protected] Discussion: http://postgr.es/m/[email protected]
-rw-r--r--src/include/port/win32.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index 67755aadc40..d6c13d0bb8f 100644
--- a/src/include/port/win32.h
+++ b/src/include/port/win32.h
@@ -49,9 +49,11 @@
#endif
/*
- * Under MSVC, functions exported by a loadable module must be marked
- * "dllexport". Other compilers don't need that.
+ * Functions exported by a loadable module must be marked "dllexport".
+ *
+ * While mingw would otherwise fall back to
+ * __attribute__((visibility("default"))), that appears to only work as long
+ * as no symbols are declared with __declspec(dllexport). But we can end up
+ * with some, e.g. plpython's Py_Init.
*/
-#ifdef _MSC_VER
#define PGDLLEXPORT __declspec (dllexport)
-#endif