summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/include/c.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/include/c.h b/src/include/c.h
index 4f6ce0c99ae..774a0a15497 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -53,6 +53,15 @@
#include "pg_config.h"
#include "pg_config_manual.h" /* must be after pg_config.h */
+/*
+ * We always rely on the WIN32 macro being set by our build system,
+ * but _WIN32 is the compiler pre-defined macro. So make sure we define
+ * WIN32 whenever _WIN32 is set, to facilitate standalone building.
+ */
+#if defined(_WIN32)
+#define WIN32
+#endif
+
#if !defined(WIN32) && !defined(__CYGWIN__) /* win32 includes further down */
#include "pg_config_os.h" /* must be before any system header files */
#endif