agora inbox for [email protected]  
help / color / mirror / Atom feed
From: Andres Freund <[email protected]>
Subject: [PATCH v1 5/6] mingw: Define PGDLLEXPORT as __declspec (dllexport) as done for msvc
Date: Wed, 28 Sep 2022 10:16:49 -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/[email protected]
Discussion: http://postgr.es/m/[email protected]
---
 src/include/port/win32.h | 10 ++++++----
 1 file 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
-- 
2.37.3.542.gdd3f6c4cae


--3mylvpkolouaexyj
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
	filename="v1-0006-meson-mingw-Add-Wl-disable-auto-import-enable-whe.patch"



view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [PATCH v1 5/6] mingw: Define PGDLLEXPORT as __declspec (dllexport) as done for msvc
  In-Reply-To: <no-message-id-122459@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox