about summary refs log tree commit diff
path: root/sysdeps/i386/i486/bits/string.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386/i486/bits/string.h')
-rw-r--r--sysdeps/i386/i486/bits/string.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/sysdeps/i386/i486/bits/string.h b/sysdeps/i386/i486/bits/string.h
index ef808d2e7d..80fcc48a2b 100644
--- a/sysdeps/i386/i486/bits/string.h
+++ b/sysdeps/i386/i486/bits/string.h
@@ -979,6 +979,14 @@ __strchr_g (__const char *__s, int __c)
 }
 
 
+/* Find the first occurrence of C in S.  This is the BSD name.  */
+#define _HAVE_STRING_ARCH_index 1
+#define index(s, c) \
+  (__extension__ (__builtin_constant_p (c)				      \
+		  ? __strchr_c (s, ((c) & 0xff) << 8)			      \
+		  : __strchr_g (s, c)))
+
+
 /* Find the last occurrence of C in S.  */
 #define _HAVE_STRING_ARCH_strrchr 1
 #define strrchr(s, c) \
@@ -1067,6 +1075,14 @@ __strrchr_g (__const char *__s, int __c)
 #endif
 
 
+/* Find the last occurrence of C in S.  This is the BSD name.  */
+#define _HAVE_STRING_ARCH_rindex 1
+#define rindex(s, c) \
+  (__extension__ (__builtin_constant_p (c)				      \
+		  ? __strrchr_c (s, ((c) & 0xff) << 8)			      \
+		  : __strrchr_g (s, c)))
+
+
 /* Return the length of the initial segment of S which
    consists entirely of characters not in REJECT.  */
 #define _HAVE_STRING_ARCH_strcspn 1