git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4e4f7b9)
mingw: Define PGDLLEXPORT as __declspec (dllexport) as done for msvc
2022年9月28日 17:16:49 +0000 (10:16 -0700)
2022年9月30日 17:50:05 +0000 (10:50 -0700)
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/20220928022724.erzuk5v4ai4b53do@awork3.anarazel.de
Discussion: http://postgr.es/m/20220928025242.ugf7t5ugxxgmkraa@awork3.anarazel.de


diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index 67755aadc403bd015c3cb6f22eaa423e3485c88d..d6c13d0bb8f08bb88ca23bf4df87b85242ab0338 100644 (file)
--- 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
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /