Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0996e4b

Browse files
committed
Suppress some compiler warnings in plperl on Windows.
Perl's XSUB.h header defines macros to replace libc functions. Our header port_win32.h does something similar earlier, so XSUB.h causes compiler warnings about macro redefinition. Undefine our macros before including XSUB.h. Thomas Munro Discussion: https://postgr.es/m/CAEepm%3D3%3DTDYEXUEcHpEx%2BTwc31wo7PA0oBAiNt6sWmq93MW02A%40mail.gmail.com
1 parent fbb2e9a commit 0996e4b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/pl/plperl/plperl.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,31 @@
7070
* before ppport.h, so use a #define flag to control inclusion here.
7171
*/
7272
#ifdef PG_NEED_PERL_XSUB_H
73+
/*
74+
* On Windows, port_win32.h defines macros for a lot of these same functions.
75+
* To avoid compiler warnings when XSUB.h redefines them, #undef our versions.
76+
*/
77+
#ifdef WIN32
78+
#undef accept
79+
#undef bind
80+
#undef connect
81+
#undef fopen
82+
#undef kill
83+
#undef listen
84+
#undef lstat
85+
#undef mkdir
86+
#undef open
87+
#undef putenv
88+
#undef recv
89+
#undef rename
90+
#undef select
91+
#undef send
92+
#undef socket
93+
#undef stat
94+
#undef unlink
95+
#undef vfprintf
96+
#endif
97+
7398
#include "XSUB.h"
7499
#endif
75100

0 commit comments

Comments
 (0)