summaryrefslogtreecommitdiff
path: root/src/pl/plperl/plperl_helpers.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-07-31 12:10:36 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2017-07-31 12:10:36 -0400
commitd48180ec812d6d2c1c17900613d05bf6e8d76994 (patch)
treeb6c4fc10f2d8060381f6124a0297efb3d47c8eaf /src/pl/plperl/plperl_helpers.h
parentb9a92d0108ea15afdcf20782a542cb2e321dbeff (diff)
PL/Perl portability fix: avoid including XSUB.h in plperl.c.
Back-patch of commit bebe174bb4462ef079a1d7eeafb82ff969f160a4, which see for more info. Patch by me, with some help from Ashutosh Sharma Discussion: https://postgr.es/m/CANFyU97OVQ3+Mzfmt3MhuUm5NwPU=-FtbNH5Eb7nZL9ua8=rcA@mail.gmail.com
Diffstat (limited to 'src/pl/plperl/plperl_helpers.h')
-rw-r--r--src/pl/plperl/plperl_helpers.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pl/plperl/plperl_helpers.h b/src/pl/plperl/plperl_helpers.h
index 570cf3c7833..8861736f9c5 100644
--- a/src/pl/plperl/plperl_helpers.h
+++ b/src/pl/plperl/plperl_helpers.h
@@ -1,6 +1,8 @@
#ifndef PL_PERL_HELPERS_H
#define PL_PERL_HELPERS_H
+#include "mb/pg_wchar.h"
+
/*
* convert from utf8 to database encoding
*
@@ -48,6 +50,7 @@ utf_e2u(const char *str)
static inline char *
sv2cstr(SV *sv)
{
+ dTHX;
char *val,
*res;
STRLEN len;
@@ -105,6 +108,7 @@ sv2cstr(SV *sv)
static inline SV *
cstr2sv(const char *str)
{
+ dTHX;
SV *sv;
char *utf8_str;
@@ -132,6 +136,8 @@ cstr2sv(const char *str)
static inline void
croak_cstr(const char *str)
{
+ dTHX;
+
#ifdef croak_sv
/* Use sv_2mortal() to be sure the transient SV gets freed */
croak_sv(sv_2mortal(cstr2sv(str)));