]> granicus.if.org Git - yasm/commitdiff
Undefine __STRICT__ANSI__ when compiling with gcc -ansi and glibc to avoid many
authorPeter Johnson <peter@tortall.net>
Sat, 3 May 2003 08:02:15 +0000 (08:02 -0000)
committerPeter Johnson <peter@tortall.net>
Sat, 3 May 2003 08:02:15 +0000 (08:02 -0000)
spurious compiler warnings.

svn path=/trunk/yasm/; revision=924

libyasm/util.h
util.h

index ca3e26233344ce98f01f4f2338276bd3ff25a976..e77fcc5eff4cf976f6032f30a320ac532992b837 100644 (file)
@@ -29,8 +29,6 @@
 #ifndef YASM_UTIL_H
 #define YASM_UTIL_H
 
-#include <stdio.h>
-
 #ifdef YASM_LIB_INTERNAL
 # define YASM_INTERNAL
 # define YASM_AUTOCONF_INTERNAL
 #endif
 
 #ifdef YASM_INTERNAL
-# include <stdarg.h>
 
 #if defined(YASM_LIB_AC_INTERNAL) && defined(HAVE_CONFIG_H)
 # include <libyasm/config.h>
+
+/* Work around glibc's non-defining of certain things when using gcc -ansi */
+# if defined(HAVE_GNU_C_LIBRARY) && defined(__STRICT_ANSI__)
+#  undef __STRICT_ANSI__
+# endif
+#endif
+
+#endif
+
+#include <stdio.h>
+
+#ifdef YASM_INTERNAL
+
+#if defined(YASM_LIB_AC_INTERNAL) && defined(HAVE_CONFIG_H)
+# include <stdarg.h>
 #endif
 
 #if !defined(lint) && !defined(NDEBUG)
diff --git a/util.h b/util.h
index ca3e26233344ce98f01f4f2338276bd3ff25a976..e77fcc5eff4cf976f6032f30a320ac532992b837 100644 (file)
--- a/util.h
+++ b/util.h
@@ -29,8 +29,6 @@
 #ifndef YASM_UTIL_H
 #define YASM_UTIL_H
 
-#include <stdio.h>
-
 #ifdef YASM_LIB_INTERNAL
 # define YASM_INTERNAL
 # define YASM_AUTOCONF_INTERNAL
 #endif
 
 #ifdef YASM_INTERNAL
-# include <stdarg.h>
 
 #if defined(YASM_LIB_AC_INTERNAL) && defined(HAVE_CONFIG_H)
 # include <libyasm/config.h>
+
+/* Work around glibc's non-defining of certain things when using gcc -ansi */
+# if defined(HAVE_GNU_C_LIBRARY) && defined(__STRICT_ANSI__)
+#  undef __STRICT_ANSI__
+# endif
+#endif
+
+#endif
+
+#include <stdio.h>
+
+#ifdef YASM_INTERNAL
+
+#if defined(YASM_LIB_AC_INTERNAL) && defined(HAVE_CONFIG_H)
+# include <stdarg.h>
 #endif
 
 #if !defined(lint) && !defined(NDEBUG)