]> www.ginac.de Git - cln.git/commitdiff
64-bit mingw port: Verify that pointers fit in 'intptr_t', not 'long'.
authorBruno Haible <bruno@clisp.org>
Sun, 27 Oct 2019 18:46:51 +0000 (19:46 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 27 Oct 2019 18:46:51 +0000 (19:46 +0100)
autoconf/intparam.c
m4/intparam.m4

index 375ff8060ee6b4ad1a5fcdbe345728d327fbdd4d..d3b9408f8c3f2a391d4733ada199fd3350ac2e65 100644 (file)
@@ -10,6 +10,7 @@
 #define ushort os_ushort
 #define uint   os_uint
 #define ulong  os_ulong
+#include <stdint.h>
 #include <stdio.h>
 #undef ulong
 #undef uint
@@ -414,8 +415,8 @@ void main5(void) {
 
 void main6(void) {
 #define check_sizeof_pointer(type,typestr)  \
-  { if (!(sizeof(type) <= sizeof(long)))                                 \
-      printf("#error \"Type %s does not fit into a long!!\"\n",typestr); \
+  { if (!(sizeof(type) <= sizeof(intptr_t)))                                  \
+      printf("#error \"Type %s does not fit into an intptr_t!!\"\n",typestr); \
   }
   check_sizeof_pointer(char*,"char *");
   check_sizeof_pointer(long*,"long *");
index d8536b2c7d817504abb8cc63f5fe8cd10acb4be7..d7830b0a77d90e51c00578f534f99cf937edde73 100644 (file)
@@ -113,8 +113,8 @@ AC_DEFUN([CL_INTPARAM_CROSS],
         echo "#error \"Integer types long long and unsigned long long have different sizes!!\""
       fi
     fi
-    AC_TRY_COMPILE([], [static_assert(sizeof(char*) <= sizeof(long), "");],
-      [], [echo "#error \"Type char * does not fit into a long!!\""])
+    AC_TRY_COMPILE([], [static_assert(sizeof(char*) <= sizeof(intptr_t), "");],
+      [], [echo "#error \"Type char * does not fit into an intptr_t!!\""])
     _AC_COMPUTE_INT([sizeof (char *)], [pointer_size])
     pointer_bitsize=`expr $pointer_size '*' $char_bitsize`
     echo "/* Pointers of type char * have $pointer_bitsize bits. */"