On Tue, Jan 5, 2016 at 2:27 PM, Tom Lane <[email protected]> wrote:
> Michael Paquier <[email protected]> writes:
>> The patch would put the buildfarm in red as it is incomplete anyway,
>> with MSVC what is used instead of dynloader.h is
>> port/dynloader/win32.h. Instead of this patch I would be incline to
>> remove the #define stuff with dynloader.h that use WIN32_ONLY_COMPILER
>> (see for example dfmgr.c) and just copy the header in include/. This
>> way we use the same header for all platforms.
>
> Patch please?
Sure, here you go. Bruce's patch simply forgot to copy the header file
via Solution.pm, so installation just failed. The change of dfmgr.c is
actually not mandatory but I think that as long as dynloader.h is
copied in include/ we had better change that as well, and it makes the
code cleaner.
--
Michael
diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c
index 7edfe97..f41035d 100644
--- a/src/backend/utils/fmgr/dfmgr.c
+++ b/src/backend/utils/fmgr/dfmgr.c
@@ -16,11 +16,7 @@
#include <sys/stat.h>
-#ifndef WIN32_ONLY_COMPILER
#include "dynloader.h"
-#else
-#include "port/dynloader/win32.h"
-#endif
#include "lib/stringinfo.h"
#include "miscadmin.h"
#include "storage/shmem.h"
diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm
index 40e06f6..ea9b857 100644
--- a/src/tools/msvc/Install.pm
+++ b/src/tools/msvc/Install.pm
@@ -582,7 +582,7 @@ sub CopyIncludeFiles
'Public headers', $target . '/include/',
'src/include/', 'postgres_ext.h',
'pg_config.h', 'pg_config_ext.h',
- 'pg_config_os.h', 'pg_config_manual.h');
+ 'pg_config_os.h', 'dynloader.h', 'pg_config_manual.h');
lcopy('src/include/libpq/libpq-fs.h', $target . '/include/libpq/')
|| croak 'Could not copy libpq-fs.h';
@@ -605,7 +605,8 @@ sub CopyIncludeFiles
CopyFiles(
'Server headers',
$target . '/include/server/',
- 'src/include/', 'pg_config.h', 'pg_config_ext.h', 'pg_config_os.h');
+ 'src/include/', 'pg_config.h', 'pg_config_ext.h', 'pg_config_os.h',
+ 'dynloader.h');
CopyFiles(
'Grammar header',
$target . '/include/server/parser/',
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 1564b72..ac116b7 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -301,6 +301,14 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
'src/include/storage/lwlocknames.h');
}
+ if (IsNewer(
+ 'src/include/dynloader.h',
+ 'src/backend/port/dynloader/win32.h'))
+ {
+ copyFile('src/backend/port/dynloader/win32.h',
+ 'src/include/dynloader.h');
+ }
+
if (IsNewer('src/include/utils/probes.h', 'src/backend/utils/probes.d'))
{
print "Generating probes.h...\n";
diff --git a/src/tools/msvc/clean.bat b/src/tools/msvc/clean.bat
index e3da6aa..feb0fe5 100755
--- a/src/tools/msvc/clean.bat
+++ b/src/tools/msvc/clean.bat
@@ -38,6 +38,7 @@ REM Delete files created with GenerateFiles() in Solution.pm
if exist src\include\pg_config.h del /q src\include\pg_config.h
if exist src\include\pg_config_ext.h del /q src\include\pg_config_ext.h
if exist src\include\pg_config_os.h del /q src\include\pg_config_os.h
+if exist src\include\dynloader.h del /q src\include\dynloader.h
if %DIST%==1 if exist src\backend\parser\gram.h del /q src\backend\parser\gram.h
if exist src\include\utils\errcodes.h del /q src\include\utils\errcodes.h
if exist src\include\utils\fmgroids.h del /q src\include\utils\fmgroids.h
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers