aboutsummaryrefslogtreecommitdiff
path: root/contrib/hstore/hstore_gist.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/hstore/hstore_gist.c')
-rw-r--r--contrib/hstore/hstore_gist.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/contrib/hstore/hstore_gist.c b/contrib/hstore/hstore_gist.c
index d4a9aaa4c13..876b4359c6e 100644
--- a/contrib/hstore/hstore_gist.c
+++ b/contrib/hstore/hstore_gist.c
@@ -6,8 +6,8 @@
#include "access/gist.h"
#include "access/skey.h"
#include "catalog/pg_type.h"
+#include "utils/pg_crc.h"
-#include "crc32.h"
#include "hstore.h"
/* bigint defines */
@@ -68,6 +68,20 @@ typedef struct
#define WISH_F(a,b,c) (double)( -(double)(((a)-(b))*((a)-(b))*((a)-(b)))*(c) )
+/* shorthand for calculating CRC-32 of a single chunk of data. */
+static pg_crc32
+crc32_sz(char *buf, int size)
+{
+ pg_crc32 crc;
+
+ INIT_TRADITIONAL_CRC32(crc);
+ COMP_TRADITIONAL_CRC32(crc, buf, size);
+ FIN_TRADITIONAL_CRC32(crc);
+
+ return crc;
+}
+
+
PG_FUNCTION_INFO_V1(ghstore_in);
PG_FUNCTION_INFO_V1(ghstore_out);