]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Don't use __STDC__; some compilers don't set it properly.
authorPaul Smith <psmith@gnu.org>
Sat, 6 Mar 2004 08:05:17 +0000 (08:05 +0000)
committerPaul Smith <psmith@gnu.org>
Sat, 6 Mar 2004 08:05:17 +0000 (08:05 +0000)
Use autoconf's test to set HAVE_ANSI_COMPILER and check that instead.

ChangeLog
NEWS
config.ami.template
config.h-vms.template
config.h.W32.template
configh.dos.template
configure.in
make.h
misc.c

index 56bdec3f27f0ab7451e6b236f5d4e0fb5b0c72e0..4d5e0f4436cdc0ff3c5fb16a4c0bb1ce9c4e4535 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2004-03-06  Paul D. Smith  <psmith@gnu.org>
+
+       * configure.in (HAVE_ANSI_COMPILER): Define if we have an ANSI/ISO
+       compiler.
+       * make.h: Convert uses of __STDC__ to HAVE_ANSI_COMPILER.
+       * misc.c (message,error,fatal): Ditto.
+       * configh.dos.template: Define HAVE_ANSI_COMPILER.
+       * config.h.W32.template: Ditto.
+       * config.h-vms.template: Ditto.
+       * config.ami.template: Ditto.
+
 2004-03-04  Paul D. Smith  <psmith@gnu.org>
 
        * README.template: Add a note about broken /bin/sh on SunOS
diff --git a/NEWS b/NEWS
index 4034048fd6e0497259e3b6ad7eed9e94c26f2c36..49f4f57fccb95bcfe761865592ef6493d44a78f1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,6 @@
 GNU make NEWS                                               -*-indented-text-*-
   History of user-visible changes.
-  04 March 2004
+  06 March 2004
 
 Copyright (C) 2002,2003,2004  Free Software Foundation, Inc.
 See the end for copying conditions.
index 6840765230e347309aaec560f95eebf964ff85dc..df00075f0f2c9252986b0216b26d44094fe162b4 100644 (file)
 /* Define if the `S_IS*' macros in <sys/stat.h> do not work properly.  */
 /* #undef STAT_MACROS_BROKEN */
 
+/* Define if your compiler conforms to the ANSI C standard. */
+#define HAVE_ANSI_COMPILER 1
+
 /* Define if you have the ANSI C header files. */
 #define STDC_HEADERS
 
index dc599f0827b5c5f320578963a1a13702ef86d178..118627d14379b89b2884c1837e3a5575d35e3e09 100644 (file)
 /* Define if you have the <ndir.h> header file.  */
 /* #undef HAVE_NDIR_H */
 
+/* Define if your compiler conforms to the ANSI C standard. */
+#define HAVE_ANSI_COMPILER 1
+
 /* Define to 1 if you have the <stdarg.h> header file. */
 #define HAVE_STDARG_H 1
 
index 8fbeecd85227fd211dc1f9a03994827a482a8d75..edb2f2909832cac093c412408db5f42e2d20afdb 100644 (file)
 /* Define if the `S_IS*' macros in <sys/stat.h> do not work properly.  */
 /* #undef STAT_MACROS_BROKEN */
 
+/* Define if your compiler conforms to the ANSI C standard. */
+#define HAVE_ANSI_COMPILER 1
+
 /* Define to 1 if you have the <stdarg.h> header file. */
 #define HAVE_STDARG_H 1
 
index 40ef770516d8ce0af1a90757178599b58cd5ba43..21a44271368d45d21d75bf739edda1a8fbbb6b49 100644 (file)
 /* Define if you have the select function.  */
 #define HAVE_SELECT 1
 
+/* Define if your compiler conforms to the ANSI C standard. */
+#define HAVE_ANSI_COMPILER 1
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#define HAVE_STDARG_H 1
+
 /* Define if you have the vprintf library function.  */
 #undef HAVE_VPRINTF
 #define HAVE_VPRINTF 1
index 3828be75031d75a824e9660518e855a472dc7dfa..967a8edf01be0cba6121919bca062119f310511e 100644 (file)
@@ -52,11 +52,17 @@ AC_HEADER_TIME
 AC_CHECK_HEADERS(stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
                 memory.h sys/param.h sys/time.h sys/timeb.h)
 
+# Set a flag if we have an ANSI C compiler
+if test "$ac_cv_prog_cc_stdc" != no; then
+  AC_DEFINE(HAVE_ANSI_COMPILER, 1,
+             [Define if your compiler conforms to the ANSI C standard.])
+fi
+
+
 # Determine what kind of variadic function calls we support
 AC_CHECK_HEADERS(stdarg.h varargs.h, break)
 
 AM_PROG_CC_C_O
-AM_PROG_CC_STDC
 AC_C_CONST
 AC_TYPE_SIGNAL
 AC_TYPE_UID_T
diff --git a/make.h b/make.h
index 453e9f5566b659552a1f893c5d47b5c8c4549a4d..ea8f07c9e7d5b77552c49d343d5ccdcb3b7b08af 100644 (file)
--- a/make.h
+++ b/make.h
@@ -396,7 +396,7 @@ struct floc
 # endif
 #endif
 
-#if __STDC__ && USE_VARIADIC && HAVE_STDARG_H
+#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
 extern void message (int prefix, const char *fmt, ...)
                      __attribute__ ((__format__ (__printf__, 2, 3)));
 extern void error (const struct floc *flocp, const char *fmt, ...)
diff --git a/misc.c b/misc.c
index 07a9c470e09ed280d5bbb79c33b28b94dbd39821..9d3ff4fb39789ef5e76f03196c2a7d11a437f37d 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -205,7 +205,7 @@ concat (const char *s1, const char *s2, const char *s3)
 /* Print a message on stdout.  */
 
 void
-#if __STDC__ && USE_VARIADIC && HAVE_STDARG_H
+#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
 message (int prefix, const char *fmt, ...)
 #else
 message (prefix, fmt, va_alist)
@@ -241,7 +241,7 @@ message (prefix, fmt, va_alist)
 /* Print an error message.  */
 
 void
-#if __STDC__ && USE_VARIADIC && HAVE_STDARG_H
+#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
 error (const struct floc *flocp, const char *fmt, ...)
 #else
 error (flocp, fmt, va_alist)
@@ -274,7 +274,7 @@ error (flocp, fmt, va_alist)
 /* Print an error message and exit.  */
 
 void
-#if __STDC__ && USE_VARIADIC && HAVE_STDARG_H
+#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
 fatal (const struct floc *flocp, const char *fmt, ...)
 #else
 fatal (flocp, fmt, va_alist)