aboutsummaryrefslogtreecommitdiff
path: root/src/include/c.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-11-16 10:36:18 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2017-11-16 10:36:21 -0500
commited9b3606dadb461aac57e41ac509f3892095a394 (patch)
tree9d9daaeede31e44619f8fb5df685f528b7603889 /src/include/c.h
parent642bafa0c5f9f08d106a14f31429e0e0c718b603 (diff)
downloadpostgresql-ed9b3606dadb461aac57e41ac509f3892095a394.tar.gz
postgresql-ed9b3606dadb461aac57e41ac509f3892095a394.zip
Further refactoring of c.h and nearby files.
This continues the work of commit 91aec93e6 by getting rid of a lot of Windows-specific funny business in "section 0". Instead of including pg_config_os.h in different places depending on platform, let's standardize on putting it before the system headers, and in consequence reduce win32.h to just what has to appear before the system headers or the body of c.h (the latter category seems to include only PGDLLIMPORT and PGDLLEXPORT). The rest of what was in win32.h is moved to a new sub-include of port.h, win32_port.h. Some of what was in port.h seems to better belong there too. It's possible that I missed some declaration ordering dependency that needs to be preserved, but hopefully the buildfarm will find that out in short order. Unlike the previous commit, no back-patch, since this is just cleanup not a prerequisite for a bug fix. Discussion: https://postgr.es/m/29650.1510761080@sss.pgh.pa.us
Diffstat (limited to 'src/include/c.h')
-rw-r--r--src/include/c.h30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/include/c.h b/src/include/c.h
index c8c7be1d216..a61428843a8 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -52,32 +52,9 @@
#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) && !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
-
-#if _MSC_VER >= 1400 || defined(HAVE_CRTDEFS_H)
-#define errcode __msvc_errcode
-#include <crtdefs.h>
-#undef errcode
-#endif
-
-/*
- * We have to include stdlib.h here because it defines many of these macros
- * on some platforms, and we only want our definitions used if stdlib.h doesn't
- * have its own. The same goes for stddef and stdarg if present.
- */
+/* System header files that should be available everywhere in Postgres */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -99,11 +76,6 @@
#include <libintl.h>
#endif
-#if defined(WIN32) || defined(__CYGWIN__)
-/* We have to redefine some system functions after they are included above. */
-#include "pg_config_os.h"
-#endif
-
/* ----------------------------------------------------------------
* Section 1: compiler characteristics