OSDN Git Service

Refactor to make <parts/time.h> redundant.
[mingw/mingw-org-wsl.git] / mingwrt / include / parts / strings.h
1 /*
2  * parts/strings.h
3  *
4  * Internal header file, declaring function prototypes which we require
5  * to be declared in our POSIX.1 conforming <strings.h> header, but for
6  * which MSVC expects to find declarations in <string.h>.
7  *
8  * $Id$
9  *
10  * Written by Keith Marshall  <keithmarshall@users.sourceforge.net>
11  * Copyright (C) 2015, MinGW.org Project.
12  *
13  *
14  * Permission is hereby granted, free of charge, to any person obtaining a
15  * copy of this software and associated documentation files (the "Software"),
16  * to deal in the Software without restriction, including without limitation
17  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
18  * and/or sell copies of the Software, and to permit persons to whom the
19  * Software is furnished to do so, subject to the following conditions:
20  *
21  * The above copyright notice, this permission notice, and the following
22  * disclaimer shall be included in all copies or substantial portions of
23  * the Software.
24  *
25  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
26  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
28  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER
31  * DEALINGS IN THE SOFTWARE.
32  *
33  */
34 #if _FAKE_STRINGS_H_SOURCED
35 /*
36  * Since we expect this part-header to be sourced exclusively by other
37  * system headers, (nominally <strings.h>), we don't apply any conventional
38  * multiple inclusion guard; rather, we rely on the guard within <strings.h>
39  * itself, but allow other headers to fake it for one-shot inclusion...
40  */
41 # undef _FAKE_STRINGS_H_SOURCED
42
43 #elif ! defined _STRINGS_H
44 /*
45  * ...otherwise, we fail if the <strings.h> guard is not in place.
46  */
47 # error "Never include <parts/strings.h> directly; use <strings.h> instead"
48 #endif
49
50 /* These are the MSVCRT.DLL equivalents for POSIX.1's strcasecmp() and
51  * strncasecmp() functions, for which we provide in-line implementations
52  * in <strings.h> respectively; MSVC expects to find these prototypes in
53  * <string.h>, but we also need them in <strings.h>.
54  */
55 _CRTIMP int __cdecl __MINGW_NOTHROW  _stricmp( const char *, const char * );
56 _CRTIMP int __cdecl __MINGW_NOTHROW _strnicmp( const char *, const char *, size_t );
57
58 /* $RCSfile$: end of file */