]>
Commit | Line | Data |
---|---|---|
98e6e789 | 1 | // -*- C++ -*- forwarding header. |
22aef514 | 2 | |
5f3e3df6 PC |
3 | // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, |
4 | // 2006, 2007, 2008, 2009, 2010 | |
34ff0b99 | 5 | // Free Software Foundation, Inc. |
22aef514 BK |
6 | // |
7 | // This file is part of the GNU ISO C++ Library. This library is free | |
8 | // software; you can redistribute it and/or modify it under the | |
9 | // terms of the GNU General Public License as published by the | |
748086b7 | 10 | // Free Software Foundation; either version 3, or (at your option) |
22aef514 BK |
11 | // any later version. |
12 | ||
13 | // This library is distributed in the hope that it will be useful, | |
14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | // GNU General Public License for more details. | |
17 | ||
748086b7 JJ |
18 | // Under Section 7 of GPL version 3, you are granted additional |
19 | // permissions described in the GCC Runtime Library Exception, version | |
20 | // 3.1, as published by the Free Software Foundation. | |
22aef514 | 21 | |
748086b7 JJ |
22 | // You should have received a copy of the GNU General Public License and |
23 | // a copy of the GCC Runtime Library Exception along with this program; | |
24 | // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | |
25 | // <http://www.gnu.org/licenses/>. | |
22aef514 | 26 | |
ffe94f83 PE |
27 | /** @file cstring |
28 | * This is a Standard C++ Library file. You should @c #include this file | |
29 | * in your programs, rather than any of the "*.h" implementation files. | |
30 | * | |
31 | * This is the C++ version of the Standard C Library header @c string.h, | |
32 | * and its contents are (mostly) the same as that header, but are all | |
097588e4 PC |
33 | * contained in the namespace @c std (except for names which are defined |
34 | * as macros in C). | |
ffe94f83 PE |
35 | */ |
36 | ||
143c27b0 BK |
37 | // |
38 | // ISO C++ 14882: 20.4.6 C library | |
39 | // | |
40 | ||
1143680e SE |
41 | #ifndef _GLIBCXX_CSTRING |
42 | #define _GLIBCXX_CSTRING 1 | |
34ff0b99 BK |
43 | |
44 | #pragma GCC system_header | |
22aef514 | 45 | |
3cbc7af0 | 46 | #include <bits/c++config.h> |
54c1bf78 | 47 | #include <cstddef> |
c0dae541 | 48 | #include <string.h> |
98e6e789 | 49 | |
8089616e BK |
50 | // Get rid of those macros defined in <string.h> in lieu of real functions. |
51 | #undef memcpy | |
52 | #undef memmove | |
53 | #undef strcpy | |
54 | #undef strncpy | |
55 | #undef strcat | |
56 | #undef strncat | |
57 | #undef memcmp | |
58 | #undef strcmp | |
59 | #undef strcoll | |
60 | #undef strncmp | |
61 | #undef strxfrm | |
62 | #undef memchr | |
63 | #undef strchr | |
64 | #undef strcspn | |
65 | #undef strpbrk | |
66 | #undef strrchr | |
67 | #undef strspn | |
68 | #undef strstr | |
69 | #undef strtok | |
70 | #undef memset | |
71 | #undef strerror | |
72 | #undef strlen | |
73 | ||
3cbc7af0 BK |
74 | _GLIBCXX_BEGIN_NAMESPACE(std) |
75 | ||
de96ac46 BK |
76 | using ::memcpy; |
77 | using ::memmove; | |
78 | using ::strcpy; | |
79 | using ::strncpy; | |
80 | using ::strcat; | |
81 | using ::strncat; | |
82 | using ::memcmp; | |
83 | using ::strcmp; | |
84 | using ::strcoll; | |
85 | using ::strncmp; | |
86 | using ::strxfrm; | |
87 | using ::strcspn; | |
88 | using ::strspn; | |
89 | using ::strtok; | |
90 | using ::memset; | |
91 | using ::strerror; | |
92 | using ::strlen; | |
de96ac46 | 93 | using ::memchr; |
60822e0b UD |
94 | using ::strchr; |
95 | using ::strpbrk; | |
96 | using ::strrchr; | |
97 | using ::strstr; | |
eeff8d2c | 98 | |
60822e0b | 99 | #ifndef __CORRECT_ISO_CPP_STRING_H_PROTO |
92c3688a | 100 | inline void* |
5f3e3df6 PC |
101 | memchr(void* __s, int __c, size_t __n) |
102 | { return __builtin_memchr(__s, __c, __n); } | |
eeff8d2c | 103 | |
92c3688a | 104 | inline char* |
5f3e3df6 PC |
105 | strchr(char* __s, int __n) |
106 | { return __builtin_strchr(__s, __n); } | |
eeff8d2c | 107 | |
92c3688a SW |
108 | inline char* |
109 | strpbrk(char* __s1, const char* __s2) | |
5f3e3df6 | 110 | { return __builtin_strpbrk(__s1, __s2); } |
eeff8d2c | 111 | |
92c3688a | 112 | inline char* |
5f3e3df6 PC |
113 | strrchr(char* __s, int __n) |
114 | { return __builtin_strrchr(__s, __n); } | |
eeff8d2c | 115 | |
92c3688a SW |
116 | inline char* |
117 | strstr(char* __s1, const char* __s2) | |
5f3e3df6 | 118 | { return __builtin_strstr(__s1, __s2); } |
60822e0b | 119 | #endif |
3cbc7af0 BK |
120 | |
121 | _GLIBCXX_END_NAMESPACE | |
22aef514 | 122 | |
98e6e789 | 123 | #endif |