diff options
| author | Magnus Hagander | 2014-01-17 11:37:57 +0000 |
|---|---|---|
| committer | Magnus Hagander | 2014-01-17 11:41:32 +0000 |
| commit | 9c14dd22e144a5bef9b114a7a94df97cb23c6b9b (patch) | |
| tree | aac8bc8d4c9eb6fa0badd7675ac92153b3288c5c /src/include/c.h | |
| parent | 277279981fba7646d0f05a664d58b845d2fdf69d (diff) | |
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
Diffstat (limited to 'src/include/c.h')
| -rw-r--r-- | src/include/c.h | 9 |
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 |
