diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2015-11-19 14:54:05 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2015-11-19 14:54:11 -0500 |
commit | 68c1d7d42e553682f1d2723e623b6a3a4b02c75f (patch) | |
tree | 56a4727e5d7370af97c94b9e360cd80f73c0320c /contrib/hstore/hstore_gist.c | |
parent | db135e834a28180e9151f12c694b07d8fc3c41a8 (diff) | |
download | postgresql-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/hstore_gist.c')
-rw-r--r-- | contrib/hstore/hstore_gist.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/contrib/hstore/hstore_gist.c b/contrib/hstore/hstore_gist.c index 0fb769de7da..f8f5934e404 100644 --- a/contrib/hstore/hstore_gist.c +++ b/contrib/hstore/hstore_gist.c @@ -129,11 +129,13 @@ ghstore_compress(PG_FUNCTION_ARGS) { int h; - h = crc32_sz((char *) HS_KEY(hsent, ptr, i), HS_KEYLEN(hsent, i)); + h = crc32_sz((char *) HSTORE_KEY(hsent, ptr, i), + HSTORE_KEYLEN(hsent, i)); HASH(GETSIGN(res), h); - if (!HS_VALISNULL(hsent, i)) + if (!HSTORE_VALISNULL(hsent, i)) { - h = crc32_sz((char *) HS_VAL(hsent, ptr, i), HS_VALLEN(hsent, i)); + h = crc32_sz((char *) HSTORE_VAL(hsent, ptr, i), + HSTORE_VALLEN(hsent, i)); HASH(GETSIGN(res), h); } } @@ -524,13 +526,15 @@ ghstore_consistent(PG_FUNCTION_ARGS) for (i = 0; res && i < count; ++i) { - int crc = crc32_sz((char *) HS_KEY(qe, qv, i), HS_KEYLEN(qe, i)); + int crc = crc32_sz((char *) HSTORE_KEY(qe, qv, i), + HSTORE_KEYLEN(qe, i)); if (GETBIT(sign, HASHVAL(crc))) { - if (!HS_VALISNULL(qe, i)) + if (!HSTORE_VALISNULL(qe, i)) { - crc = crc32_sz((char *) HS_VAL(qe, qv, i), HS_VALLEN(qe, i)); + crc = crc32_sz((char *) HSTORE_VAL(qe, qv, i), + HSTORE_VALLEN(qe, i)); if (!GETBIT(sign, HASHVAL(crc))) res = false; } |