mirror of git://gcc.gnu.org/git/gcc.git
cstring (memchr, [...]): Provide inlines only if __CORRECT_ISO_CPP_STRING_H_PROTO is not defined.
* include/c_std/cstring (memchr, strchr, strpbrk, strrchr, strstr): Provide inlines only if __CORRECT_ISO_CPP_STRING_H_PROTO is not defined. * include/c_std/cwchar (wcschr, wcspbrk, wcsrchr, wcsstr, wmemchr): Provide inlines only if __CORRECT_ISO_CPP_WCHAR_H_PROTO is not defined. * include/c_global/cstring (memchr, strchr, strpbrk, strrchr, strstr): Provide inlines only if __CORRECT_ISO_CPP_STRING_H_PROTO is not defined. * include/c_global/cwchar (wcschr, wcspbrk, wcsrchr, wcsstr, wmemchr): Provide inlines only if __CORRECT_ISO_CPP_WCHAR_H_PROTO is not defined. * testsuite/21_strings/c_strings/char_t/2.cc (test02): If first argument is const char *, assign result to const char * var, not char *. * testsuite/21_strings/c_strings/wchar_t/2.cc (test02): If first argument is const wchar_t *, assign result to const wchar_t * var, not wchar_t *. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r143773
This commit is contained in:
parent
cbdab9c897
commit
60822e0b57
|
|
@ -1,3 +1,25 @@
|
||||||
|
2009-01-30 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* include/c_std/cstring (memchr, strchr, strpbrk, strrchr, strstr):
|
||||||
|
Provide inlines only if __CORRECT_ISO_CPP_STRING_H_PROTO is not
|
||||||
|
defined.
|
||||||
|
* include/c_std/cwchar (wcschr, wcspbrk, wcsrchr, wcsstr, wmemchr):
|
||||||
|
Provide inlines only if __CORRECT_ISO_CPP_WCHAR_H_PROTO is not
|
||||||
|
defined.
|
||||||
|
* include/c_global/cstring (memchr, strchr, strpbrk, strrchr, strstr):
|
||||||
|
Provide inlines only if __CORRECT_ISO_CPP_STRING_H_PROTO is not
|
||||||
|
defined.
|
||||||
|
* include/c_global/cwchar (wcschr, wcspbrk, wcsrchr, wcsstr, wmemchr):
|
||||||
|
Provide inlines only if __CORRECT_ISO_CPP_WCHAR_H_PROTO is not
|
||||||
|
defined.
|
||||||
|
* testsuite/21_strings/c_strings/char_t/2.cc (test02): If first
|
||||||
|
argument is const char *, assign result to const char * var, not
|
||||||
|
char *.
|
||||||
|
* testsuite/21_strings/c_strings/wchar_t/2.cc (test02): If first
|
||||||
|
argument is const wchar_t *, assign result to const wchar_t * var, not
|
||||||
|
wchar_t *.
|
||||||
|
|
||||||
2009-01-29 Jonathan Wakely <jwakely.gcc@gmail.com>
|
2009-01-29 Jonathan Wakely <jwakely.gcc@gmail.com>
|
||||||
|
|
||||||
* include/std/thread: Remove unused headers.
|
* include/std/thread: Remove unused headers.
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// -*- C++ -*- forwarding header.
|
// -*- C++ -*- forwarding header.
|
||||||
|
|
||||||
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|
||||||
// 2006, 2007, 2008
|
// 2006, 2007, 2008, 2009
|
||||||
// Free Software Foundation, Inc.
|
// Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
|
|
@ -96,34 +96,32 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
using ::strspn;
|
using ::strspn;
|
||||||
using ::strtok;
|
using ::strtok;
|
||||||
using ::strxfrm;
|
using ::strxfrm;
|
||||||
|
using ::strchr;
|
||||||
|
using ::strpbrk;
|
||||||
|
using ::strrchr;
|
||||||
|
using ::strstr;
|
||||||
|
|
||||||
|
#ifndef __CORRECT_ISO_CPP_STRING_H_PROTO
|
||||||
inline void*
|
inline void*
|
||||||
memchr(void* __p, int __c, size_t __n)
|
memchr(void* __p, int __c, size_t __n)
|
||||||
{ return memchr(const_cast<const void*>(__p), __c, __n); }
|
{ return memchr(const_cast<const void*>(__p), __c, __n); }
|
||||||
|
|
||||||
using ::strchr;
|
|
||||||
|
|
||||||
inline char*
|
inline char*
|
||||||
strchr(char* __s1, int __n)
|
strchr(char* __s1, int __n)
|
||||||
{ return __builtin_strchr(const_cast<const char*>(__s1), __n); }
|
{ return __builtin_strchr(const_cast<const char*>(__s1), __n); }
|
||||||
|
|
||||||
using ::strpbrk;
|
|
||||||
|
|
||||||
inline char*
|
inline char*
|
||||||
strpbrk(char* __s1, const char* __s2)
|
strpbrk(char* __s1, const char* __s2)
|
||||||
{ return __builtin_strpbrk(const_cast<const char*>(__s1), __s2); }
|
{ return __builtin_strpbrk(const_cast<const char*>(__s1), __s2); }
|
||||||
|
|
||||||
using ::strrchr;
|
|
||||||
|
|
||||||
inline char*
|
inline char*
|
||||||
strrchr(char* __s1, int __n)
|
strrchr(char* __s1, int __n)
|
||||||
{ return __builtin_strrchr(const_cast<const char*>(__s1), __n); }
|
{ return __builtin_strrchr(const_cast<const char*>(__s1), __n); }
|
||||||
|
|
||||||
using ::strstr;
|
|
||||||
|
|
||||||
inline char*
|
inline char*
|
||||||
strstr(char* __s1, const char* __s2)
|
strstr(char* __s1, const char* __s2)
|
||||||
{ return __builtin_strstr(const_cast<const char*>(__s1), __s2); }
|
{ return __builtin_strstr(const_cast<const char*>(__s1), __s2); }
|
||||||
|
#endif
|
||||||
|
|
||||||
_GLIBCXX_END_NAMESPACE
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// -*- C++ -*- forwarding header.
|
// -*- C++ -*- forwarding header.
|
||||||
|
|
||||||
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|
||||||
// 2006, 2007, 2008
|
// 2006, 2007, 2008, 2009
|
||||||
// Free Software Foundation, Inc.
|
// Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
|
|
@ -204,36 +204,33 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
using ::wmemset;
|
using ::wmemset;
|
||||||
using ::wprintf;
|
using ::wprintf;
|
||||||
using ::wscanf;
|
using ::wscanf;
|
||||||
|
|
||||||
using ::wcschr;
|
using ::wcschr;
|
||||||
|
using ::wcspbrk;
|
||||||
|
using ::wcsrchr;
|
||||||
|
using ::wcsstr;
|
||||||
|
using ::wmemchr;
|
||||||
|
|
||||||
|
#ifndef __CORRECT_ISO_CPP_WCHAR_H_PROTO
|
||||||
inline wchar_t*
|
inline wchar_t*
|
||||||
wcschr(wchar_t* __p, wchar_t __c)
|
wcschr(wchar_t* __p, wchar_t __c)
|
||||||
{ return wcschr(const_cast<const wchar_t*>(__p), __c); }
|
{ return wcschr(const_cast<const wchar_t*>(__p), __c); }
|
||||||
|
|
||||||
using ::wcspbrk;
|
|
||||||
|
|
||||||
inline wchar_t*
|
inline wchar_t*
|
||||||
wcspbrk(wchar_t* __s1, const wchar_t* __s2)
|
wcspbrk(wchar_t* __s1, const wchar_t* __s2)
|
||||||
{ return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
|
{ return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
|
||||||
|
|
||||||
using ::wcsrchr;
|
|
||||||
|
|
||||||
inline wchar_t*
|
inline wchar_t*
|
||||||
wcsrchr(wchar_t* __p, wchar_t __c)
|
wcsrchr(wchar_t* __p, wchar_t __c)
|
||||||
{ return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
|
{ return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
|
||||||
|
|
||||||
using ::wcsstr;
|
|
||||||
|
|
||||||
inline wchar_t*
|
inline wchar_t*
|
||||||
wcsstr(wchar_t* __s1, const wchar_t* __s2)
|
wcsstr(wchar_t* __s1, const wchar_t* __s2)
|
||||||
{ return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
|
{ return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
|
||||||
|
|
||||||
using ::wmemchr;
|
|
||||||
|
|
||||||
inline wchar_t*
|
inline wchar_t*
|
||||||
wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
|
wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
|
||||||
{ return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
|
{ return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
|
||||||
|
#endif
|
||||||
|
|
||||||
_GLIBCXX_END_NAMESPACE
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// -*- C++ -*- forwarding header.
|
// -*- C++ -*- forwarding header.
|
||||||
|
|
||||||
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2009
|
||||||
// Free Software Foundation, Inc.
|
// Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
|
|
@ -94,36 +94,33 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
using ::memset;
|
using ::memset;
|
||||||
using ::strerror;
|
using ::strerror;
|
||||||
using ::strlen;
|
using ::strlen;
|
||||||
|
|
||||||
using ::memchr;
|
using ::memchr;
|
||||||
|
using ::strchr;
|
||||||
|
using ::strpbrk;
|
||||||
|
using ::strrchr;
|
||||||
|
using ::strstr;
|
||||||
|
|
||||||
|
#ifndef __CORRECT_ISO_CPP_STRING_H_PROTO
|
||||||
inline void*
|
inline void*
|
||||||
memchr(void* __p, int __c, size_t __n)
|
memchr(void* __p, int __c, size_t __n)
|
||||||
{ return memchr(const_cast<const void*>(__p), __c, __n); }
|
{ return memchr(const_cast<const void*>(__p), __c, __n); }
|
||||||
|
|
||||||
using ::strchr;
|
|
||||||
|
|
||||||
inline char*
|
inline char*
|
||||||
strchr(char* __s1, int __n)
|
strchr(char* __s1, int __n)
|
||||||
{ return __builtin_strchr(const_cast<const char*>(__s1), __n); }
|
{ return __builtin_strchr(const_cast<const char*>(__s1), __n); }
|
||||||
|
|
||||||
using ::strpbrk;
|
|
||||||
|
|
||||||
inline char*
|
inline char*
|
||||||
strpbrk(char* __s1, const char* __s2)
|
strpbrk(char* __s1, const char* __s2)
|
||||||
{ return __builtin_strpbrk(const_cast<const char*>(__s1), __s2); }
|
{ return __builtin_strpbrk(const_cast<const char*>(__s1), __s2); }
|
||||||
|
|
||||||
using ::strrchr;
|
|
||||||
|
|
||||||
inline char*
|
inline char*
|
||||||
strrchr(char* __s1, int __n)
|
strrchr(char* __s1, int __n)
|
||||||
{ return __builtin_strrchr(const_cast<const char*>(__s1), __n); }
|
{ return __builtin_strrchr(const_cast<const char*>(__s1), __n); }
|
||||||
|
|
||||||
using ::strstr;
|
|
||||||
|
|
||||||
inline char*
|
inline char*
|
||||||
strstr(char* __s1, const char* __s2)
|
strstr(char* __s1, const char* __s2)
|
||||||
{ return __builtin_strstr(const_cast<const char*>(__s1), __s2); }
|
{ return __builtin_strstr(const_cast<const char*>(__s1), __s2); }
|
||||||
|
#endif
|
||||||
|
|
||||||
_GLIBCXX_END_NAMESPACE
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// -*- C++ -*- forwarding header.
|
// -*- C++ -*- forwarding header.
|
||||||
|
|
||||||
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|
||||||
// 2006, 2007
|
// 2006, 2007, 2009
|
||||||
// Free Software Foundation, Inc.
|
// Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
|
|
@ -204,36 +204,33 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||||
using ::wmemset;
|
using ::wmemset;
|
||||||
using ::wprintf;
|
using ::wprintf;
|
||||||
using ::wscanf;
|
using ::wscanf;
|
||||||
|
|
||||||
using ::wcschr;
|
using ::wcschr;
|
||||||
|
using ::wcspbrk;
|
||||||
|
using ::wcsrchr;
|
||||||
|
using ::wcsstr;
|
||||||
|
using ::wmemchr;
|
||||||
|
|
||||||
|
#ifndef __CORRECT_ISO_CPP_WCHAR_H_PROTO
|
||||||
inline wchar_t*
|
inline wchar_t*
|
||||||
wcschr(wchar_t* __p, wchar_t __c)
|
wcschr(wchar_t* __p, wchar_t __c)
|
||||||
{ return wcschr(const_cast<const wchar_t*>(__p), __c); }
|
{ return wcschr(const_cast<const wchar_t*>(__p), __c); }
|
||||||
|
|
||||||
using ::wcspbrk;
|
|
||||||
|
|
||||||
inline wchar_t*
|
inline wchar_t*
|
||||||
wcspbrk(wchar_t* __s1, const wchar_t* __s2)
|
wcspbrk(wchar_t* __s1, const wchar_t* __s2)
|
||||||
{ return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
|
{ return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
|
||||||
|
|
||||||
using ::wcsrchr;
|
|
||||||
|
|
||||||
inline wchar_t*
|
inline wchar_t*
|
||||||
wcsrchr(wchar_t* __p, wchar_t __c)
|
wcsrchr(wchar_t* __p, wchar_t __c)
|
||||||
{ return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
|
{ return wcsrchr(const_cast<const wchar_t*>(__p), __c); }
|
||||||
|
|
||||||
using ::wcsstr;
|
|
||||||
|
|
||||||
inline wchar_t*
|
inline wchar_t*
|
||||||
wcsstr(wchar_t* __s1, const wchar_t* __s2)
|
wcsstr(wchar_t* __s1, const wchar_t* __s2)
|
||||||
{ return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
|
{ return wcsstr(const_cast<const wchar_t*>(__s1), __s2); }
|
||||||
|
|
||||||
using ::wmemchr;
|
|
||||||
|
|
||||||
inline wchar_t*
|
inline wchar_t*
|
||||||
wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
|
wmemchr(wchar_t* __p, wchar_t __c, size_t __n)
|
||||||
{ return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
|
{ return wmemchr(const_cast<const wchar_t*>(__p), __c, __n); }
|
||||||
|
#endif
|
||||||
|
|
||||||
_GLIBCXX_END_NAMESPACE
|
_GLIBCXX_END_NAMESPACE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// 2001-04-02 Benjamin Kosnik <bkoz@redhat.com>
|
// 2001-04-02 Benjamin Kosnik <bkoz@redhat.com>
|
||||||
|
|
||||||
// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
|
// Copyright (C) 2001, 2003, 2009 Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
// software; you can redistribute it and/or modify it under the
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
|
@ -32,13 +32,14 @@ void test02()
|
||||||
char carray[50];
|
char carray[50];
|
||||||
strcpy(carray, ccarray1);
|
strcpy(carray, ccarray1);
|
||||||
const void* cv = ccarray1;
|
const void* cv = ccarray1;
|
||||||
void* v;
|
const void* cv1;
|
||||||
|
const char* cc;
|
||||||
char* c;
|
char* c;
|
||||||
|
|
||||||
v = memchr(cv, '/', 3);
|
cv1 = memchr(cv, '/', 3);
|
||||||
c = strchr(ccarray1, '/');
|
cc = strchr(ccarray1, '/');
|
||||||
c = strrchr(ccarray1, 'c');
|
cc = strrchr(ccarray1, 'c');
|
||||||
c = strpbrk(ccarray1, ccarray2);
|
cc = strpbrk(ccarray1, ccarray2);
|
||||||
c = strstr(carray, carray);
|
c = strstr(carray, carray);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// 2001-04-02 Benjamin Kosnik <bkoz@redhat.com>
|
// 2001-04-02 Benjamin Kosnik <bkoz@redhat.com>
|
||||||
|
|
||||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
// Copyright (C) 2001, 2009 Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
// software; you can redistribute it and/or modify it under the
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
|
@ -32,12 +32,13 @@ void test02()
|
||||||
const wchar_t* ccarray2 = L"san francisco sunny-day park inspectors";
|
const wchar_t* ccarray2 = L"san francisco sunny-day park inspectors";
|
||||||
wchar_t carray[50];
|
wchar_t carray[50];
|
||||||
wcscpy(carray, ccarray1);
|
wcscpy(carray, ccarray1);
|
||||||
|
const wchar_t* cw;
|
||||||
wchar_t* w;
|
wchar_t* w;
|
||||||
|
|
||||||
w = wmemchr(ccarray1, L'/', 3);
|
cw = wmemchr(ccarray1, L'/', 3);
|
||||||
w = wcschr(ccarray1, L'/');
|
cw = wcschr(ccarray1, L'/');
|
||||||
w = wcspbrk(ccarray1, ccarray2);
|
cw = wcspbrk(ccarray1, ccarray2);
|
||||||
w = wcsrchr(ccarray1, L'c');
|
cw = wcsrchr(ccarray1, L'c');
|
||||||
w = wcsstr(carray, carray);
|
w = wcsstr(carray, carray);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue