]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Fix compatibility with 32 bit platforms
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 28 Jun 2021 04:31:10 +0000 (05:31 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 28 Jun 2021 11:23:44 +0000 (12:23 +0100)
psycopg_c/psycopg_c/types/datetime.pyx
psycopg_c/psycopg_c/types/numutils.c

index 3a04e364ad9663e39899c6d76cb0fdf90f0a7a46..1aa3cb5d78808fe3fa3cd19c6b1dd2b8e02da6f8 100644 (file)
@@ -698,7 +698,7 @@ cdef class TimestampBinaryLoader(CLoader):
 
     cdef object cload(self, const char *data, size_t length):
         cdef int64_t val = endian.be64toh((<uint64_t *>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((<uint64_t *>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.
index c7de5bef78e6df00efb9d0d0a7e9eb8508338260..7847b2601a2505ac41279616dc997d9ff3aa141e 100644 (file)
@@ -9,17 +9,7 @@
 #include <stdint.h>
 #include <string.h>
 
-/* 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"
 
 
 /*