summaryrefslogtreecommitdiff
path: root/src/pl/plperl/plperl.h
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2017-11-23 20:22:04 -0800
committerNoah Misch <noah@leadboat.com>2017-11-23 20:24:53 -0800
commit1695ce06860440103afb90f1ca10b0f4958da457 (patch)
treedf75ee8db0a14ae971cbc591dacb81172fcee69b /src/pl/plperl/plperl.h
parentc253b722f616d15c0b45c729465b4b85849cbcda (diff)
Support linking with MinGW-built Perl.
This is necessary for ActivePerl 5.18 onwards and for Strawberry Perl. It is not sufficient for 32-bit builds with newer Visual Studio; these fail with error LINK2026. Back-patch to 9.3 (all supported versions). Reported by Victor Wagner. Discussion: https://postgr.es/m/20160326154321.7754ab8f@wagner.wagner.home
Diffstat (limited to 'src/pl/plperl/plperl.h')
-rw-r--r--src/pl/plperl/plperl.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/pl/plperl/plperl.h b/src/pl/plperl/plperl.h
index a4593cac371..7b1817eade3 100644
--- a/src/pl/plperl/plperl.h
+++ b/src/pl/plperl/plperl.h
@@ -42,6 +42,14 @@
#undef vsnprintf
#endif
+/*
+ * ActivePerl 5.18 and later are MinGW-built, and their headers use GCC's
+ * __inline__. Translate to something MSVC recognizes.
+ */
+#ifdef _MSC_VER
+#define __inline__ inline
+#endif
+
/*
* Get the basic Perl API. We use PERL_NO_GET_CONTEXT mode so that our code