Browse Source

Bug 7983 fixed by Bernhard Rosenkraenzer

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@116487 91177308-0d34-0410-b5e6-96231b3b80d8
Howard Hinnant 15 years ago
parent
commit
8177207f3c
1 changed files with 7 additions and 4 deletions
  1. 7 4
      include/cstring

+ 7 - 4
include/cstring

@@ -78,23 +78,26 @@ using ::strcoll;
 using ::strxfrm;
 using ::strxfrm;
 
 
 using ::memchr;
 using ::memchr;
-inline _LIBCPP_INLINE_VISIBILITY       void* memchr(      void* __s, int __c, size_t __n) {return ::memchr(__s, __c, __n);}
 
 
 using ::strchr;
 using ::strchr;
-inline _LIBCPP_INLINE_VISIBILITY       char* strchr(      char* __s, int __c) {return ::strchr(__s, __c);}
 
 
 using ::strcspn;
 using ::strcspn;
 
 
 using ::strpbrk;
 using ::strpbrk;
-inline _LIBCPP_INLINE_VISIBILITY       char* strpbrk(      char* __s1, const char* __s2) {return ::strpbrk(__s1, __s2);}
 
 
 using ::strrchr;
 using ::strrchr;
-inline _LIBCPP_INLINE_VISIBILITY       char* strrchr(      char* __s, int __c) {return ::strrchr(__s, __c);}
 
 
 using ::strspn;
 using ::strspn;
 
 
 using ::strstr;
 using ::strstr;
+
+#ifndef __GLIBC__ // GNU libc and its derivates already have the correct prototype in <string.h> #ifdef __cplusplus
+inline _LIBCPP_INLINE_VISIBILITY       char* strchr(      char* __s, int __c) {return ::strchr(__s, __c);}
+inline _LIBCPP_INLINE_VISIBILITY       char* strpbrk(      char* __s1, const char* __s2) {return ::strpbrk(__s1, __s2);}
+inline _LIBCPP_INLINE_VISIBILITY       char* strrchr(      char* __s, int __c) {return ::strrchr(__s, __c);}
+inline _LIBCPP_INLINE_VISIBILITY       void* memchr(      void* __s, int __c, size_t __n) {return ::memchr(__s, __c, __n);}
 inline _LIBCPP_INLINE_VISIBILITY       char* strstr(      char* __s1, const char* __s2) {return ::strstr(__s1, __s2);}
 inline _LIBCPP_INLINE_VISIBILITY       char* strstr(      char* __s1, const char* __s2) {return ::strstr(__s1, __s2);}
+#endif
 
 
 using ::strtok;
 using ::strtok;
 using ::memset;
 using ::memset;