netdev-dpdk: fix mbuf leaks
[cascardo/ovs.git] / lib / string.h.in
1 /*
2  * Copyright (c) 2009, 2011, 2013 Nicira, Inc.
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
17 #ifndef STRING_WRAPPER_H
18 #define STRING_WRAPPER_H 1
19
20 #@INCLUDE_NEXT@ @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
34 #ifdef _WIN32
35 #define strtok_r strtok_s
36 #define strcasecmp _stricmp
37 #define strncasecmp _strnicmp
38 #define strerror_r(errnum, buf, buflen) strerror_s(buf, buflen, errnum)
39 #endif
40
41 #ifndef HAVE_STRNLEN
42 #undef strnlen
43 #define strnlen rpl_strnlen
44 size_t strnlen(const char *, size_t maxlen);
45 #endif
46
47 #endif /* string.h wrapper */