aboutsummaryrefslogtreecommitdiff
path: root/contrib/hstore_plperl/hstore_plperl.c
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
commit30a5c8bfbd7bec07385c7d40305b06385d700b3f (patch)
tree381cfc1b2b298e28d7e6fc5c100ba9bbf33c8fe2 /contrib/hstore_plperl/hstore_plperl.c
parentd38e706ff149eb0937502cc0be27645e70bbfec6 (diff)
downloadpostgresql-30a5c8bfbd7bec07385c7d40305b06385d700b3f.tar.gz
postgresql-30a5c8bfbd7bec07385c7d40305b06385d700b3f.zip
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 'contrib/hstore_plperl/hstore_plperl.c')
-rw-r--r--contrib/hstore_plperl/hstore_plperl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/hstore_plperl/hstore_plperl.c b/contrib/hstore_plperl/hstore_plperl.c
index d40a7927307..e5303b3b92a 100644
--- a/contrib/hstore_plperl/hstore_plperl.c
+++ b/contrib/hstore_plperl/hstore_plperl.c
@@ -13,6 +13,7 @@ PG_FUNCTION_INFO_V1(hstore_to_plperl);
Datum
hstore_to_plperl(PG_FUNCTION_ARGS)
{
+ dTHX;
HStore *in = PG_GETARG_HS(0);
int i;
int count = HS_COUNT(in);
@@ -45,7 +46,8 @@ PG_FUNCTION_INFO_V1(plperl_to_hstore);
Datum
plperl_to_hstore(PG_FUNCTION_ARGS)
{
- HV *hv;
+ dTHX;
+ HV *hv = (HV *) SvRV((SV *) PG_GETARG_POINTER(0));
HE *he;
int32 buflen;
int32 i;
@@ -53,8 +55,6 @@ plperl_to_hstore(PG_FUNCTION_ARGS)
HStore *out;
Pairs *pairs;
- hv = (HV *) SvRV((SV *) PG_GETARG_POINTER(0));
-
pcount = hv_iterinit(hv);
pairs = palloc(pcount * sizeof(Pairs));