From: Teodor Sigaev Date: Sat, 28 Dec 2024 08:11:40 +0000 (+0300) Subject: fix gotchas with pg 16&17 X-Git-Url: http://sigaev.ru/git/gitweb.cgi?a=commitdiff_plain;h=6259352edd179544c6f0e7c81bb68dcb81317f8c;p=smlar.git fix gotchas with pg 16&17 --- diff --git a/smlar_gist.c b/smlar_gist.c index 480d744..a142a77 100644 --- a/smlar_gist.c +++ b/smlar_gist.c @@ -52,6 +52,10 @@ typedef char *BITVECP; #define GETENTRY(vec,pos) ((SmlSign *) DatumGetPointer((vec)->vector[(pos)].key)) +#ifndef Abs +#define Abs(x) abs(x) +#endif + /* * Fake IO */ @@ -430,7 +434,7 @@ Datum 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)) {