aboutsummaryrefslogtreecommitdiff
path: root/contrib/hstore_plperl/hstore_plperl.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2015-11-19 14:54:05 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2015-11-19 14:54:11 -0500
commit68c1d7d42e553682f1d2723e623b6a3a4b02c75f (patch)
tree56a4727e5d7370af97c94b9e360cd80f73c0320c /contrib/hstore_plperl/hstore_plperl.c
parentdb135e834a28180e9151f12c694b07d8fc3c41a8 (diff)
downloadpostgresql-68c1d7d42e553682f1d2723e623b6a3a4b02c75f.tar.gz
postgresql-68c1d7d42e553682f1d2723e623b6a3a4b02c75f.zip
Dodge a macro-name conflict with Perl.
Some versions of Perl export a macro named HS_KEY. This creates a conflict in contrib/hstore_plperl against hstore's macro of the same name. The most future-proof solution seems to be to rename our macro; I chose HSTORE_KEY. For consistency, rename HS_VAL and related macros similarly. Back-patch to 9.5. contrib/hstore_plperl doesn't exist before that so there is no need to worry about the conflict in older releases. Per reports from Marco Atzeri and Mike Blackwell.
Diffstat (limited to 'contrib/hstore_plperl/hstore_plperl.c')
-rw-r--r--contrib/hstore_plperl/hstore_plperl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/hstore_plperl/hstore_plperl.c b/contrib/hstore_plperl/hstore_plperl.c
index fbbb4c8e762..d40a7927307 100644
--- a/contrib/hstore_plperl/hstore_plperl.c
+++ b/contrib/hstore_plperl/hstore_plperl.c
@@ -27,8 +27,11 @@ hstore_to_plperl(PG_FUNCTION_ARGS)
const char *key;
SV *value;
- key = pnstrdup(HS_KEY(entries, base, i), HS_KEYLEN(entries, i));
- value = HS_VALISNULL(entries, i) ? newSV(0) : cstr2sv(pnstrdup(HS_VAL(entries, base, i), HS_VALLEN(entries, i)));
+ key = pnstrdup(HSTORE_KEY(entries, base, i),
+ HSTORE_KEYLEN(entries, i));
+ value = HSTORE_VALISNULL(entries, i) ? newSV(0) :
+ cstr2sv(pnstrdup(HSTORE_VAL(entries, base, i),
+ HSTORE_VALLEN(entries, i)));
(void) hv_store(hv, key, strlen(key), value, 0);
}