Skip to content

Commit 7a47262

Browse files
committed
Properly install dynloader.h on MSVC builds
This will enable PL/Java to be cleanly compiled, as dynloader.h is a requirement. Report by Chapman Flack Patch by Michael Paquier Backpatch through 9.1
1 parent f704f43 commit 7a47262

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

src/backend/utils/fmgr/dfmgr.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616

1717
#include <sys/stat.h>
1818

19-
#ifndef WIN32_ONLY_COMPILER
2019
#include "dynloader.h"
21-
#else
22-
#include "port/dynloader/win32.h"
23-
#endif
2420
#include "lib/stringinfo.h"
2521
#include "miscadmin.h"
2622
#include "utils/dynamic_loader.h"

src/tools/msvc/Install.pm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ sub CopyIncludeFiles
499499
'Public headers', $target . '/include/',
500500
'src/include/', 'postgres_ext.h',
501501
'pg_config.h', 'pg_config_ext.h',
502-
'pg_config_os.h', 'pg_config_manual.h');
502+
'pg_config_os.h', 'dynloader.h', 'pg_config_manual.h');
503503
lcopy('src/include/libpq/libpq-fs.h', $target . '/include/libpq/')
504504
|| croak 'Could not copy libpq-fs.h';
505505

@@ -522,7 +522,8 @@ sub CopyIncludeFiles
522522
CopyFiles(
523523
'Server headers',
524524
$target . '/include/server/',
525-
'src/include/', 'pg_config.h', 'pg_config_ext.h', 'pg_config_os.h');
525+
'src/include/', 'pg_config.h', 'pg_config_ext.h', 'pg_config_os.h',
526+
'dynloader.h');
526527
CopyFiles(
527528
'Grammar header',
528529
$target . '/include/server/parser/',

src/tools/msvc/Solution.pm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,14 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
292292
'src\include\utils\fmgroids.h');
293293
}
294294

295+
if (IsNewer(
296+
'src/include/dynloader.h',
297+
'src/backend/port/dynloader/win32.h'))
298+
{
299+
copyFile('src/backend/port/dynloader/win32.h',
300+
'src/include/dynloader.h');
301+
}
302+
295303
if (IsNewer('src\include\utils\probes.h', 'src\backend\utils\probes.d'))
296304
{
297305
print "Generating probes.h...\n";

src/tools/msvc/clean.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ REM Delete files created with GenerateFiles() in Solution.pm
2424
if exist src\include\pg_config.h del /q src\include\pg_config.h
2525
if exist src\include\pg_config_ext.h del /q src\include\pg_config_ext.h
2626
if exist src\include\pg_config_os.h del /q src\include\pg_config_os.h
27+
if exist src\include\dynloader.h del /q src\include\dynloader.h
2728
if %DIST%==1 if exist src\backend\parser\gram.h del /q src\backend\parser\gram.h
2829
if exist src\include\utils\errcodes.h del /q src\include\utils\errcodes.h
2930
if exist src\include\utils\fmgroids.h del /q src\include\utils\fmgroids.h

0 commit comments

Comments
 (0)