about summary refs log tree commit diff
path: root/include/string.h
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-01-13 15:03:46 -0800
committerH.J. Lu <hjl.tools@gmail.com>2016-01-15 08:43:07 -0800
commit3d27f14d247b988f3a226dce0112f7e0a69f5c30 (patch)
tree71a148ddbf4f83e4a302cf0ff7bbb5dea7b89e06 /include/string.h
parentf57d833a807aa443a89e54c518a64df1cdecbe77 (diff)
downloadglibc-3d27f14d247b988f3a226dce0112f7e0a69f5c30.tar.gz
glibc-3d27f14d247b988f3a226dce0112f7e0a69f5c30.tar.xz
glibc-3d27f14d247b988f3a226dce0112f7e0a69f5c30.zip
Avoid strdup/strndup/strsep hjl/pr19463
Diffstat (limited to 'include/string.h')
-rw-r--r--include/string.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/string.h b/include/string.h
index e145bfdb4c..151e420478 100644
--- a/include/string.h
+++ b/include/string.h
@@ -71,6 +71,12 @@ extern __typeof (strncasecmp_l) __strncasecmp_l;
       __new[__len] = '\0';						      \
       (char *) memcpy (__new, __old, __len);				      \
     }))
+
+# ifdef __OPTIMIZE_SIZE__
+#  define strdup(s)		__strdup ((s))
+#  define strndup(s, n)		__strndup ((s), (n))
+#  define strsep(s, d)		__strsep ((s), (d))
+# endif
 #endif
 
 libc_hidden_proto (__mempcpy)
@@ -99,6 +105,7 @@ libc_hidden_proto (memmem)
 extern __typeof (memmem) __memmem;
 libc_hidden_proto (__memmem)
 libc_hidden_proto (__ffs)
+libc_hidden_proto (__strsep)
 
 libc_hidden_builtin_proto (memchr)
 libc_hidden_builtin_proto (memcpy)