From 3343cf3b96a75fe152196e42ebe8dfa9bbbf3ca4 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 27 Jun 2006 15:47:13 +0000 Subject: [PATCH] Avoid generating C code that some compilers don't accept. --- m4/ChangeLog | 6 ++++++ m4/stdint.m4 | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/m4/ChangeLog b/m4/ChangeLog index 05a3739f4b..af8c904db4 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,9 @@ +2006-06-27 Bruno Haible + + * stdint.m4 (gl_STDINT_BITSIZEOF): For nonexistent types, set the + result to 0, not to empty. + Reported by Martin Neitzel . + 2006-06-26 Bruno Haible * stdint.m4 (gl_STDINT_H): Test also for . diff --git a/m4/stdint.m4 b/m4/stdint.m4 index e529ef3d2a..3f1d99846e 100644 --- a/m4/stdint.m4 +++ b/m4/stdint.m4 @@ -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_]))]) -- 2.30.2