From e994f6eddc607df563c67c33ef27a6fc8148cba6 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Fri, 31 Oct 2003 05:42:53 +0000 Subject: [PATCH] While not illegal, attempt to pacify gcc -Wundef. It just so happens that libtool-using packages seem to love using this flag. /usr/include/sys/cdefs.h:184:5: warning: "__STDC_VERSION__" is not defined /usr/include/sys/cdefs.h:372:5: warning: "_POSIX_C_SOURCE" is not defined /usr/include/sys/cdefs.h:378:5: warning: "_POSIX_C_SOURCE" is not defined --- sys/sys/cdefs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 7d0c953f942..f8eae841b38 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -181,7 +181,7 @@ * software that is unaware of C99 keywords. */ #if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95) -#if __STDC_VERSION__ < 199901 +#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 #define __restrict #else #define __restrict restrict @@ -369,13 +369,13 @@ */ /* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */ -#if _POSIX_C_SOURCE == 1 +#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1 #undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */ #define _POSIX_C_SOURCE 199009 #endif /* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */ -#if _POSIX_C_SOURCE == 2 +#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2 #undef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 199209 #endif