summaryrefslogtreecommitdiff
path: root/src/pl/plperl
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-05-02 16:00:54 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2018-05-02 16:00:54 -0400
commit0996e4be047fbf476dacea5ffad42cdd3a36b731 (patch)
treeada5d0078c4f53e01f86f144a4e37798d0d33bdc /src/pl/plperl
parentfbb2e9a030ee7a3fa20ce402e4b1da9809b4eb52 (diff)
downloadpostgresql-0996e4be047fbf476dacea5ffad42cdd3a36b731.tar.gz
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
Diffstat (limited to 'src/pl/plperl')
-rw-r--r--src/pl/plperl/plperl.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/pl/plperl/plperl.h b/src/pl/plperl/plperl.h
index c72c6ea59f..e6241f03ea 100644
--- a/src/pl/plperl/plperl.h
+++ b/src/pl/plperl/plperl.h
@@ -70,6 +70,31 @@
* before ppport.h, so use a #define flag to control inclusion here.
*/
#ifdef PG_NEED_PERL_XSUB_H
+/*
+ * On Windows, port_win32.h defines macros for a lot of these same functions.
+ * To avoid compiler warnings when XSUB.h redefines them, #undef our versions.
+ */
+#ifdef WIN32
+#undef accept
+#undef bind
+#undef connect
+#undef fopen
+#undef kill
+#undef listen
+#undef lstat
+#undef mkdir
+#undef open
+#undef putenv
+#undef recv
+#undef rename
+#undef select
+#undef send
+#undef socket
+#undef stat
+#undef unlink
+#undef vfprintf
+#endif
+
#include "XSUB.h"
#endif