]>
Commit | Line | Data |
---|---|---|
a14bc59f | 1 | /* |
0e191d8f | 2 | * Copyright (c) 2009, 2011 Nicira Networks. |
a14bc59f BP |
3 | * |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at: | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | ||
8d3a769e BP |
17 | #ifndef STRING_WRAPPER_H |
18 | #define STRING_WRAPPER_H 1 | |
19 | ||
20 | #include_next <string.h> | |
21 | ||
22 | /* Glibc 2.7 has a bug in strtok_r when compiling with optimization that can | |
23 | * cause segfaults if the delimiters argument is a compile-time constant that | |
24 | * has exactly 1 character: | |
25 | * | |
26 | * http://sources.redhat.com/bugzilla/show_bug.cgi?id=5614 | |
27 | * | |
28 | * The bug is only present in the inline version of strtok_r(), so force the | |
29 | * out-of-line version to be used instead. */ | |
30 | #if HAVE_STRTOK_R_BUG | |
31 | #undef strtok_r | |
32 | #endif | |
33 | ||
0e191d8f BP |
34 | #ifndef HAVE_STRNLEN |
35 | #undef strnlen | |
36 | #define strnlen rpl_strnlen | |
37 | size_t strnlen(const char *, size_t maxlen); | |
38 | #endif | |
39 | ||
8d3a769e | 40 | #endif /* string.h wrapper */ |