From 0a8271da963d1e6dd5b26f173d9d546e22e61325 Mon Sep 17 00:00:00 2001 From: Lukas Fittl Date: Mon, 1 Jan 2024 04:44:04 +0000 Subject: [PATCH] Fix 32-bit support --- ext/pg_query/pg_query_ruby.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/pg_query/pg_query_ruby.c b/ext/pg_query/pg_query_ruby.c index d6f1a21e..72ac6fed 100644 --- a/ext/pg_query/pg_query_ruby.c +++ b/ext/pg_query/pg_query_ruby.c @@ -221,5 +221,10 @@ VALUE pg_query_ruby_hash_xxh3_64(VALUE self, VALUE input, VALUE seed) Check_Type(input, T_STRING); Check_Type(seed, T_FIXNUM); +#ifdef HAVE_LONG_LONG + return ULL2NUM(XXH3_64bits_withSeed(StringValuePtr(input), RSTRING_LEN(input), NUM2ULONG(seed))); +#else return ULONG2NUM(XXH3_64bits_withSeed(StringValuePtr(input), RSTRING_LEN(input), NUM2ULONG(seed))); +#endif + }