From: Daniele Varrazzo Date: Mon, 28 Jun 2021 04:31:10 +0000 (+0100) Subject: Fix compatibility with 32 bit platforms X-Git-Tag: 3.0.dev0~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2d474faad822b248f0e5bf5e8361f1aa96d9b994;p=thirdparty%2Fpsycopg.git Fix compatibility with 32 bit platforms --- diff --git a/psycopg_c/psycopg_c/types/datetime.pyx b/psycopg_c/psycopg_c/types/datetime.pyx index 3a04e364a..1aa3cb5d7 100644 --- a/psycopg_c/psycopg_c/types/datetime.pyx +++ b/psycopg_c/psycopg_c/types/datetime.pyx @@ -698,7 +698,7 @@ cdef class TimestampBinaryLoader(CLoader): cdef object cload(self, const char *data, size_t length): cdef int64_t val = endian.be64toh((data)[0]) - cdef long micros, secs, days + cdef int64_t micros, secs, days # Work only with positive values as the cdivision behaves differently # with negative values, and cdivision=False adds overhead. @@ -830,7 +830,7 @@ cdef class TimestamptzBinaryLoader(_BaseTimestamptzLoader): cdef object cload(self, const char *data, size_t length): cdef int64_t val = endian.be64toh((data)[0]) - cdef long micros, secs, days + cdef int64_t micros, secs, days # Work only with positive values as the cdivision behaves differently # with negative values, and cdivision=False adds overhead. diff --git a/psycopg_c/psycopg_c/types/numutils.c b/psycopg_c/psycopg_c/types/numutils.c index c7de5bef7..7847b2601 100644 --- a/psycopg_c/psycopg_c/types/numutils.c +++ b/psycopg_c/psycopg_c/types/numutils.c @@ -9,17 +9,7 @@ #include #include -/* configuration */ - -#ifdef __GNUC__ -#define SIZEOF_VOID_P __SIZEOF_POINTER__ -#define HAVE__BUILTIN_CLZ 1 -#else -#error 'you need to define this for your compiler' -#endif - -/* TODO: this is a guess, it is on my Ubuntu 20.04 */ -#define HAVE_LONG_INT_64 1 +#include "pg_config.h" /*