OSDN Git Service

Declare the nanosleep() function where POSIX expects it.
[mingw/mingw-org-wsl.git] / mingwrt / include / strings.h
1 /*
2  * strings.h
3  *
4  * API declarations for POSIX.1-2008 string functions supported by MinGW.
5  *
6  * $Id$
7  *
8  * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
9  * Copyright (C) 2015, MinGW.org Project.
10  *
11  *
12  * Permission is hereby granted, free of charge, to any person obtaining a
13  * copy of this software and associated documentation files (the "Software"),
14  * to deal in the Software without restriction, including without limitation
15  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16  * and/or sell copies of the Software, and to permit persons to whom the
17  * Software is furnished to do so, subject to the following conditions:
18  *
19  * The above copyright notice, this permission notice, and the following
20  * disclaimer shall be included in all copies or substantial portions of
21  * the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
26  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER
29  * DEALINGS IN THE SOFTWARE.
30  *
31  */
32 #ifndef _STRINGS_H
33 #define _STRINGS_H
34 #pragma GCC system_header
35
36 /* All MinGW system headers must include this...
37  */
38 #include <_mingw.h>
39
40 #ifndef RC_INVOKED
41 /* POSIX.1-2008 requires this header to expose the typedef for size_t; to
42  * ensure consistency, we import this from GCC's own <stddef.h> header.
43  */
44 #define __need_size_t
45 #include <stddef.h>
46
47 _BEGIN_C_DECLS
48
49 int __cdecl __MINGW_NOTHROW strcasecmp( const char *, const char * );
50 int __cdecl __MINGW_NOTHROW strncasecmp( const char *, const char *, size_t );
51
52 #ifndef __NO_INLINE__
53 /* Provide in-line implementations for each of the preceding two functions,
54  * effectively aliasing them to their MSVCRT.DLL (non-standard) equivalents,
55  * (for which we maintain prototypes in <parts/strings.h>).
56  */
57 #include <parts/strings.h>
58
59 __CRT_ALIAS __JMPSTUB__(( FUNCTION = strcasecmp, REMAPPED = _stricmp ))
60   int strcasecmp( const char *__s1, const char *__s2 )
61   { return _stricmp( __s1, __s2 ); }
62
63 __CRT_ALIAS __JMPSTUB__(( FUNCTION = strncasecmp, REMAPPED = _strnicmp ))
64   int strncasecmp( const char *__s1, const char *__s2, size_t __n )
65   { return _strnicmp( __s1, __s2, __n ); }
66
67 #endif /* ! __NO_INLINE__ */
68
69 _END_C_DECLS
70
71 #endif /* ! RC_INVOKED */
72 #endif /* ! _STRINGS_H: $RCSfile$: end of file */