[PATCH v3 24/24] Feature test macros overhaul: Cygwin headers
Yaakov Selkowitz
yselkowi@redhat.com
Tue Mar 15 03:28:00 GMT 2016
Use proper internal macros for BSD and GNU.
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
---
winsup/cygwin/include/endian.h | 5 +++--
winsup/cygwin/include/fenv.h | 6 ++++--
winsup/cygwin/include/glob.h | 4 ++--
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/winsup/cygwin/include/endian.h b/winsup/cygwin/include/endian.h
index d59d2c8..960e61c 100644
--- a/winsup/cygwin/include/endian.h
+++ b/winsup/cygwin/include/endian.h
@@ -12,6 +12,7 @@ details. */
#define _ENDIAN_H_
#include <sys/config.h>
+#include <sys/cdefs.h>
#include <bits/endian.h>
/*#ifdef __USE_BSD*/
@@ -27,7 +28,7 @@ details. */
# define __LONG_LONG_PAIR(HI, LO) HI, LO
#endif
-#if /*defined __USE_BSD ||*/ ! defined _POSIX_SOURCE
+#if __BSD_VISIBLE
#include <byteswap.h>
@@ -71,7 +72,7 @@ details. */
#endif /*__BYTE_ORDER == __BIG_ENDIAN*/
-#endif /*__USE_BSD || !_POSIX_SOURCE*/
+#endif /*__BSD_VISIBLE*/
#endif /*_ENDIAN_H_*/
diff --git a/winsup/cygwin/include/fenv.h b/winsup/cygwin/include/fenv.h
index b49033f..4976913 100644
--- a/winsup/cygwin/include/fenv.h
+++ b/winsup/cygwin/include/fenv.h
@@ -11,6 +11,8 @@ details. */
#ifndef _FENV_H_
#define _FENV_H_
+#include <sys/cdefs.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -133,14 +135,14 @@ extern const fenv_t *_fe_dfl_env;
type "pointer to const-qualified fenv_t",may also be specified by
the implementation. */
-#ifdef _GNU_SOURCE
+#if __GNU_VISIBLE
/* If possible, the GNU C Library defines a macro FE_NOMASK_ENV which
represents an environment where every exception raised causes a trap
to occur. You can test for this macro using #ifdef. It is only defined
if _GNU_SOURCE is defined. */
extern const fenv_t *_fe_nomask_env;
#define FE_NOMASK_ENV (_fe_nomask_env)
-#endif /* _GNU_SOURCE */
+#endif /* __GNU_VISIBLE */
/* The following shall be declared as functions and may also be
diff --git a/winsup/cygwin/include/glob.h b/winsup/cygwin/include/glob.h
index 5f1b420..0376cc3 100644
--- a/winsup/cygwin/include/glob.h
+++ b/winsup/cygwin/include/glob.h
@@ -80,7 +80,7 @@ typedef struct {
#define GLOB_NOMATCH (-3) /* No match and GLOB_NOCHECK was not set. */
#define GLOB_NOSYS (-4) /* Obsolete: source comptability only. */
-#ifndef _POSIX_SOURCE
+#if __GNU_VISIBLE
#define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */
#define GLOB_BRACE 0x0080 /* Expand braces ala csh. */
#define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */
@@ -92,7 +92,7 @@ typedef struct {
/* source compatibility, these are the old names */
#define GLOB_MAXPATH GLOB_LIMIT
#define GLOB_ABEND GLOB_ABORTED
-#endif /* __BSD_VISIBLE */
+#endif /* __GNU_VISIBLE */
__BEGIN_DECLS
--
2.7.0
More information about the Newlib
mailing list