Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9c14dd2

Browse filesBrowse files
committed
Define WIN32 when _WIN32 is set
_WIN32 is set by the compiler, whereas our code uses WIN32 that is normally set through our build system. To make it possible to build extensions out of tree we cannot rely on that, so set the WIN32 symbol explicitly whenever the compiler has set _WIN32. Not setting this symbol causes double inclusion of pg_config_os.h, and possibly other errors as well. Craig Ringer
1 parent 2772799 commit 9c14dd2
Copy full SHA for 9c14dd2

File tree

Expand file treeCollapse file tree

1 file changed

+9
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-0
lines changed

‎src/include/c.h

Copy file name to clipboardExpand all lines: src/include/c.h
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@
5353
#include "pg_config.h"
5454
#include "pg_config_manual.h" /* must be after pg_config.h */
5555

56+
/*
57+
* We always rely on the WIN32 macro being set by our build system,
58+
* but _WIN32 is the compiler pre-defined macro. So make sure we define
59+
* WIN32 whenever _WIN32 is set, to facilitate standalone building.
60+
*/
61+
#if defined(_WIN32)
62+
#define WIN32
63+
#endif
64+
5665
#if !defined(WIN32) && !defined(__CYGWIN__) /* win32 includes further down */
5766
#include "pg_config_os.h" /* must be before any system header files */
5867
#endif

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.