@@ -18,9 +18,9 @@
#ifndef _FNMATCH_H
#define _FNMATCH_H 1
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <features.h>
+
+__BEGIN_DECLS
/* We #undef these before defining them because some losing systems
(HP-UX A.08.07 for example) define these in <unistd.h>. */
@@ -33,7 +33,7 @@ extern "C" {
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
-#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
+#ifdef __USE_GNU
# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
@@ -47,7 +47,7 @@ extern "C" {
`fnmatch'. Since this is not the case here it will never be
returned but the conformance test suites still require the symbol
to be defined. */
-#ifdef _XOPEN_SOURCE
+#if defined __USE_XOPEN && !defined __USE_XOPEN2K8
# define FNM_NOSYS (-1)
#endif
@@ -55,8 +55,6 @@ extern "C" {
returning zero if it matches, FNM_NOMATCH if not. */
extern int fnmatch (const char *__pattern, const char *__name, int __flags);
-#ifdef __cplusplus
-}
-#endif
+__END_DECLS
#endif /* fnmatch.h */