This is the mail archive of the
cygwin-cvs@cygwin.com
mailing list for the Cygwin project.
[newlib-cygwin] Feature test macros overhaul: limits.h
- From: Yaakov Selkowitz <yselkowitz at sourceware dot org>
- To: cygwin-cvs at sourceware dot org, newlib-cvs at sourceware dot org
- Date: 18 Mar 2016 02:11:27 -0000
- Subject: [newlib-cygwin] Feature test macros overhaul: limits.h
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=86a724b8c04cb3a2b2b70025dfc2d8ff75e15c7b
commit 86a724b8c04cb3a2b2b70025dfc2d8ff75e15c7b
Author: Yaakov Selkowitz <yselkowi@redhat.com>
Date: Mon Mar 14 16:25:18 2016 -0500
Feature test macros overhaul: limits.h
Simplify the C99 conditional, and use the internal macro for GNU extensions.
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Diff:
---
newlib/libc/include/limits.h | 6 +++---
winsup/cygwin/include/limits.h | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/newlib/libc/include/limits.h b/newlib/libc/include/limits.h
index 190f1f7..dd09c1c 100644
--- a/newlib/libc/include/limits.h
+++ b/newlib/libc/include/limits.h
@@ -2,6 +2,7 @@
# define _LIBC_LIMITS_H_ 1
#include <newlib.h>
+#include <sys/cdefs.h>
# ifdef _MB_LEN_MAX
# define MB_LEN_MAX _MB_LEN_MAX
@@ -96,8 +97,7 @@
# define __LONG_LONG_MAX__ 9223372036854775807LL
# endif
-# if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
- (defined(__cplusplus) && __cplusplus >= 201103L)
+# if __ISO_C_VISIBLE >= 1999
/* Minimum and maximum values a `signed long long int' can hold. */
# undef LLONG_MIN
# define LLONG_MIN (-LLONG_MAX-1)
@@ -109,7 +109,7 @@
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1)
# endif
-# if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
+# if __GNU_VISIBLE
/* Minimum and maximum values a `signed long long int' can hold. */
# undef LONG_LONG_MIN
# define LONG_LONG_MIN (-LONG_LONG_MAX-1)
diff --git a/winsup/cygwin/include/limits.h b/winsup/cygwin/include/limits.h
index e093d28..c17cd0a 100644
--- a/winsup/cygwin/include/limits.h
+++ b/winsup/cygwin/include/limits.h
@@ -110,7 +110,7 @@ details. */
#define __LONG_LONG_MAX__ 9223372036854775807LL
#endif
-#if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
+#if __GNU_VISIBLE
#undef LONG_LONG_MIN
#define LONG_LONG_MIN (-LONG_LONG_MAX-1)
#undef LONG_LONG_MAX