about summary refs log tree commit diff
path: root/string/bits
diff options
context:
space:
mode:
Diffstat (limited to 'string/bits')
-rw-r--r--string/bits/string2.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/string/bits/string2.h b/string/bits/string2.h
index 4904a3e4c0..0c28b3e122 100644
--- a/string/bits/string2.h
+++ b/string/bits/string2.h
@@ -1,5 +1,5 @@
 /* Machine-independant string function optimizations.
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -252,6 +252,16 @@ __mempcpy_small (void *__dest1, char __src1,
 #endif
 
 
+/* Return pointer to C in S.  */
+#ifndef _HAVE_STRING_ARCH_strchr
+extern __ptr_t __rawmemchr (const __ptr_t __s, int __c);
+# define strchr(s, c) \
+  (__extension__ (__builtin_constant_p (c) && (c) == '\0'		      \
+		  ? (char *) __rawmemchr (s, c)				      \
+		  : strchr (s, c)))
+#endif
+
+
 /* Copy SRC to DEST.  */
 #ifndef _HAVE_STRING_ARCH_strcpy
 # define strcpy(dest, src) \