This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Update feature guard for strdup/strndup in <bits/string2.h>
- From: Andreas Schwab <schwab at suse dot de>
- To: libc-alpha at sourceware dot org
- Date: Thu, 12 Jun 2014 14:47:26 +0200
- Subject: [PATCH] Update feature guard for strdup/strndup in <bits/string2.h>
- Authentication-results: sourceware.org; auth=none
When strdup/strndup were promoted to POSIX 2008 the feature guards in
<bits/string2.h> weren't updated.
Andreas.
* string/bits/string2.h (strdup, strndup): Update feature guard.
diff --git a/string/bits/string2.h b/string/bits/string2.h
index 1b6a1ef..0523a27 100644
--- a/string/bits/string2.h
+++ b/string/bits/string2.h
@@ -1287,7 +1287,7 @@ extern char *__strdup (const char *__string) __THROW __attribute_malloc__;
__retval; })) \
: __strdup (s)))
-# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
+# if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
# define strdup(s) __strdup (s)
# endif
# endif
@@ -1315,7 +1315,7 @@ extern char *__strndup (const char *__string, size_t __n)
__retval; })) \
: __strndup (s, n)))
-# ifdef __USE_GNU
+# ifdef __USE_XOPEN2K8
# define strndup(s, n) __strndup (s, n)
# endif
# endif
--
2.0.0
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."