From 99eea89dbe31fbd78d08a56e53f5bc272bbcd064 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 31 Jul 2017 12:10:36 -0400 Subject: 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 --- contrib/hstore_plperl/hstore_plperl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'contrib/hstore_plperl/hstore_plperl.c') 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)); -- cgit v1.2.3