Avoid generating C code that some compilers don't accept.
authorBruno Haible <bruno@clisp.org>
Tue, 27 Jun 2006 15:47:13 +0000 (15:47 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 27 Jun 2006 15:47:13 +0000 (15:47 +0000)
m4/ChangeLog
m4/stdint.m4

index 05a3739f4b33410f88034092f72ea23308b5852e..af8c904db46c4f26a7a3edc7dca20260ee299d03 100644 (file)
@@ -1,3 +1,9 @@
+2006-06-27  Bruno Haible  <bruno@clisp.org>
+
+       * stdint.m4 (gl_STDINT_BITSIZEOF): For nonexistent types, set the
+       result to 0, not to empty.
+       Reported by Martin Neitzel <neitzel@sco.gaertner.de>.
+
 2006-06-26  Bruno Haible  <bruno@clisp.org>
 
        * stdint.m4 (gl_STDINT_H): Test also for <wchar.h>.
index e529ef3d2a86adefe12865397496a84953878ca8..3f1d99846e305b5bf9a6592f2c3bbbfa210920e3 100644 (file)
@@ -1,4 +1,4 @@
-# stdint.m4 serial 10
+# stdint.m4 serial 11
 dnl Copyright (C) 2001-2002, 2004-2006 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -614,10 +614,19 @@ AC_DEFUN([gl_STDINT_BITSIZEOF],
          eval gl_cv_bitsizeof_${gltype}=\$result
         ])
       eval result=\$gl_cv_bitsizeof_${gltype}
-      GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
-      AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result])
-      eval BITSIZEOF_${GLTYPE}=\$result
+    else
+      dnl Use a nonempty default, because some compilers, such as IRIX 5 cc,
+      dnl do a syntax check even on unused #if conditions and give an error
+      dnl on valid C code like this:
+      dnl   #if 0
+      dnl   # if  > 32
+      dnl   # endif
+      dnl   #endif
+      result=0
     fi
+    GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+    AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result])
+    eval BITSIZEOF_${GLTYPE}=\$result
   done
   AC_FOREACH([gltype], [$1],
     [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])