Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Define EXEC_BACKEND in pg_config_manual.h
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 25 Mar 2020 13:23:25 +0000 (14:23 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 25 Mar 2020 13:31:14 +0000 (14:31 +0100)
It was for unclear reasons defined in a separate location, which makes
it more cumbersome to override for testing, and it also did not have
any prominent documentation.  Move to pg_config_manual.h, where
similar things are already collected.

The previous definition on the command-line had the effect of defining
it to the value 1, but now that we don't need that anymore we just
define it to empty, to simplify manual editing a bit.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/b7053ba8-b008-5335-31de-2fe4fe41ef0f%402ndquadrant.com

configure
configure.in
src/include/pg_config_manual.h
src/tools/msvc/MSBuildProject.pm

index a7cf71b3f177589c3c3d5832f57840de5f8f45ce..899116517cf46d5eeac65911b590a89aff1bd96e 100755 (executable)
--- a/configure
+++ b/configure
@@ -6906,7 +6906,7 @@ fi
 
 # We already have this in Makefile.win32, but configure needs it too
 if test "$PORTNAME" = "win32"; then
-  CPPFLAGS="$CPPFLAGS -I$srcdir/src/include/port/win32 -DEXEC_BACKEND"
+  CPPFLAGS="$CPPFLAGS -I$srcdir/src/include/port/win32"
 fi
 
 # Now that we're done automatically adding stuff to C[XX]FLAGS, put back the
index d36a7e94b3a05c9ff05226747214a1d8632e7740..ecdf1723967eacaa234840e18c60b236dd708346 100644 (file)
@@ -600,7 +600,7 @@ fi
 
 # We already have this in Makefile.win32, but configure needs it too
 if test "$PORTNAME" = "win32"; then
-  CPPFLAGS="$CPPFLAGS -I$srcdir/src/include/port/win32 -DEXEC_BACKEND"
+  CPPFLAGS="$CPPFLAGS -I$srcdir/src/include/port/win32"
 fi
 
 # Now that we're done automatically adding stuff to C[XX]FLAGS, put back the
index d74a8dd8083b9cc2bf9260a9b83ae3efa24ceef2..b7410ff51e5f049d97a404a1ea82e90af77ba143 100644 (file)
  */
 #define ALIGNOF_BUFFER 32
 
+/*
+ * If EXEC_BACKEND is defined, the postmaster uses an alternative method for
+ * starting subprocesses: Instead of simply using fork(), as is standard on
+ * Unix platforms, it uses fork()+exec() or something equivalent on Windows,
+ * as well as lots of extra code to bring the required global state to those
+ * new processes.  This must be enabled on Windows (because there is no
+ * fork()).  On other platforms, it's only useful for verifying those
+ * otherwise Windows-specific code paths.
+ */
+#if defined(WIN32) && !defined(__CYGWIN__)
+#define EXEC_BACKEND
+#endif
+
 /*
  * Disable UNIX sockets for certain operating systems.
  */
index 823357c023faffa9fb2500a1059014ccaeda6f32..ebb169e20120272ff1a246452d2600d04e681f00 100644 (file)
@@ -320,7 +320,7 @@ sub WriteItemDefinitionGroup
     <ClCompile>
       <Optimization>$p->{opt}</Optimization>
       <AdditionalIncludeDirectories>$self->{prefixincludes}src/include;src/include/port/win32;src/include/port/win32_msvc;$includes\%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_WINDOWS;__WINDOWS__;__WIN32__;EXEC_BACKEND;WIN32_STACK_RLIMIT=4194304;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE$self->{defines}$p->{defs}\%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;_WINDOWS;__WINDOWS__;__WIN32__;WIN32_STACK_RLIMIT=4194304;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE$self->{defines}$p->{defs}\%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>$p->{strpool}</StringPooling>
       <RuntimeLibrary>$p->{runtime}</RuntimeLibrary>
       <DisableSpecificWarnings>$self->{disablewarnings};\%(DisableSpecificWarnings)</DisableSpecificWarnings>