summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 446d746cc..89dbdabba 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -48,7 +48,12 @@
c: means c:\.
*/
-#define _BASENAME_DEFINED
+/* This file includes both the XPG and GNU basename functions, with the
+ former exported as "basename" for ABI compatibility but the latter
+ declared as such for source compatibility with glibc. This tells
+ <string.h> not to declare the GNU variant in order to prevent a conflicting
+ declaration error with the XPG variant implemented herein. */
+#define basename basename
#include "winsup.h"
#include "miscfuncs.h"
#include <ctype.h>
@@ -70,6 +75,7 @@
#include <ntdll.h>
#include <wchar.h>
#include <wctype.h>
+#undef basename
suffix_info stat_suffixes[] =
{
@@ -4739,8 +4745,6 @@ out:
return buf;
}
-#undef basename
-
/* No need to be reentrant or thread-safe according to SUSv3.
/ and \\ are treated equally. Leading drive specifiers are
kept intact as far as it makes sense. Everything else is