aboutsummaryrefslogtreecommitdiff
path: root/string
diff options
context:
space:
mode:
authorDJ Delorie <dj@delorie.com>2016-08-11 18:42:42 -0400
committerDJ Delorie <dj@delorie.com>2016-08-11 18:42:42 -0400
commit528795b01909b0c41ec3049fa115a107c8898a20 (patch)
treeeb3df1ef5e0f8d502618ba6192c50837339cb50a /string
parent4a6779937b839669f2ee8bb085d715125aa882c7 (diff)
parentab70f211651f50622d7f8afe3f6a68c472b1fb5a (diff)
downloadglibc-528795b01909b0c41ec3049fa115a107c8898a20.tar.xz
glibc-528795b01909b0c41ec3049fa115a107c8898a20.zip
Merge branch 'master' into dj/malloc
Diffstat (limited to 'string')
-rw-r--r--string/string.h8
-rw-r--r--string/test-strncmp.c6
2 files changed, 11 insertions, 3 deletions
diff --git a/string/string.h b/string/string.h
index c7f8fde7b8..57deaa4191 100644
--- a/string/string.h
+++ b/string/string.h
@@ -22,7 +22,8 @@
#ifndef _STRING_H
#define _STRING_H 1
-#include <features.h>
+#define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
+#include <bits/libc-header-start.h>
__BEGIN_DECLS
@@ -166,7 +167,8 @@ extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
__locale_t __l) __THROW __nonnull ((2, 4));
#endif
-#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
+#if (defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 \
+ || __GLIBC_USE (LIB_EXT2))
/* Duplicate S, returning an identical malloc'd string. */
extern char *strdup (const char *__s)
__THROW __attribute_malloc__ __nonnull ((1));
@@ -175,7 +177,7 @@ extern char *strdup (const char *__s)
/* Return a malloc'd copy of at most N bytes of STRING. The
resultant string is terminated even if no null terminator
appears before STRING[N]. */
-#if defined __USE_XOPEN2K8
+#if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2)
extern char *strndup (const char *__string, size_t __n)
__THROW __attribute_malloc__ __nonnull ((1));
#endif
diff --git a/string/test-strncmp.c b/string/test-strncmp.c
index 8c0a331fc8..d3922483bb 100644
--- a/string/test-strncmp.c
+++ b/string/test-strncmp.c
@@ -156,6 +156,9 @@ do_test_limit (size_t align1, size_t align2, size_t len, size_t n, int max_char,
size_t i, align_n;
CHAR *s1, *s2;
+ align1 &= ~(CHARBYTES - 1);
+ align2 &= ~(CHARBYTES - 1);
+
if (n == 0)
{
s1 = (CHAR *) (buf1 + page_size);
@@ -204,6 +207,9 @@ do_test (size_t align1, size_t align2, size_t len, size_t n, int max_char,
size_t i;
CHAR *s1, *s2;
+ align1 &= ~(CHARBYTES - 1);
+ align2 &= ~(CHARBYTES - 1);
+
if (n == 0)
return;