aboutsummaryrefslogtreecommitdiff
path: root/src/include/port/cygwin.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2021-11-29 11:00:00 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2021-11-29 11:00:00 -0500
commite04a8059a74c125a8af94acdcb7b15b92188470a (patch)
tree0be52ca72de433f2ff8f3eb5e43a517055cc209f /src/include/port/cygwin.h
parent11b500072e42c214462b973b0b05f1c68992226b (diff)
downloadpostgresql-e04a8059a74c125a8af94acdcb7b15b92188470a.tar.gz
postgresql-e04a8059a74c125a8af94acdcb7b15b92188470a.zip
Simplify declaring variables exported from libpgcommon and libpgport.
This reverts commits c2d1eea9e and 11b500072, as well as similar hacks elsewhere, in favor of setting up the PGDLLIMPORT macro so that it can just be used unconditionally. That can work because in frontend code, we need no marking in either the defining or consuming files for a variable exported from these libraries; and frontend code has no need to access variables exported from the core backend, either. While at it, write some actual documentation about the PGDLLIMPORT and PGDLLEXPORT macros. Patch by me, based on a suggestion from Robert Haas. Discussion: https://postgr.es/m/1160385.1638165449@sss.pgh.pa.us
Diffstat (limited to 'src/include/port/cygwin.h')
-rw-r--r--src/include/port/cygwin.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/include/port/cygwin.h b/src/include/port/cygwin.h
index 64d69936e5e..44bf8533729 100644
--- a/src/include/port/cygwin.h
+++ b/src/include/port/cygwin.h
@@ -1,12 +1,18 @@
/* src/include/port/cygwin.h */
+/*
+ * Variables declared in the core backend and referenced by loadable
+ * modules need to be marked "dllimport" in the core build, but
+ * "dllexport" when the declaration is read in a loadable module.
+ * No special markings should be used when compiling frontend code.
+ */
+#ifndef FRONTEND
#ifdef BUILDING_DLL
#define PGDLLIMPORT __declspec (dllexport)
#else
#define PGDLLIMPORT __declspec (dllimport)
#endif
-
-#define PGDLLEXPORT
+#endif
/*
* Cygwin has a strtof() which is literally just (float)strtod(), which means