From 6259352edd179544c6f0e7c81bb68dcb81317f8c Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Sat, 28 Dec 2024 11:11:40 +0300 Subject: [PATCH] fix gotchas with pg 16&17 --- smlar_gist.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)) { -- 2.49.0