#include "fmgr.h"
#include "access/gist.h"
#include "access/skey.h"
+#if PG_VERSION_NUM < 130000
+#include "access/tuptoaster.h"
+#else
#include "access/heaptoast.h"
+#endif
#include "utils/memutils.h"
typedef struct SmlSign {
#define GETENTRY(vec,pos) ((SmlSign *) DatumGetPointer((vec)->vector[(pos)].key))
+#ifndef Abs
+#define Abs(x) abs(x)
+#endif
+
/*
* Fake IO
*/
for(i=0;i<stat->nelems;i++)
{
uint32 hash;
+ int index;
hash = DatumGetUInt32(FunctionCall1Coll(&stat->info->hashFunc,
DEFAULT_COLLATION_OID,
stat->elems[i].datum));
- int index = HASHVAL(hash);
+ index = HASHVAL(hash);
stat->helems[i].hash = hash;
stat->helems[i].idfMin = stat->helems[i].idfMax = stat->elems[i].idf;
gsmlsign_decompress(PG_FUNCTION_ARGS)
{
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
- SmlSign *key = (SmlSign*)DatumGetPointer(PG_DETOAST_DATUM(entry->key));
+ SmlSign *key = (SmlSign*)PG_DETOAST_DATUM(entry->key);
if (key != (SmlSign *) DatumGetPointer(entry->key))
{