]> git.proxmox.com Git - mirror_ovs.git/blame - lib/string.h.in
cirrus: Use FreeBSD 12.2.
[mirror_ovs.git] / lib / string.h.in
CommitLineData
a14bc59f 1/*
ab6f684e 2 * Copyright (c) 2009, 2011, 2013, 2017 Nicira, Inc.
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
4e857508 20#@INCLUDE_NEXT@ @NEXT_STRING_H@
8d3a769e
BP
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
e42dfc72
AS
34#ifdef _WIN32
35#define strtok_r strtok_s
36#define strcasecmp _stricmp
37#define strncasecmp _strnicmp
707b3025 38#define strerror_r(errnum, buf, buflen) strerror_s(buf, buflen, errnum)
ab6f684e 39char *strcasestr(const char *, const char *);
e42dfc72
AS
40#endif
41
0e191d8f
BP
42#ifndef HAVE_STRNLEN
43#undef strnlen
44#define strnlen rpl_strnlen
45size_t strnlen(const char *, size_t maxlen);
46#endif
47
8d3a769e 48#endif /* string.h wrapper */