authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-11-30 13:13:08+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-12-14 07:02:14+01:00
log45fff0a511942d410d657be31bdbdf10a45a6a57
tree277042798290805bf9382fe75ca6ad61ece36767
parent87083e8e7e440548599b88eb9ce02e4914a72809
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

mingw: Update sources to dcd7fefc703fb4b12187235386900d34cc13fdc5.


141 files changed, 12936 insertions(+), 3982 deletions(-)

lib/libc/mingw/crt/crtdll.c+2
......@@ -204,6 +204,8 @@ i__leave:
204204
205205int __cdecl atexit (_PVFV func)
206206{
207 /* Do not use msvcrt's atexit() or UCRT's _crt_atexit() function as it
208 * cannot be called from DLL library which may be unloaded at runtime. */
207209 return _register_onexit_function(&atexit_table, (_onexit_t)func);
208210}
209211
lib/libc/mingw/crt/crtexe.c+8-11
......@@ -20,21 +20,12 @@
2020#include <tchar.h>
2121#include <sect_attribs.h>
2222#include <locale.h>
23#include <corecrt_startup.h>
2324
2425#if defined(__SEH__) && (!defined(__clang__) || __clang_major__ >= 7)
2526#define SEH_INLINE_ASM
2627#endif
2728
28#ifndef __winitenv
29extern wchar_t *** __MINGW_IMP_SYMBOL(__winitenv);
30#define __winitenv (* __MINGW_IMP_SYMBOL(__winitenv))
31#endif
32
33#if !defined(__initenv)
34extern char *** __MINGW_IMP_SYMBOL(__initenv);
35#define __initenv (* __MINGW_IMP_SYMBOL(__initenv))
36#endif
37
3829extern IMAGE_DOS_HEADER __ImageBase;
3930
4031extern void _fpreset (void);
......@@ -43,6 +34,7 @@ int *__cdecl __p__commode(void);
4334
4435#undef _fmode
4536extern int _fmode;
37#undef _commode
4638extern int _commode;
4739extern int _dowildcard;
4840
......@@ -334,7 +326,12 @@ static void duplicate_ppstrings (int ac, _TCHAR ***av)
334326
335327int __cdecl atexit (_PVFV func)
336328{
337 return _onexit((_onexit_t)func) ? 0 : -1;
329 /*
330 * msvcrt def file renames the real atexit() function to _crt_atexit().
331 * UCRT provides atexit() function only under name _crt_atexit().
332 * So redirect call to _crt_atexit() function.
333 */
334 return _crt_atexit(func);
338335}
339336
340337char __mingw_module_is_dll = 0;
lib/libc/mingw/crt/dllentry.c deleted-18
......@@ -1,18 +0,0 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#include <oscalls.h>
8#define _DECL_DLLMAIN
9#include <process.h>
10
11BOOL WINAPI DllEntryPoint (HANDLE, DWORD, LPVOID);
12
13BOOL WINAPI DllEntryPoint (HANDLE __UNUSED_PARAM(hDllHandle),
14 DWORD __UNUSED_PARAM(dwReason),
15 LPVOID __UNUSED_PARAM(lpreserved))
16{
17 return TRUE;
18}
lib/libc/mingw/crt/dllmain.c deleted-10
......@@ -1,10 +0,0 @@
1#include <oscalls.h>
2#define _DECL_DLLMAIN
3#include <process.h>
4
5BOOL WINAPI DllMain (HANDLE __UNUSED_PARAM(hDllHandle),
6 DWORD __UNUSED_PARAM(dwReason),
7 LPVOID __UNUSED_PARAM(lpreserved))
8{
9 return TRUE;
10}
lib/libc/mingw/crt/tls_atexit.c+1-1
......@@ -169,4 +169,4 @@ static void WINAPI tls_callback(HANDLE hDllHandle, DWORD dwReason, LPVOID __UNUS
169169 }
170170}
171171
172_CRTALLOC(".CRT$XLB") PIMAGE_TLS_CALLBACK __xl_b = (PIMAGE_TLS_CALLBACK) tls_callback;
172_CRTALLOC(".CRT$XLB") PIMAGE_TLS_CALLBACK __xl_b = tls_callback;
lib/libc/mingw/crt/tlssup.c+9-10
......@@ -71,9 +71,10 @@ static __CRT_THREAD TlsDtorNode dtor_list_head;
7171
7272extern int _CRT_MT;
7373
74BOOL WINAPI __dyn_tls_init (HANDLE, DWORD, LPVOID);
74void WINAPI __dyn_tls_init (HANDLE, DWORD, LPVOID);
75void WINAPI __dyn_tls_dtor (HANDLE, DWORD, LPVOID);
7576
76BOOL WINAPI
77void WINAPI
7778__dyn_tls_init (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
7879{
7980 _PVFV *pfunc;
......@@ -87,7 +88,7 @@ __dyn_tls_init (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
8788 {
8889 if (dwReason == DLL_PROCESS_ATTACH)
8990 __mingw_TLScallback (hDllHandle, dwReason, lpreserved);
90 return TRUE;
91 return;
9192 }
9293
9394 ps = (uintptr_t) &__xd_a;
......@@ -98,11 +99,10 @@ __dyn_tls_init (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
9899 if (*pfunc != NULL)
99100 (*pfunc)();
100101 }
101 return TRUE;
102102}
103103
104const PIMAGE_TLS_CALLBACK __dyn_tls_init_callback = (const PIMAGE_TLS_CALLBACK) __dyn_tls_init;
105_CRTALLOC(".CRT$XLC") PIMAGE_TLS_CALLBACK __xl_c = (PIMAGE_TLS_CALLBACK) __dyn_tls_init;
104const PIMAGE_TLS_CALLBACK __dyn_tls_init_callback = __dyn_tls_init;
105_CRTALLOC(".CRT$XLC") PIMAGE_TLS_CALLBACK __xl_c = __dyn_tls_init;
106106
107107int __cdecl __tlregdtor (_PVFV);
108108
......@@ -133,7 +133,7 @@ __tlregdtor (_PVFV func)
133133 return 0;
134134}
135135
136static BOOL WINAPI
136void WINAPI
137137__dyn_tls_dtor (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
138138{
139139#if !defined (DISABLE_MS_TLS)
......@@ -142,7 +142,7 @@ __dyn_tls_dtor (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
142142#endif
143143
144144 if (dwReason != DLL_THREAD_DETACH && dwReason != DLL_PROCESS_DETACH)
145 return TRUE;
145 return;
146146 /* As TLS variables are detroyed already by DLL_THREAD_DETACH
147147 call, we have to avoid access on the possible DLL_PROCESS_DETACH
148148 call the already destroyed TLS vars.
......@@ -165,10 +165,9 @@ __dyn_tls_dtor (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
165165 }
166166#endif
167167 __mingw_TLScallback (hDllHandle, dwReason, lpreserved);
168 return TRUE;
169168}
170169
171_CRTALLOC(".CRT$XLD") PIMAGE_TLS_CALLBACK __xl_d = (PIMAGE_TLS_CALLBACK) __dyn_tls_dtor;
170_CRTALLOC(".CRT$XLD") PIMAGE_TLS_CALLBACK __xl_d = __dyn_tls_dtor;
172171
173172
174173int __mingw_initltsdrot_force = 0;
lib/libc/mingw/crt/ucrtbase_compat.c deleted-169
......@@ -1,169 +0,0 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#ifdef __GNUC__
8#pragma GCC diagnostic push
9#pragma GCC diagnostic ignored "-Winline"
10#endif
11
12#undef __MSVCRT_VERSION__
13#define _UCRT
14
15#define __getmainargs crtimp___getmainargs
16#define __wgetmainargs crtimp___wgetmainargs
17#define _amsg_exit crtimp__amsg_exit
18#define _get_output_format crtimp__get_output_format
19
20#include <internal.h>
21#include <sect_attribs.h>
22#include <stdio.h>
23#include <time.h>
24#include <corecrt_startup.h>
25
26#undef __getmainargs
27#undef __wgetmainargs
28#undef _amsg_exit
29#undef _get_output_format
30
31
32
33// Declarations of non-static functions implemented within this file (that aren't
34// declared in any of the included headers, and that isn't mapped away with a define
35// to get rid of the _CRTIMP in headers).
36int __cdecl __getmainargs(int * _Argc, char *** _Argv, char ***_Env, int _DoWildCard, _startupinfo *_StartInfo);
37int __cdecl __wgetmainargs(int * _Argc, wchar_t *** _Argv, wchar_t ***_Env, int _DoWildCard, _startupinfo *_StartInfo);
38void __cdecl __MINGW_ATTRIB_NORETURN _amsg_exit(int ret);
39unsigned int __cdecl _get_output_format(void);
40
41int __cdecl __ms_fwprintf(FILE *, const wchar_t *, ...);
42
43// Declarations of functions from ucrtbase.dll that we use below
44_CRTIMP int* __cdecl __p___argc(void);
45_CRTIMP char*** __cdecl __p___argv(void);
46_CRTIMP wchar_t*** __cdecl __p___wargv(void);
47_CRTIMP char*** __cdecl __p__environ(void);
48_CRTIMP wchar_t*** __cdecl __p__wenviron(void);
49
50_CRTIMP int __cdecl _initialize_narrow_environment(void);
51_CRTIMP int __cdecl _initialize_wide_environment(void);
52_CRTIMP int __cdecl _configure_narrow_argv(int mode);
53_CRTIMP int __cdecl _configure_wide_argv(int mode);
54
55// Declared in new.h, but only visible to C++
56_CRTIMP int __cdecl _set_new_mode(int _NewMode);
57
58extern char __mingw_module_is_dll;
59
60
61// Wrappers with legacy msvcrt.dll style API, based on the new ucrtbase.dll functions.
62int __cdecl __getmainargs(int * _Argc, char *** _Argv, char ***_Env, int _DoWildCard, _startupinfo *_StartInfo)
63{
64 _initialize_narrow_environment();
65 _configure_narrow_argv(_DoWildCard ? 2 : 1);
66 *_Argc = *__p___argc();
67 *_Argv = *__p___argv();
68 *_Env = *__p__environ();
69 if (_StartInfo)
70 _set_new_mode(_StartInfo->newmode);
71 return 0;
72}
73
74int __cdecl __wgetmainargs(int * _Argc, wchar_t *** _Argv, wchar_t ***_Env, int _DoWildCard, _startupinfo *_StartInfo)
75{
76 _initialize_wide_environment();
77 _configure_wide_argv(_DoWildCard ? 2 : 1);
78 *_Argc = *__p___argc();
79 *_Argv = *__p___wargv();
80 *_Env = *__p__wenviron();
81 if (_StartInfo)
82 _set_new_mode(_StartInfo->newmode);
83 return 0;
84}
85
86_onexit_t __cdecl _onexit(_onexit_t func)
87{
88 return _crt_atexit((_PVFV)func) == 0 ? func : NULL;
89}
90
91_onexit_t __cdecl (*__MINGW_IMP_SYMBOL(_onexit))(_onexit_t func) = _onexit;
92
93int __cdecl at_quick_exit(void (__cdecl *func)(void))
94{
95 // In a DLL, we can't register a function with _crt_at_quick_exit, because
96 // we can't unregister it when the DLL is unloaded. This matches how
97 // at_quick_exit/quick_exit work with MSVC with a dynamically linked CRT.
98 if (__mingw_module_is_dll)
99 return 0;
100 return _crt_at_quick_exit(func);
101}
102
103int __cdecl (*__MINGW_IMP_SYMBOL(at_quick_exit))(void (__cdecl *)(void)) = at_quick_exit;
104
105void __cdecl __MINGW_ATTRIB_NORETURN _amsg_exit(int ret) {
106 fprintf(stderr, "runtime error %d\n", ret);
107 _exit(255);
108}
109
110unsigned int __cdecl _get_output_format(void)
111{
112 return 0;
113}
114
115
116// These are required to provide the unrepfixed data symbols "timezone"
117// and "tzname"; we can't remap "timezone" via a define due to clashes
118// with e.g. "struct timezone".
119typedef void __cdecl (*_tzset_func)(void);
120extern _tzset_func __MINGW_IMP_SYMBOL(_tzset);
121
122// Default initial values until _tzset has been called; these are the same
123// as the initial values in msvcrt/ucrtbase.
124static char initial_tzname0[] = "PST";
125static char initial_tzname1[] = "PDT";
126static char *initial_tznames[] = { initial_tzname0, initial_tzname1 };
127static long initial_timezone = 28800;
128static int initial_daylight = 1;
129char** __MINGW_IMP_SYMBOL(tzname) = initial_tznames;
130long * __MINGW_IMP_SYMBOL(timezone) = &initial_timezone;
131int * __MINGW_IMP_SYMBOL(daylight) = &initial_daylight;
132
133void __cdecl _tzset(void)
134{
135 __MINGW_IMP_SYMBOL(_tzset)();
136 // Redirect the __imp_ pointers to the actual data provided by the UCRT.
137 // From this point, the exposed values should stay in sync.
138 __MINGW_IMP_SYMBOL(tzname) = _tzname;
139 __MINGW_IMP_SYMBOL(timezone) = __timezone();
140 __MINGW_IMP_SYMBOL(daylight) = __daylight();
141}
142
143void __cdecl tzset(void)
144{
145 _tzset();
146}
147
148// This is called for wchar cases with __USE_MINGW_ANSI_STDIO enabled (where the
149// char case just uses fputc).
150int __cdecl __ms_fwprintf(FILE *file, const wchar_t *fmt, ...)
151{
152 va_list ap;
153 int ret;
154 va_start(ap, fmt);
155 ret = __stdio_common_vfwprintf(_CRT_INTERNAL_PRINTF_LEGACY_WIDE_SPECIFIERS, file, fmt, NULL, ap);
156 va_end(ap);
157 return ret;
158}
159
160// Dummy/unused __imp_ wrappers, to make GNU ld not autoexport these symbols.
161int __cdecl (*__MINGW_IMP_SYMBOL(__getmainargs))(int *, char ***, char ***, int, _startupinfo *) = __getmainargs;
162int __cdecl (*__MINGW_IMP_SYMBOL(__wgetmainargs))(int *, wchar_t ***, wchar_t ***, int, _startupinfo *) = __wgetmainargs;
163void __cdecl (*__MINGW_IMP_SYMBOL(_amsg_exit))(int) = _amsg_exit;
164unsigned int __cdecl (*__MINGW_IMP_SYMBOL(_get_output_format))(void) = _get_output_format;
165void __cdecl (*__MINGW_IMP_SYMBOL(tzset))(void) = tzset;
166int __cdecl (*__MINGW_IMP_SYMBOL(__ms_fwprintf))(FILE *, const wchar_t *, ...) = __ms_fwprintf;
167#ifdef __GNUC__
168#pragma GCC diagnostic pop
169#endif
lib/libc/mingw/def-include/crt-aliases.def.in created+585
......@@ -0,0 +1,585 @@
1#include "func.def.in"
2
3#define ADD_UNDERSCORE(symbol) symbol == _ ## symbol
4#define ADD_UNDERSCORE_DATA(symbol) symbol DATA == _ ## symbol
5#define ADD_UNDERSCORE_DATA_DLL(symbol) symbol DATA == _ ## symbol ## _dll
6#define ADD_DOUBLE_UNDERSCORE(symbol) symbol == __ ## symbol
7
8; This is list of symbol aliases from the Visual C++ 1.0 oldnames.lib library
9; FIXME: some of these symbol aliases are commented, check and document why
10#ifdef UCRTBASE
11; access is provided as an alias for __mingw_access
12#else
13ADD_UNDERSCORE(access)
14#endif
15#ifndef CRTAPP
16; ADD_UNDERSCORE(cgets)
17ADD_UNDERSCORE(chdir)
18#endif
19ADD_UNDERSCORE(chmod)
20ADD_UNDERSCORE(chsize)
21ADD_UNDERSCORE(close)
22#ifndef CRTAPP
23; ADD_UNDERSCORE(cprintf)
24; ADD_UNDERSCORE(cputs)
25#endif
26ADD_UNDERSCORE(creat)
27#ifndef CRTAPP
28; ADD_UNDERSCORE(cscanf)
29ADD_UNDERSCORE(cwait)
30#endif
31#if defined(UCRTBASE)
32; daylight variable is provided by misc/ucrt_tzset.c
33#elif defined(CRTDLL)
34ADD_UNDERSCORE_DATA_DLL(daylight)
35#else
36ADD_UNDERSCORE_DATA(daylight)
37#endif
38ADD_UNDERSCORE(dup)
39ADD_UNDERSCORE(dup2)
40ADD_UNDERSCORE(ecvt)
41#if defined(UCRTBASE)
42; _environ variable is not available in ucrtbase.dll and there is no replacement for it
43#elif defined(CRTDLL)
44; ADD_UNDERSCORE_DATA_DLL(environ)
45#else
46; ADD_UNDERSCORE_DATA(environ)
47#endif
48ADD_UNDERSCORE(eof)
49#ifndef CRTAPP
50ADD_UNDERSCORE(execl)
51ADD_UNDERSCORE(execle)
52ADD_UNDERSCORE(execlp)
53ADD_UNDERSCORE(execlpe)
54ADD_UNDERSCORE(execv)
55ADD_UNDERSCORE(execve)
56ADD_UNDERSCORE(execvp)
57ADD_UNDERSCORE(execvpe)
58#endif
59ADD_UNDERSCORE(fcloseall)
60ADD_UNDERSCORE(fcvt)
61ADD_UNDERSCORE(fdopen)
62ADD_UNDERSCORE(fgetchar)
63ADD_UNDERSCORE(filelength)
64ADD_UNDERSCORE(fileno)
65; ADD_UNDERSCORE(flushall)
66ADD_UNDERSCORE(fputchar)
67#ifdef FIXED_SIZE_SYMBOLS
68#ifndef CRTDLL
69ADD_UNDERSCORE(fstat)
70#endif
71#else
72F32(fstat == _fstat32)
73F64(fstat == _fstat64i32)
74#endif
75#ifdef FIXED_SIZE_SYMBOLS
76ADD_UNDERSCORE(ftime)
77#else
78F32(ftime == _ftime32)
79F64(ftime == _ftime64)
80#endif
81#if defined(UCRTBASE)
82; HUGE alias and _HUGE variable are provided by math/_huge.c
83#elif defined(CRTDLL)
84ADD_UNDERSCORE_DATA_DLL(HUGE)
85#else
86ADD_UNDERSCORE_DATA(HUGE)
87#endif
88ADD_UNDERSCORE(gcvt)
89#ifndef CRTAPP
90ADD_UNDERSCORE(getch)
91ADD_UNDERSCORE(getche)
92ADD_UNDERSCORE(getcwd)
93#endif
94#ifdef UCRTBASE
95; ucrtbase.dll has got _getpid for all archs
96ADD_UNDERSCORE(getpid)
97#elif !defined(CRTAPP)
98; msvcrt.dll for arm/arm64 lacks _getpid
99F_X86_ANY(ADD_UNDERSCORE(getpid))
100#endif
101#ifndef CRTAPP
102ADD_UNDERSCORE(getw)
103#endif
104ADD_UNDERSCORE(isatty)
105ADD_UNDERSCORE(itoa)
106#ifndef CRTAPP
107ADD_UNDERSCORE(kbhit)
108#endif
109ADD_UNDERSCORE(lfind)
110; ADD_UNDERSCORE(locking)
111ADD_UNDERSCORE(lsearch)
112ADD_UNDERSCORE(lseek)
113ADD_UNDERSCORE(ltoa)
114ADD_UNDERSCORE(memccpy)
115ADD_UNDERSCORE(memicmp)
116ADD_UNDERSCORE(mkdir)
117ADD_UNDERSCORE(mktemp)
118; onexit function alias is provided by misc/_onexit.c
119ADD_UNDERSCORE(open)
120#ifndef CRTAPP
121ADD_UNDERSCORE(putch)
122ADD_UNDERSCORE(putenv)
123#endif
124ADD_UNDERSCORE(putw)
125ADD_UNDERSCORE(read)
126ADD_UNDERSCORE(rmdir)
127ADD_UNDERSCORE(rmtmp)
128ADD_UNDERSCORE(setmode)
129ADD_UNDERSCORE(sopen)
130#ifndef CRTAPP
131ADD_UNDERSCORE(spawnl)
132ADD_UNDERSCORE(spawnle)
133ADD_UNDERSCORE(spawnlp)
134ADD_UNDERSCORE(spawnlpe)
135ADD_UNDERSCORE(spawnv)
136ADD_UNDERSCORE(spawnve)
137ADD_UNDERSCORE(spawnvp)
138ADD_UNDERSCORE(spawnvpe)
139#endif
140#ifndef CRTDLL
141; stat is provided by mingw to workaround trailing slash issue in _stat
142#endif
143#ifdef NO_STRCMPI_ALIAS
144; Symbol _strcmpi is natively present and defined in the library def file
145; So define strcmpi as an alias to _strcmpi
146ADD_UNDERSCORE(strcmpi)
147#else
148; Symbol _strcmpi is not present in the library, it provides only _stricmp symbol
149; So define strcmpi as an alias to _stricmp
150strcmpi == _stricmp
151#endif
152ADD_UNDERSCORE(strdup)
153ADD_UNDERSCORE(stricmp)
154ADD_UNDERSCORE(strlwr)
155ADD_UNDERSCORE(strnicmp)
156ADD_UNDERSCORE(strnset)
157ADD_UNDERSCORE(strrev)
158ADD_UNDERSCORE(strset)
159ADD_UNDERSCORE(strupr)
160ADD_UNDERSCORE(swab)
161#if defined(UCRTBASE)
162; _sys_errlist variable is not available in ucrtbase.dll and there is no replacement for it
163#else
164// sys_errlist variable is without _dll suffix in crtdll.dll
165; ADD_UNDERSCORE_DATA(sys_errlist)
166#endif
167#if defined(UCRTBASE)
168; _sys_nerr variable is not available in ucrtbase.dll and there is no replacement for it
169#elif defined(CRTDLL)
170; ADD_UNDERSCORE_DATA_DLL(sys_nerr)
171#else
172; ADD_UNDERSCORE_DATA(sys_nerr)
173#endif
174ADD_UNDERSCORE(tell)
175ADD_UNDERSCORE(tempnam)
176#if defined(UCRTBASE)
177; timezone variable is provided by misc/ucrt_tzset.c
178#elif defined(CRTDLL)
179ADD_UNDERSCORE_DATA_DLL(timezone)
180#else
181ADD_UNDERSCORE_DATA(timezone)
182#endif
183#if defined(UCRTBASE)
184; tzname variable is provided by misc/ucrt_tzset.c
185#else
186// tzname variable is without _dll suffix in crtdll.dll
187ADD_UNDERSCORE_DATA(tzname)
188#endif
189#if defined(UCRTBASE)
190; tzset function is provided by misc/ucrt_tzset.c
191#else
192ADD_UNDERSCORE(tzset)
193#endif
194; ADD_UNDERSCORE(ultoa)
195ADD_UNDERSCORE(umask)
196#ifndef CRTAPP
197ADD_UNDERSCORE(ungetch)
198#endif
199ADD_UNDERSCORE(unlink)
200#ifdef FIXED_SIZE_SYMBOLS
201ADD_UNDERSCORE(utime)
202#else
203F32(utime == _utime32)
204F64(utime == _utime64)
205#endif
206ADD_UNDERSCORE(write)
207
208; This is list of symbol aliases added in the Visual C++ 2.0 oldnames.lib library
209; All these symbols with leading underscore are present also in pre-2.0 CRT versions: crtdll.dll and msvcrt10.dll
210; ADD_UNDERSCORE(control87)
211; ADD_UNDERSCORE(fpreset) ; Alias fpreset is set in CRT_fp10.c and CRT_fp8.c
212ADD_UNDERSCORE(wcsdup)
213ADD_UNDERSCORE(wcsicmp)
214ADD_UNDERSCORE(wcsicoll)
215ADD_UNDERSCORE(wcslwr)
216ADD_UNDERSCORE(wcsnicmp)
217ADD_UNDERSCORE(wcsnset)
218ADD_UNDERSCORE(wcsrev)
219ADD_UNDERSCORE(wcsset)
220ADD_UNDERSCORE(wcsupr)
221
222; This is list of symbol aliases added in the Visual C++ 4.0 oldnames.lib library
223; All these symbols with leading underscore are present also in pre-4.0 CRT versions: crtdll.dll, msvcrt10.dll and msvcrt20.dll
224; ADD_UNDERSCORE(cabs)
225ADD_UNDERSCORE(hypot)
226ADD_UNDERSCORE(j0)
227ADD_UNDERSCORE(j1)
228ADD_UNDERSCORE(jn)
229ADD_UNDERSCORE(y0)
230ADD_UNDERSCORE(y1)
231ADD_UNDERSCORE(yn)
232
233; This is list of symbol aliases for C95 functions
234#ifdef USE_WCSTOK_S_FOR_WCSTOK
235wcstok == wcstok_s
236#endif
237
238; This is list of symbol aliases for C99 functions
239; ADD_UNDERSCORE(logb)
240#ifdef WITH_NEXTAFTER_ALIAS
241ADD_UNDERSCORE(nextafter)
242#endif
243
244#if defined(DEF_ARM32) || defined(DEF_ARM64)
245; This is list of symbol aliases for C99 ARM long double functions
246; They are defined as aliases to regular double symbols as on ARM, long double is equal to regular double
247acosl == acos
248asinl == asin
249atan2l == atan2
250atanl == atan
251ceill == ceil
252cosl == cos
253expl == exp
254floorl == floor
255fmodl == fmod
256log10l == log10
257logl == log
258; FIXME: Why is powl alias defined only for UCRT?
259#ifdef UCRTBASE
260powl == pow
261#endif
262sinl == sin
263tanl == tan
264#endif
265
266; This is list of symbol aliases for C11 functions
267#ifdef UCRTBASE
268F32(timespec_get == _timespec32_get)
269F64(timespec_get == _timespec64_get)
270#endif
271
272; This is list of symbol aliases for POSIX functions
273ADD_DOUBLE_UNDERSCORE(isascii)
274ADD_DOUBLE_UNDERSCORE(toascii)
275#ifndef CRTAPP
276ADD_UNDERSCORE(pclose)
277ADD_UNDERSCORE(popen)
278#endif
279; ADD_UNDERSCORE(scalb)
280
281; This is list of symbol aliases for Large File Specification (extension to Single UNIX Specification)
282#ifndef NO_FPOS64_ALIASES
283; fgetpos and fsetpos are already 64-bit
284fgetpos64 == fgetpos
285fsetpos64 == fsetpos
286#endif
287
288; This is list of symbol aliases for GNU functions which are not part of POSIX or ISO C
289strcasecmp == _stricmp
290strncasecmp == _strnicmp
291
292; This is list of various symbol aliases which are needed for compatibility
293; Some symbols in some version of CRT library were added and some other symbols were removed or renamed
294; This list provides some level of backward and forward compatibility
295
296#ifndef NO_STRCMPI_ALIAS
297_strcmpi == _stricmp
298#endif
299
300#ifdef WITH_IOB_FUNC_ALIAS
301__iob_func == __p__iob
302#endif
303
304#ifdef WITH_TZ_ALIASES
305__daylight == __p__daylight
306#ifndef NO_DSTBIAS
307__dstbias == __p__dstbias
308#endif
309__timezone == __p__timezone
310__tzname == __p__tzname
311#endif
312
313#ifdef WITH_ATOLL_ALIAS
314atoll == _atoi64
315_wtoll == _wtoi64
316#endif
317
318#ifdef WITH_ATOLL_L_ALIAS
319_atoll_l == _atoi64_l
320_wtoll_l == _wtoi64_l
321#endif
322
323#ifdef WITH_LLABS_ALIAS
324llabs == _abs64
325imaxabs == _abs64
326#elif defined(WITH_IMAXABS_ALIAS)
327imaxabs == llabs
328#endif
329
330#ifdef WITH_IMAXDIV_ALIAS
331imaxdiv == lldiv
332#endif
333
334#ifdef WITH_STRTO64_ALIAS
335strtoll == _strtoi64
336strtoull == _strtoui64
337strtoimax == _strtoi64
338strtoumax == _strtoui64
339wcstoll == _wcstoi64
340wcstoull == _wcstoui64
341wcstoimax == _wcstoi64
342wcstoumax == _wcstoui64
343#endif
344
345#ifdef WITH_STRTO64_L_ALIAS
346_strtoll_l == _strtoi64_l
347_strtoull_l == _strtoui64_l
348_strtoimax_l == _strtoi64_l
349_strtoumax_l == _strtoui64_l
350_wcstoll_l == _wcstoi64_l
351_wcstoull_l == _wcstoui64_l
352_wcstoimax_l == _wcstoi64_l
353_wcstoumax_l == _wcstoui64_l
354#endif
355
356; This is list of find symbol aliases, every CRT library has either find symbols with SIZE suffix or without them
357#ifdef FIXED_SIZE_SYMBOLS
358F32(_findfirst32 == _findfirst)
359F64(_findfirst64i32 == _findfirst)
360#ifndef NO_I64_FIXED_SIZE
361F32(_findfirst32i64 == _findfirsti64)
362#ifndef NO_FIXED_SIZE_64_ALIAS
363F64(_findfirst64 == _findfirsti64)
364#endif
365#endif
366F32(_findnext32 == _findnext)
367F64(_findnext64i32 == _findnext)
368#ifndef NO_I64_FIXED_SIZE
369F32(_findnext32i64 == _findnexti64)
370#ifndef NO_FIXED_SIZE_64_ALIAS
371F64(_findnext64 == _findnexti64)
372#endif
373#endif
374#ifndef NO_WIDE_FIXED_SIZE
375F32(_wfindfirst32 == _wfindfirst)
376F64(_wfindfirst64i32 == _wfindfirst)
377#ifndef NO_I64_FIXED_SIZE
378F32(_wfindfirst32i64 == _wfindfirsti64)
379#ifndef NO_FIXED_SIZE_64_ALIAS
380F64(_wfindfirst64 == _wfindfirsti64)
381#endif
382#endif
383F32(_wfindnext32 == _wfindnext)
384F64(_wfindnext64i32 == _wfindnext)
385#ifndef NO_I64_FIXED_SIZE
386F32(_wfindnext32i64 == _wfindnexti64)
387#ifndef NO_FIXED_SIZE_64_ALIAS
388F64(_wfindnext64 == _wfindnexti64)
389#endif
390#endif
391#endif
392#else
393F32(_findfirst == _findfirst32)
394F64(_findfirst == _findfirst64i32)
395F32(_findfirsti64 == _findfirst32i64)
396F64(_findfirsti64 == _findfirst64)
397F32(_findnext == _findnext32)
398F64(_findnext == _findnext64i32)
399F32(_findnexti64 == _findnext32i64)
400F64(_findnexti64 == _findnext64)
401F32(_wfindfirst == _wfindfirst32)
402F64(_wfindfirst == _wfindfirst64i32)
403F32(_wfindfirsti64 == _wfindfirst32i64)
404F64(_wfindfirsti64 == _wfindfirst64)
405F32(_wfindnext == _wfindnext32)
406F64(_wfindnext == _wfindnext64i32)
407F32(_wfindnexti64 == _wfindnext32i64)
408F64(_wfindnexti64 == _wfindnext64)
409#endif
410
411; This is list of stat symbol aliases, every CRT library has either stat symbols with SIZE suffix or without them
412#ifdef FIXED_SIZE_SYMBOLS
413#ifndef CRTDLL
414F32(_fstat32 == _fstat)
415#endif
416F64(_fstat64i32 == _fstat)
417#ifndef NO_I64_FIXED_SIZE
418F32(_fstat32i64 == _fstati64)
419#ifndef NO_FIXED_SIZE_64_ALIAS
420F64(_fstat64 == _fstati64)
421#endif
422#endif
423#ifndef CRTDLL
424F32(_stat32 == _stat)
425#endif
426F64(_stat64i32 == _stat)
427#ifndef NO_I64_FIXED_SIZE
428F32(_stat32i64 == _stati64)
429#ifndef NO_FIXED_SIZE_64_ALIAS
430F64(_stat64 == _stati64)
431#endif
432#endif
433#ifndef NO_WIDE_FIXED_SIZE
434F32(_wstat32 == _wstat)
435F64(_wstat64i32 == _wstat)
436#ifndef NO_I64_FIXED_SIZE
437F32(_wstat32i64 == _wstati64)
438#ifndef NO_FIXED_SIZE_64_ALIAS
439F64(_wstat64 == _wstati64)
440#endif
441#endif
442#endif
443#else
444F32(_fstat == _fstat32)
445F64(_fstat == _fstat64i32)
446F32(_fstati64 == _fstat32i64)
447F64(_fstati64 == _fstat64)
448F32(_stat == _stat32)
449F64(_stat == _stat64i32)
450F32(_stati64 == _stat32i64)
451F64(_stati64 == _stat64)
452F32(_wstat == _wstat32)
453F64(_wstat == _wstat64i32)
454F32(_wstati64 == _wstat32i64)
455F64(_wstati64 == _wstat64)
456#endif
457
458; This is list of time symbol aliases, every CRT library except msvcrt.dll has either time symbols with SIZE suffix or without them
459#ifndef NO_TIME_ALIAS
460#ifdef FIXED_SIZE_SYMBOLS
461F32(_ctime32 == ctime)
462F64(_ctime64 == ctime)
463F32(_difftime32 == difftime)
464F64(_difftime64 == difftime)
465F32(_ftime32 == _ftime)
466F64(_ftime64 == _ftime)
467F32(_futime32 == _futime)
468F64(_futime64 == _futime)
469F32(_gmtime32 == gmtime)
470F64(_gmtime64 == gmtime)
471F32(_localtime32 == localtime)
472F64(_localtime64 == localtime)
473; Skip _mkgmtime as it is present only in msvcrt.dll
474F32(_mktime32 == mktime)
475F64(_mktime64 == mktime)
476F32(_time32 == time)
477F64(_time64 == time)
478F32(_utime32 == _utime)
479F64(_utime64 == _utime)
480#ifndef NO_WIDE_FIXED_SIZE
481F32(_wctime32 == _wctime)
482F64(_wctime64 == _wctime)
483F32(_wutime32 == _wutime)
484F64(_wutime64 == _wutime)
485#endif
486#else
487F32(ctime == _ctime32)
488F64(ctime == _ctime64)
489F32(difftime == _difftime32)
490F64(difftime == _difftime64)
491F32(_ftime == _ftime32)
492F64(_ftime == _ftime64)
493F32(_futime == _futime32)
494F64(_futime == _futime64)
495F32(gmtime == _gmtime32)
496F64(gmtime == _gmtime64)
497F32(localtime == _localtime32)
498F64(localtime == _localtime64)
499F32(_mkgmtime == _mkgmtime32)
500F64(_mkgmtime == _mkgmtime64)
501F32(mktime == _mktime32)
502F64(mktime == _mktime64)
503F32(time == _time32)
504F64(time == _time64)
505F32(_utime == _utime32)
506F64(_utime == _utime64)
507F32(_wctime == _wctime32)
508F64(_wctime == _wctime64)
509F32(_wutime == _wutime32)
510F64(_wutime == _wutime64)
511#endif
512#endif
513
514; This is list of symbols which are present in msvcrt but not in UCRT
515#ifdef UCRTBASE
516__lconv_init == __initialize_lconv_for_unsigned_char
517__set_app_type == _set_app_type
518__p__daylight == __daylight
519__p__dstbias == __dstbias
520__p__timezone == __timezone
521__p__tzname == __tzname
522#endif
523
524; This is list of printf/scanf symbol aliases with __ms_ prefix
525#ifndef UCRTBASE
526__ms_fprintf == fprintf
527__ms_fscanf == fscanf
528__ms_fwprintf == fwprintf
529__ms_fwscanf == fwscanf
530__ms_printf == printf
531__ms_scanf == scanf
532__ms_sprintf == sprintf
533__ms_sscanf == sscanf
534#ifdef PRE_C95_SWPRINTF
535__ms_swprintf == swprintf
536#else
537__ms_swprintf == _swprintf
538#endif
539__ms_swscanf == swscanf
540__ms_vfprintf == vfprintf
541__ms_vfwprintf == vfwprintf
542__ms_vprintf == vprintf
543__ms_vsprintf == vsprintf
544#ifdef PRE_C95_SWPRINTF
545__ms_vswprintf == vswprintf
546#else
547__ms_vswprintf == _vswprintf
548#endif
549__ms_vwprintf == vwprintf
550__ms_wprintf == wprintf
551__ms_wscanf == wscanf
552#endif
553
554; This is list of additional symbol aliases not available in any library as neither native symbols nor aliases
555; FIXME: check if these really are needed
556
557; Origin of the symbol wcscmpi is unknown. This symbol is not present in
558; crtdll.dll and neither in any msvcr* version. The only source of wcscmpi is
559; wcstr.h header file from the Microsoft Visual C++ 1.0 (32-bit for NT) and
560; Microsoft Windows NT 3.1 SDK where wcscmpi and _wcscmpi are defined as
561; macros which expand to _wcsicmp. So the raw wcscmpi is not linkable symbol
562; even in the old Visual C++ versions.
563wcscmpi == _wcsicmp
564
565; Origin of these symbols is unknown too.
566ADD_UNDERSCORE(chgsign)
567ADD_UNDERSCORE(fgetwchar)
568ADD_UNDERSCORE(finite)
569ADD_UNDERSCORE(fpclass)
570ADD_UNDERSCORE(fputwchar)
571#ifndef CRTAPP
572ADD_UNDERSCORE(heapwalk)
573#endif
574ADD_DOUBLE_UNDERSCORE(iscsymf)
575ADD_DOUBLE_UNDERSCORE(iscsym)
576#ifndef CRTAPP
577ADD_UNDERSCORE(searchenv)
578#endif
579ADD_UNDERSCORE(stricoll)
580#ifndef UCRTBASE
581ADD_UNDERSCORE(vsnprintf_s)
582#endif
583#ifndef CRTAPP
584ADD_UNDERSCORE(wpopen)
585#endif
lib/libc/mingw/def-include/func.def.in+26
......@@ -1,3 +1,6 @@
1#ifndef FUNC_DEF_IN
2#define FUNC_DEF_IN
3
14// F32 - function available on all 32 bit architectures
25// F64 - function available on all 64 bit architectures
36// F_X86_ANY - function available on i386 and x86_64
......@@ -7,25 +10,35 @@
710// F_ARM64 - function available only on arm64
811// F_ARM_ANY - function available on 32 and 64 bit arm
912// F_NON_I386 - function available on everything but i386
13// F_NON_X64 - function available on everything but x86_64
14// F_NON_ARM64 - function available on everything but arm64
1015#if defined(DEF_X64)
1116#define F64(x) x
1217#define F_X64(x) x
1318#define F_X86_ANY(x) x
1419#define F_NON_I386(x) x
20#define F_NON_ARM64(x) x
1521#elif defined(DEF_I386)
1622#define F32(x) x
1723#define F_I386(x) x
1824#define F_X86_ANY(x) x
25#define F_NON_X64(x) x
26#define F_NON_ARM64(x) x
1927#elif defined(DEF_ARM32)
2028#define F32(x) x
2129#define F_ARM32(x) x
2230#define F_ARM_ANY(x) x
2331#define F_NON_I386(x) x
32#define F_NON_X64(x) x
33#define F_NON_ARM64(x) x
2434#elif defined(DEF_ARM64)
2535#define F64(x) x
2636#define F_ARM64(x) x
2737#define F_ARM_ANY(x) x
2838#define F_NON_I386(x) x
39#define F_NON_X64(x) x
40#else
41#error No DEF_<ARCH> is defined
2942#endif
3043
3144#ifndef F32
......@@ -55,3 +68,16 @@
5568#ifndef F_NON_I386
5669#define F_NON_I386(x)
5770#endif
71#ifndef F_NON_X64
72#define F_NON_X64(x)
73#endif
74#ifndef F_NON_ARM64
75#define F_NON_ARM64(x)
76#endif
77
78#if defined(DEF_I386)
79#define STDCALL_DECORATED_EXPORT(symbol) symbol == _ ## symbol
80#define FASTCALL_DECORATED_EXPORT(symbol) symbol == symbol
81#endif
82
83#endif // FUNC_DEF_IN
lib/libc/mingw/def-include/msvcrt-common.def.in deleted-154
......@@ -1,154 +0,0 @@
1#include "func.def.in"
2
3#define ADD_UNDERSCORE(symbol) symbol == _ ## symbol
4#define ADD_DOUBLE_UNDERSCORE(symbol) symbol == __ ## symbol
5
6ADD_DOUBLE_UNDERSCORE(iscsymf)
7ADD_DOUBLE_UNDERSCORE(iscsym)
8ADD_DOUBLE_UNDERSCORE(isascii)
9ADD_DOUBLE_UNDERSCORE(toascii)
10
11wcscmpi == _wcsicmp
12strcasecmp == _stricmp
13strncasecmp == _strnicmp
14
15#ifdef UCRTBASE
16; access is provided as an alias for __mingw_access
17#else
18ADD_UNDERSCORE(access)
19#endif
20ADD_UNDERSCORE(chdir)
21ADD_UNDERSCORE(chmod)
22ADD_UNDERSCORE(chsize)
23ADD_UNDERSCORE(close)
24ADD_UNDERSCORE(creat)
25ADD_UNDERSCORE(cwait)
26ADD_UNDERSCORE(dup)
27ADD_UNDERSCORE(dup2)
28ADD_UNDERSCORE(ecvt)
29ADD_UNDERSCORE(eof)
30ADD_UNDERSCORE(execl)
31ADD_UNDERSCORE(execle)
32ADD_UNDERSCORE(execlp)
33ADD_UNDERSCORE(execlpe)
34ADD_UNDERSCORE(execv)
35ADD_UNDERSCORE(execve)
36ADD_UNDERSCORE(execvp)
37ADD_UNDERSCORE(execvpe)
38ADD_UNDERSCORE(fcloseall)
39ADD_UNDERSCORE(fcvt)
40ADD_UNDERSCORE(fdopen)
41ADD_UNDERSCORE(fgetchar)
42ADD_UNDERSCORE(fgetwchar)
43ADD_UNDERSCORE(filelength)
44ADD_UNDERSCORE(fileno)
45; Alias fpreset is set in CRT_fp10.c and CRT_fp8.c.
46; ADD_UNDERSCORE(fpreset)
47ADD_UNDERSCORE(fputchar)
48ADD_UNDERSCORE(fputwchar)
49; ADD_UNDERSCORE(fstat)
50; ADD_UNDERSCORE(ftime)
51ADD_UNDERSCORE(gcvt)
52ADD_UNDERSCORE(getch)
53ADD_UNDERSCORE(getche)
54ADD_UNDERSCORE(getcwd)
55#ifdef UCRTBASE
56; ucrtbase.dll has got _getpid for all archs
57ADD_UNDERSCORE(getpid)
58#elif !defined(NO_GETPID_ALIAS)
59; msvcrt.dll for arm/arm64 lacks _getpid
60F_X86_ANY(ADD_UNDERSCORE(getpid))
61#endif
62ADD_UNDERSCORE(getw)
63ADD_UNDERSCORE(heapwalk)
64ADD_UNDERSCORE(isatty)
65ADD_UNDERSCORE(itoa)
66ADD_UNDERSCORE(kbhit)
67ADD_UNDERSCORE(lfind)
68ADD_UNDERSCORE(lsearch)
69ADD_UNDERSCORE(lseek)
70ADD_UNDERSCORE(ltoa)
71ADD_UNDERSCORE(memccpy)
72ADD_UNDERSCORE(memicmp)
73ADD_UNDERSCORE(mkdir)
74ADD_UNDERSCORE(mktemp)
75ADD_UNDERSCORE(open)
76ADD_UNDERSCORE(pclose)
77ADD_UNDERSCORE(popen)
78ADD_UNDERSCORE(putch)
79ADD_UNDERSCORE(putenv)
80ADD_UNDERSCORE(putw)
81ADD_UNDERSCORE(read)
82ADD_UNDERSCORE(rmdir)
83ADD_UNDERSCORE(rmtmp)
84ADD_UNDERSCORE(searchenv)
85ADD_UNDERSCORE(setmode)
86ADD_UNDERSCORE(sopen)
87ADD_UNDERSCORE(spawnl)
88ADD_UNDERSCORE(spawnle)
89ADD_UNDERSCORE(spawnlp)
90ADD_UNDERSCORE(spawnlpe)
91ADD_UNDERSCORE(spawnv)
92ADD_UNDERSCORE(spawnve)
93ADD_UNDERSCORE(spawnvp)
94ADD_UNDERSCORE(spawnvpe)
95; ADD_UNDERSCORE(stat)
96#ifndef UCRTBASE
97ADD_UNDERSCORE(strcmpi)
98#endif
99ADD_UNDERSCORE(strdup)
100ADD_UNDERSCORE(stricmp)
101ADD_UNDERSCORE(stricoll)
102ADD_UNDERSCORE(strlwr)
103ADD_UNDERSCORE(strnicmp)
104ADD_UNDERSCORE(strnset)
105ADD_UNDERSCORE(strrev)
106ADD_UNDERSCORE(strset)
107ADD_UNDERSCORE(strupr)
108ADD_UNDERSCORE(swab)
109ADD_UNDERSCORE(tell)
110ADD_UNDERSCORE(tempnam)
111#ifndef UCRTBASE
112ADD_UNDERSCORE(tzset)
113#endif
114ADD_UNDERSCORE(umask)
115ADD_UNDERSCORE(ungetch)
116ADD_UNDERSCORE(unlink)
117#ifndef UCRTBASE
118ADD_UNDERSCORE(utime)
119#endif
120ADD_UNDERSCORE(wcsdup)
121ADD_UNDERSCORE(wcsicmp)
122ADD_UNDERSCORE(wcsicoll)
123ADD_UNDERSCORE(wcslwr)
124ADD_UNDERSCORE(wcsnicmp)
125ADD_UNDERSCORE(wcsnset)
126ADD_UNDERSCORE(wcsrev)
127ADD_UNDERSCORE(wcsset)
128ADD_UNDERSCORE(wcsupr)
129ADD_UNDERSCORE(wpopen)
130ADD_UNDERSCORE(write)
131; non-ANSI functions declared in math.h
132ADD_UNDERSCORE(j0)
133ADD_UNDERSCORE(j1)
134ADD_UNDERSCORE(jn)
135ADD_UNDERSCORE(y0)
136ADD_UNDERSCORE(y1)
137ADD_UNDERSCORE(yn)
138ADD_UNDERSCORE(chgsign)
139; ADD_UNDERSCORE(scalb)
140ADD_UNDERSCORE(finite)
141ADD_UNDERSCORE(fpclass)
142; C99 functions
143; ADD_UNDERSCORE(cabs)
144ADD_UNDERSCORE(hypot)
145; ADD_UNDERSCORE(logb)
146ADD_UNDERSCORE(nextafter)
147
148#ifndef UCRTBASE
149daylight DATA == _daylight
150timezone DATA == _timezone
151tzname DATA == _tzname
152
153ADD_UNDERSCORE(vsnprintf_s)
154#endif
lib/libc/mingw/include/internal.h+14-10
......@@ -59,7 +59,7 @@ extern "C" {
5959#define _tm_unicode_safe(i) (_pioinfo_safe(i)->unicode)
6060
6161#ifndef __badioinfo
62 extern ioinfo ** __MINGW_IMP_SYMBOL(__badioinfo)[];
62 extern ioinfo * __MINGW_IMP_SYMBOL(__badioinfo);
6363#define __badioinfo (* __MINGW_IMP_SYMBOL(__badioinfo))
6464#endif
6565
......@@ -96,17 +96,13 @@ extern "C" {
9696 extern int _dowildcard;
9797 extern int _newmode;
9898
99#ifndef __winitenv
100extern wchar_t *** __MINGW_IMP_SYMBOL(__winitenv);
101#define __winitenv (* __MINGW_IMP_SYMBOL(__winitenv))
102#endif
99 _CRTIMP wchar_t *** __cdecl __p___winitenv(void);
100#define __winitenv (*__p___winitenv())
103101
104#if !defined(__initenv)
105extern char *** __MINGW_IMP_SYMBOL(__initenv);
106#define __initenv (* __MINGW_IMP_SYMBOL(__initenv))
107#endif
102 _CRTIMP char *** __cdecl __p___initenv(void);
103#define __initenv (*__p___initenv())
108104
109 _CRTIMP void __cdecl _amsg_exit(int);
105 _CRTIMP void __cdecl _amsg_exit(int) __MINGW_ATTRIB_NORETURN;
110106
111107 int __CRTDECL _setargv(void);
112108 int __CRTDECL __setargv(void);
......@@ -150,6 +146,14 @@ extern char *** __MINGW_IMP_SYMBOL(__initenv);
150146 PIMAGE_SECTION_HEADER __cdecl _FindPESection (PBYTE pImageBase, DWORD_PTR rva);
151147 BOOL __cdecl _IsNonwritableInCurrentImage (PBYTE pTarget);
152148
149#if defined(__SSE__)
150# define __mingw_has_sse() 1
151#elif defined(__i386__)
152 int __mingw_has_sse(void);
153#else
154# define __mingw_has_sse() 0
155#endif
156
153157#ifdef __cplusplus
154158}
155159#endif
lib/libc/mingw/lib-common/api-ms-win-crt-convert-l1-1-0.def.in+4-6
......@@ -47,7 +47,7 @@ _strtoi64
4747_strtoi64_l
4848_strtoimax_l
4949_strtol_l
50_strtold_l
50F_ARM_ANY(_strtold_l) ; Can't use long double functions from the CRT on x86
5151_strtoll_l
5252_strtoui64
5353_strtoui64_l
......@@ -68,7 +68,7 @@ _wcstoi64
6868_wcstoi64_l
6969_wcstoimax_l
7070_wcstol_l
71_wcstold_l
71F_ARM_ANY(_wcstold_l) ; Can't use long double functions from the CRT on x86
7272_wcstoll_l
7373_wcstombs_l
7474_wcstombs_s_l
......@@ -108,8 +108,7 @@ strtod
108108strtof
109109strtoimax
110110strtol
111; Can't use long double functions from the CRT on x86
112F_ARM_ANY(strtold)
111F_ARM_ANY(strtold) ; Can't use long double functions from the CRT on x86
113112strtoll
114113strtoul
115114strtoull
......@@ -122,8 +121,7 @@ wcstod
122121wcstof
123122wcstoimax
124123wcstol
125; Can't use long double functions from the CRT on x86
126F_ARM_ANY(wcstold)
124F_ARM_ANY(wcstold) ; Can't use long double functions from the CRT on x86
127125wcstoll
128126wcstombs
129127wcstombs_s
lib/libc/mingw/lib-common/api-ms-win-crt-filesystem-l1-1-0.def deleted-79
......@@ -1,79 +0,0 @@
1LIBRARY api-ms-win-crt-filesystem-l1-1-0
2
3EXPORTS
4
5_access
6; access is provided as an alias for __mingw_access
7; access == _access
8_access_s
9_chdir
10chdir == _chdir
11_chdrive
12_chmod
13chmod == _chmod
14_findclose
15_findfirst == _findfirst64
16_findfirst32
17_findfirst32i64
18_findfirst64
19_findfirst64i32
20_findnext == _findnext64
21_findnext32
22_findnext32i64
23_findnext64
24_findnext64i32
25_fstat32
26_fstat32i64
27_fstat64
28_fstat64i32
29_fullpath
30_getdiskfree
31_getdrive
32_getdrives
33_lock_file
34_makepath
35_makepath_s
36_mkdir
37mkdir == _mkdir
38_rmdir
39rmdir == _rmdir
40_splitpath
41_splitpath_s
42_stat32
43_stat32i64
44_stat64
45_stat64i32
46_umask
47umask == _umask
48_umask_s
49_unlink
50unlink == _unlink
51_unlock_file
52_waccess
53_waccess_s
54_wchdir
55_wchmod
56_wfindfirst32
57_wfindfirst32i64
58_wfindfirst64
59_wfindfirst64i32
60_wfindnext32
61_wfindnext32i64
62_wfindnext64
63_wfindnext64i32
64_wfullpath
65_wmakepath
66_wmakepath_s
67_wmkdir
68_wremove
69_wrename
70_wrmdir
71_wsplitpath
72_wsplitpath_s
73_wstat32
74_wstat32i64
75_wstat64
76_wstat64i32
77_wunlink
78remove
79rename
lib/libc/mingw/lib-common/api-ms-win-crt-filesystem-l1-1-0.def.in created+109
......@@ -0,0 +1,109 @@
1LIBRARY api-ms-win-crt-filesystem-l1-1-0
2
3EXPORTS
4
5#include "func.def.in"
6
7_access
8; access is provided as an alias for __mingw_access
9; access == _access
10_access_s
11_chdir
12chdir == _chdir
13_chdrive
14_chmod
15chmod == _chmod
16_findclose
17F32(_findfirst == _findfirst32)
18F64(_findfirst == _findfirst64i32)
19F32(_findfirsti64 == _findfirst32i64)
20F64(_findfirsti64 == _findfirst64)
21_findfirst32
22_findfirst32i64
23_findfirst64
24_findfirst64i32
25F32(_findnext == _findnext32)
26F64(_findnext == _findnext64i32)
27F32(_findnexti64 == _findnext32i64)
28F64(_findnexti64 == _findnext64)
29_findnext32
30_findnext32i64
31_findnext64
32_findnext64i32
33F32(fstat == _fstat32)
34F64(fstat == _fstat64i32)
35F32(_fstat == _fstat32)
36F64(_fstat == _fstat64i32)
37F32(_fstati64 == _fstat32i64)
38F64(_fstati64 == _fstat64)
39_fstat32
40_fstat32i64
41_fstat64
42_fstat64i32
43_fullpath
44_getdiskfree
45_getdrive
46_getdrives
47_lock_file
48_makepath
49_makepath_s
50_mkdir
51mkdir == _mkdir
52_rmdir
53rmdir == _rmdir
54_splitpath
55_splitpath_s
56F32(_stat == _stat32)
57F64(_stat == _stat64i32)
58F32(_stati64 == _stat32i64)
59F64(_stati64 == _stat64)
60_stat32
61_stat32i64
62_stat64
63_stat64i32
64_umask
65umask == _umask
66_umask_s
67_unlink
68unlink == _unlink
69_unlock_file
70_waccess
71_waccess_s
72_wchdir
73_wchmod
74F32(_wfindfirst == _wfindfirst32)
75F64(_wfindfirst == _wfindfirst64i32)
76F32(_wfindfirsti64 == _wfindfirst32i64)
77F64(_wfindfirsti64 == _wfindfirst64)
78_wfindfirst32
79_wfindfirst32i64
80_wfindfirst64
81_wfindfirst64i32
82F32(_wfindnext == _wfindnext32)
83F64(_wfindnext == _wfindnext64i32)
84F32(_wfindnexti64 == _wfindnext32i64)
85F64(_wfindnexti64 == _wfindnext64)
86_wfindnext32
87_wfindnext32i64
88_wfindnext64
89_wfindnext64i32
90_wfullpath
91_wmakepath
92_wmakepath_s
93_wmkdir
94_wremove
95_wrename
96_wrmdir
97_wsplitpath
98_wsplitpath_s
99F32(_wstat == _wstat32)
100F64(_wstat == _wstat64i32)
101F32(_wstati64 == _wstat32i64)
102F64(_wstati64 == _wstat64)
103_wstat32
104_wstat32i64
105_wstat64
106_wstat64i32
107_wunlink
108remove
109rename
lib/libc/mingw/lib-common/api-ms-win-crt-math-l1-1-0.def.in+61-61
......@@ -150,13 +150,13 @@ F_NON_I386(acosf)
150150F_ARM_ANY(acosl == acos)
151151acosh
152152acoshf
153acoshl F_X86_ANY(DATA)
153F_ARM_ANY(acoshl) ; Can't use long double functions from the CRT on x86
154154asin
155155F_NON_I386(asinf)
156156F_ARM_ANY(asinl == asin)
157157asinh
158158asinhf
159asinhl F_X86_ANY(DATA)
159F_ARM_ANY(asinhl) ; Can't use long double functions from the CRT on x86
160160atan
161161atan2
162162F_NON_I386(atan2f)
......@@ -165,61 +165,61 @@ F_NON_I386(atanf)
165165F_ARM_ANY(atanl == atan)
166166atanh
167167atanhf
168atanhl F_X86_ANY(DATA)
168F_ARM_ANY(atanhl) ; Can't use long double functions from the CRT on x86
169169cabs
170170cabsf
171cabsl
171F_ARM_ANY(cabsl) ; Can't use long double functions from the CRT on x86
172172cacos
173173cacosf
174174cacosh
175175cacoshf
176cacoshl
177cacosl
176F_ARM_ANY(cacoshl) ; Can't use long double functions from the CRT on x86
177F_ARM_ANY(cacosl) ; Can't use long double functions from the CRT on x86
178178carg
179179cargf
180cargl
180F_ARM_ANY(cargl) ; Can't use long double functions from the CRT on x86
181181casin
182182casinf
183183casinh
184184casinhf
185casinhl
186casinl
185F_ARM_ANY(casinhl) ; Can't use long double functions from the CRT on x86
186F_ARM_ANY(casinl) ; Can't use long double functions from the CRT on x86
187187catan
188188catanf
189189catanh
190190catanhf
191catanhl
192catanl
191F_ARM_ANY(catanhl) ; Can't use long double functions from the CRT on x86
192F_ARM_ANY(catanl) ; Can't use long double functions from the CRT on x86
193193cbrt
194194cbrtf
195cbrtl F_X86_ANY(DATA)
195F_ARM_ANY(cbrtl) ; Can't use long double functions from the CRT on x86
196196ccos
197197ccosf
198198ccosh
199199ccoshf
200ccoshl
201ccosl
200F_ARM_ANY(ccoshl) ; Can't use long double functions from the CRT on x86
201F_ARM_ANY(ccosl) ; Can't use long double functions from the CRT on x86
202202ceil
203203F_NON_I386(ceilf)
204204F_ARM_ANY(ceill == ceil)
205205cexp
206206cexpf
207cexpl
207F_ARM_ANY(cexpl) ; Can't use long double functions from the CRT on x86
208208cimag
209209cimagf
210cimagl
210F_ARM_ANY(cimagl) ; Can't use long double functions from the CRT on x86
211211clog
212212clog10
213213clog10f
214clog10l
214F_ARM_ANY(clog10l) ; Can't use long double functions from the CRT on x86
215215clogf
216clogl
216F_ARM_ANY(clogl) ; Can't use long double functions from the CRT on x86
217217conj
218218conjf
219conjl
219F_ARM_ANY(conjl) ; Can't use long double functions from the CRT on x86
220220copysign
221221copysignf
222copysignl F_X86_ANY(DATA)
222F_ARM_ANY(copysignl) ; Can't use long double functions from the CRT on x86
223223cos
224224F_NON_I386(cosf)
225225F_ARM_ANY(cosl == cos)
......@@ -227,60 +227,60 @@ cosh
227227F_NON_I386(coshf)
228228cpow
229229cpowf
230cpowl
230F_ARM_ANY(cpowl) ; Can't use long double functions from the CRT on x86
231231cproj
232232cprojf
233cprojl
233F_ARM_ANY(cprojl) ; Can't use long double functions from the CRT on x86
234234creal
235235crealf
236creall
236F_ARM_ANY(creall) ; Can't use long double functions from the CRT on x86
237237csin
238238csinf
239239csinh
240240csinhf
241csinhl
242csinl
241F_ARM_ANY(csinhl) ; Can't use long double functions from the CRT on x86
242F_ARM_ANY(csinl) ; Can't use long double functions from the CRT on x86
243243csqrt
244244csqrtf
245csqrtl
245F_ARM_ANY(csqrtl) ; Can't use long double functions from the CRT on x86
246246ctan
247247ctanf
248248ctanh
249249ctanhf
250ctanhl
251ctanl
250F_ARM_ANY(ctanhl) ; Can't use long double functions from the CRT on x86
251F_ARM_ANY(ctanl) ; Can't use long double functions from the CRT on x86
252252erf
253253erfc
254254erfcf
255erfcl F_X86_ANY(DATA)
255F_ARM_ANY(erfcl) ; Can't use long double functions from the CRT on x86
256256erff
257erfl F_X86_ANY(DATA)
257F_ARM_ANY(erfl) ; Can't use long double functions from the CRT on x86
258258exp
259259exp2
260260exp2f
261exp2l F_X86_ANY(DATA)
261F_ARM_ANY(exp2l) ; Can't use long double functions from the CRT on x86
262262F_NON_I386(expf)
263263F_ARM_ANY(expl == exp)
264264expm1
265265expm1f
266expm1l F_X86_ANY(DATA)
266F_ARM_ANY(expm1l) ; Can't use long double functions from the CRT on x86
267267fabs
268268F_ARM_ANY(fabsf)
269269fdim
270270fdimf
271fdiml F_X86_ANY(DATA)
271F_ARM_ANY(fdiml) ; Can't use long double functions from the CRT on x86
272272floor
273273F_NON_I386(floorf)
274274F_ARM_ANY(floorl == floor)
275275fma
276276fmaf
277fmal F_X86_ANY(DATA)
277F_ARM_ANY(fmal) ; Can't use long double functions from the CRT on x86
278278fmax
279279fmaxf
280fmaxl F_X86_ANY(DATA)
280F_ARM_ANY(fmaxl) ; Can't use long double functions from the CRT on x86
281281fmin
282282fminf
283fminl F_X86_ANY(DATA)
283F_ARM_ANY(fminl) ; Can't use long double functions from the CRT on x86
284284fmod
285285F_NON_I386(fmodf)
286286F_ARM_ANY(fmodl == fmod)
......@@ -288,80 +288,80 @@ frexp
288288hypot
289289ilogb
290290ilogbf
291ilogbl F_X86_ANY(DATA)
291F_ARM_ANY(ilogbl) ; Can't use long double functions from the CRT on x86
292292ldexp
293293; The UCRT lgamma functions don't set/provide the signgam variable like
294294; the mingw ones do. Therefore prefer the libmingwex version instead.
295295lgamma DATA
296296lgammaf DATA
297lgammal DATA
297F_ARM_ANY(lgammal DATA) ; Can't use long double functions from the CRT on x86
298298llrint
299299llrintf
300llrintl F_X86_ANY(DATA)
300F_ARM_ANY(llrintl) ; Can't use long double functions from the CRT on x86
301301llround
302302llroundf
303llroundl F_X86_ANY(DATA)
303F_ARM_ANY(llroundl) ; Can't use long double functions from the CRT on x86
304304log
305305log10
306306F_NON_I386(log10f)
307307F_ARM_ANY(log10l == log10)
308308log1p
309309log1pf
310log1pl F_X86_ANY(DATA)
310F_ARM_ANY(log1pl) ; Can't use long double functions from the CRT on x86
311311log2
312312log2f
313log2l F_X86_ANY(DATA)
313F_ARM_ANY(log2l) ; Can't use long double functions from the CRT on x86
314314logb
315315logbf
316logbl F_X86_ANY(DATA)
316F_ARM_ANY(logbl) ; Can't use long double functions from the CRT on x86
317317F_NON_I386(logf)
318318F_ARM_ANY(logl == log)
319319lrint
320320lrintf
321lrintl F_X86_ANY(DATA)
321F_ARM_ANY(lrintl) ; Can't use long double functions from the CRT on x86
322322lround
323323lroundf
324lroundl F_X86_ANY(DATA)
324F_ARM_ANY(lroundl) ; Can't use long double functions from the CRT on x86
325325modf
326326F_NON_I386(modff)
327327nan
328328nanf
329nanl F_X86_ANY(DATA)
329F_ARM_ANY(nanl) ; Can't use long double functions from the CRT on x86
330330nearbyint
331331nearbyintf
332nearbyintl F_X86_ANY(DATA)
332F_ARM_ANY(nearbyintl) ; Can't use long double functions from the CRT on x86
333333nextafter
334334nextafterf
335nextafterl F_X86_ANY(DATA)
336; All of the nexttoward functions take the second parameter as long doubke,
335F_ARM_ANY(nextafterl) ; Can't use long double functions from the CRT on x86
336; All of the nexttoward functions take the second parameter as long double,
337337; making them unusable for x86.
338nexttoward F_X86_ANY(DATA)
339nexttowardf F_X86_ANY(DATA)
340nexttowardl F_X86_ANY(DATA)
338F_ARM_ANY(nexttoward) ; Can't use long double functions from the CRT on x86
339F_ARM_ANY(nexttowardf) ; Can't use long double functions from the CRT on x86
340F_ARM_ANY(nexttowardl) ; Can't use long double functions from the CRT on x86
341341norm
342342normf
343343norml
344344pow
345F_NON_I386(powf)
345F_NON_I386(powf) ; Missing in Wine's ucrtbase.dll for i386 in Wine 9.15 and older
346346F_ARM_ANY(powl == pow)
347347remainder
348348remainderf
349remainderl F_X86_ANY(DATA)
349F_ARM_ANY(remainderl) ; Can't use long double functions from the CRT on x86
350350remquo
351351remquof
352remquol F_X86_ANY(DATA)
352F_ARM_ANY(remquol) ; Can't use long double functions from the CRT on x86
353353rint
354354rintf
355rintl F_X86_ANY(DATA)
355F_ARM_ANY(rintl) ; Can't use long double functions from the CRT on x86
356356round
357357roundf
358roundl F_X86_ANY(DATA)
358F_ARM_ANY(roundl) ; Can't use long double functions from the CRT on x86
359359scalbln
360360scalblnf
361scalblnl F_X86_ANY(DATA)
361F_ARM_ANY(scalblnl) ; Can't use long double functions from the CRT on x86
362362scalbn
363363scalbnf
364scalbnl F_X86_ANY(DATA)
364F_ARM_ANY(scalbnl) ; Can't use long double functions from the CRT on x86
365365sin
366366F_NON_I386(sinf)
367367F_ARM_ANY(sinl == sin)
......@@ -378,7 +378,7 @@ tanh
378378F_NON_I386(tanhf)
379379tgamma
380380tgammaf
381tgammal F_X86_ANY(DATA)
381F_ARM_ANY(tgammal) ; Can't use long double functions from the CRT on x86
382382trunc
383383truncf
384truncl F_X86_ANY(DATA)
384F_ARM_ANY(truncl) ; Can't use long double functions from the CRT on x86
lib/libc/mingw/lib-common/api-ms-win-crt-private-l1-1-0.def.in+1-1
......@@ -43,7 +43,7 @@ __TypeMatch
4343__current_exception
4444__current_exception_context
4545__dcrt_get_wide_environment_from_os
46__dcrt_initial_narrow_environment
46__dcrt_initial_narrow_environment DATA
4747__intrinsic_abnormal_termination
4848__intrinsic_setjmp
4949F64(__intrinsic_setjmpex)
lib/libc/mingw/lib-common/api-ms-win-crt-stdio-l1-1-0.def+2
......@@ -155,6 +155,7 @@ ferror
155155fflush
156156fgetc
157157fgetpos
158fgetpos64 == fgetpos
158159fgets
159160fgetwc
160161fgetws
......@@ -170,6 +171,7 @@ freopen
170171freopen_s
171172fseek
172173fsetpos
174fsetpos64 == fsetpos
173175ftell
174176fwrite
175177getc
lib/libc/mingw/lib-common/api-ms-win-crt-string-l1-1-0.def+3-4
......@@ -128,7 +128,7 @@ _wcsupr_l
128128_wcsupr_s
129129_wcsupr_s_l
130130_wcsxfrm_l
131_wctype
131_wctype DATA
132132is_wctype
133133isalnum
134134isalpha
......@@ -175,7 +175,7 @@ strncat_s
175175strncmp
176176strncpy
177177strncpy_s
178; strnlen replaced by emu
178strnlen
179179strpbrk
180180strspn
181181strtok
......@@ -199,8 +199,7 @@ wcsncat_s
199199wcsncmp
200200wcsncpy
201201wcsncpy_s
202; We provide replacement implementation in libmingwex
203wcsnlen DATA
202wcsnlen
204203wcspbrk
205204wcsspn
206205wcstok
lib/libc/mingw/lib-common/api-ms-win-crt-time-l1-1-0.def deleted-89
......@@ -1,89 +0,0 @@
1LIBRARY api-ms-win-crt-time-l1-1-0
2
3EXPORTS
4
5__daylight
6__dstbias
7__timezone
8__tzname
9_ctime32
10_ctime32_s
11_ctime64
12_ctime64_s
13_difftime32
14_difftime64
15_ftime == _ftime64
16_ftime32
17_ftime32_s
18_ftime64
19_ftime64_s
20_futime == _futime64
21_futime32
22_futime64
23_get_daylight
24_get_dstbias
25_get_timezone
26_get_tzname
27_getsystime
28_Getdays
29_Getmonths
30_Gettnames
31_gmtime32
32_gmtime32_s
33_gmtime64
34_gmtime64_s
35_localtime32
36_localtime32_s
37_localtime64
38_localtime64_s
39_mkgmtime32
40_mkgmtime64
41_mktime32
42_mktime64
43_setsystime
44_strdate
45_strdate_s
46_Strftime
47_strftime_l
48_strtime
49_strtime_s
50_time32
51_time64
52_timespec32_get
53_timespec64_get
54; This is wrapped in the compat code.
55_tzset DATA
56_utime == _utime64
57utime == _utime64
58_utime32
59_utime64
60_W_Getdays
61_W_Getmonths
62_W_Gettnames
63_wasctime
64_wasctime_s
65_Wcsftime
66_wcsftime_l
67_wctime32
68_wctime32_s
69_wctime64
70_wctime64_s
71_wstrdate
72_wstrdate_s
73_wstrtime
74_wstrtime_s
75_wutime == _wutime64
76_wutime32
77_wutime64
78asctime
79asctime_s
80clock
81strftime
82wcsftime
83; These functions may satisfy configure scripts.
84ctime == _ctime64
85gmtime == _gmtime64
86localtime == _localtime64
87mktime == _mktime64
88time == _time64
89timespec_get == _timespec64_get
lib/libc/mingw/lib-common/api-ms-win-crt-time-l1-1-0.def.in created+108
......@@ -0,0 +1,108 @@
1LIBRARY api-ms-win-crt-time-l1-1-0
2
3EXPORTS
4
5#include "func.def.in"
6
7__daylight
8__dstbias
9__timezone
10__tzname
11_ctime32
12_ctime32_s
13_ctime64
14_ctime64_s
15F32(difftime == _difftime32)
16F64(difftime == _difftime64)
17_difftime32
18_difftime64
19F32(_ftime == _ftime32)
20F64(_ftime == _ftime64)
21_ftime32
22_ftime32_s
23_ftime64
24_ftime64_s
25F32(_futime == _futime32)
26F64(_futime == _futime64)
27_futime32
28_futime64
29_get_daylight
30_get_dstbias
31_get_timezone
32_get_tzname
33_getsystime
34_Getdays
35_Getmonths
36_Gettnames
37_gmtime32
38_gmtime32_s
39_gmtime64
40_gmtime64_s
41_localtime32
42_localtime32_s
43_localtime64
44_localtime64_s
45F32(_mkgmtime == _mkgmtime32)
46F64(_mkgmtime == _mkgmtime64)
47_mkgmtime32
48_mkgmtime64
49_mktime32
50_mktime64
51_setsystime
52_strdate
53_strdate_s
54_Strftime
55_strftime_l
56_strtime
57_strtime_s
58_time32
59_time64
60_timespec32_get
61_timespec64_get
62; This is wrapped in the compat code.
63_tzset DATA
64F32(_utime == _utime32)
65F64(_utime == _utime64)
66F32(utime == _utime32)
67F64(utime == _utime64)
68_utime32
69_utime64
70_W_Getdays
71_W_Getmonths
72_W_Gettnames
73_wasctime
74_wasctime_s
75_Wcsftime
76_wcsftime_l
77F32(_wctime == _wctime32)
78F64(_wctime == _wctime64)
79_wctime32
80_wctime32_s
81_wctime64
82_wctime64_s
83_wstrdate
84_wstrdate_s
85_wstrtime
86_wstrtime_s
87F32(_wutime == _wutime32)
88F64(_wutime == _wutime64)
89_wutime32
90_wutime64
91asctime
92asctime_s
93clock
94strftime
95wcsftime
96; These functions may satisfy configure scripts.
97F32(ctime == _ctime32)
98F64(ctime == _ctime64)
99F32(gmtime == _gmtime32)
100F64(gmtime == _gmtime64)
101F32(localtime == _localtime32)
102F64(localtime == _localtime64)
103F32(mktime == _mktime32)
104F64(mktime == _mktime64)
105F32(time == _time32)
106F64(time == _time64)
107F32(timespec_get == _timespec32_get)
108F64(timespec_get == _timespec64_get)
lib/libc/mingw/lib-common/bcryptprimitives.def created+18
......@@ -0,0 +1,18 @@
1;
2; Definition file of bcryptPrimitives.dll
3; Automatic generated by gendef 1.1
4; written by Kai Tietz 2008
5; The def file has to be processed by --kill-at (-k) option of dlltool or ld
6;
7LIBRARY "bcryptPrimitives.dll"
8EXPORTS
9GetAsymmetricEncryptionInterface
10GetCipherInterface
11GetHashInterface
12GetKeyDerivationInterface
13GetRngInterface
14GetSecretAgreementInterface
15GetSignatureInterface
16MSCryptConvertRsaPrivateBlobToFullRsaBlob
17ProcessPrng
18ProcessPrngGuid
lib/libc/mingw/lib-common/cfgmgr32.def+5-2
......@@ -7,12 +7,12 @@ LIBRARY "CFGMGR32.dll"
77EXPORTS
88CMP_GetBlockedDriverInfo
99CMP_GetServerSideDeviceInstallFlags
10CMP_Get_Device_ID_List
11CMP_Get_Device_ID_List_Size
1012CMP_Init_Detection
11CMP_RegisterNotification
1213CMP_RegisterServiceNotification
1314CMP_Register_Notification
1415CMP_Report_LogOn
15CMP_UnregisterNotification
1616CMP_WaitNoPendingInstallEvents
1717CMP_WaitServicesAvailable
1818CM_Add_Driver_PackageW
......@@ -61,6 +61,7 @@ CM_Enumerate_EnumeratorsA
6161CM_Enumerate_EnumeratorsW
6262CM_Enumerate_Enumerators_ExA
6363CM_Enumerate_Enumerators_ExW
64CM_Export_Pnp_StateW
6465CM_Find_Range
6566CM_First_Range
6667CM_Free_Log_Conf
......@@ -167,6 +168,7 @@ CM_Get_Version_Ex
167168CM_Import_PowerScheme
168169CM_Install_DevNodeW
169170CM_Install_DevNode_ExW
171CM_Install_DriverW
170172CM_Intersect_Range_List
171173CM_Invert_Range_List
172174CM_Is_Dock_Station_Present
......@@ -253,6 +255,7 @@ CM_Setup_DevNode_Ex
253255CM_Test_Range_Available
254256CM_Uninstall_DevNode
255257CM_Uninstall_DevNode_Ex
258CM_Uninstall_DriverW
256259CM_Unregister_Device_InterfaceA
257260CM_Unregister_Device_InterfaceW
258261CM_Unregister_Device_Interface_ExA
lib/libc/mingw/lib-common/computecore.def+7
......@@ -9,6 +9,7 @@ HcsEnumerateVmWorkerProcesses
99HcsFindVmWorkerProcesses
1010HcsGetWorkerProcessJob
1111HcsStartVmWorkerProcess
12HcsAbortSystemPreservation
1213HcsAddResourceToOperation
1314HcsCancelOperation
1415HcsCloseComputeSystem
......@@ -24,6 +25,8 @@ HcsCreateOperationWithNotifications
2425HcsCreateProcess
2526HcsEnumerateComputeSystems
2627HcsEnumerateComputeSystemsInNamespace
28HcsFinalizeLiveMigration
29HcsFinalizeSystemPreservation
2730HcsGetComputeSystemFromOperation
2831HcsGetComputeSystemProperties
2932HcsGetOperationContext
......@@ -39,6 +42,7 @@ HcsGetProcessorCompatibilityFromSavedState
3942HcsGetServiceProperties
4043HcsGrantVmAccess
4144HcsGrantVmGroupAccess
45HcsInitializeLiveMigrationOnSource
4246HcsModifyComputeSystem
4347HcsModifyProcess
4448HcsModifyServiceSettings
......@@ -57,6 +61,9 @@ HcsSetProcessCallback
5761HcsShutDownComputeSystem
5862HcsSignalProcess
5963HcsStartComputeSystem
64HcsStartLiveMigrationOnSource
65HcsStartLiveMigrationTransfer
66HcsStartSystemPreservation
6067HcsSubmitWerReport
6168HcsSystemControl
6269HcsTerminateComputeSystem
lib/libc/mingw/lib-common/computenetwork.def+1
......@@ -18,6 +18,7 @@ HcnModifySdnRoute
1818HcnOpenGuestNetworkService
1919HcnOpenSdnRoute
2020HcnQueryGuestNetworkServiceProperties
21HcnQueryMetrics
2122HcnQuerySdnRouteProperties
2223HcnRegisterGuestNetworkServiceCallback
2324HcnRegisterNetworkCallback
lib/libc/mingw/lib-common/computestorage.def+2
......@@ -6,8 +6,10 @@
66LIBRARY "computestorage.dll"
77EXPORTS
88HcsAttachLayerStorageFilter
9HcsAttachOverlayFilter
910HcsDestroyLayer
1011HcsDetachLayerStorageFilter
12HcsDetachOverlayFilter
1113HcsExportLayer
1214HcsExportLegacyWritableLayer
1315HcsFormatWritableLayerVhd
lib/libc/mingw/lib-common/kernel32.def.in+2
......@@ -121,9 +121,11 @@ BuildCommDCBW
121121BuildIoRingCancelRequest
122122BuildIoRingFlushFile
123123BuildIoRingReadFile
124BuildIoRingReadFileScatter
124125BuildIoRingRegisterBuffers
125126BuildIoRingRegisterFileHandles
126127BuildIoRingWriteFile
128BuildIoRingWriteFileGather
127129CallNamedPipeA
128130CallNamedPipeW
129131CallbackMayRunLong
lib/libc/mingw/lib-common/ninput.def created+37
......@@ -0,0 +1,37 @@
1;
2; Definition file of ninput.dll
3; Automatic generated by gendef
4; written by Kai Tietz 2008-2014
5;
6LIBRARY "ninput.dll"
7EXPORTS
8AddPointerInteractionContext
9BufferPointerPacketsInteractionContext
10CreateInteractionContext
11DestroyInteractionContext
12GetCrossSlideParameterInteractionContext
13GetHoldParameterInteractionContext
14GetInertiaParameterInteractionContext
15GetInteractionConfigurationInteractionContext
16GetMouseWheelParameterInteractionContext
17GetPropertyInteractionContext
18GetStateInteractionContext
19GetTapParameterInteractionContext
20GetTranslationParameterInteractionContext
21ProcessBufferedPacketsInteractionContext
22ProcessInertiaInteractionContext
23ProcessPointerFramesInteractionContext
24RegisterOutputCallbackInteractionContext
25RegisterOutputCallbackInteractionContext2
26RemovePointerInteractionContext
27ResetInteractionContext
28SetCrossSlideParametersInteractionContext
29SetHoldParameterInteractionContext
30SetInertiaParameterInteractionContext
31SetInteractionConfigurationInteractionContext
32SetMouseWheelParameterInteractionContext
33SetPivotInteractionContext
34SetPropertyInteractionContext
35SetTapParameterInteractionContext
36SetTranslationParameterInteractionContext
37StopInteractionContext
lib/libc/mingw/lib-common/tbs.def+1
......@@ -17,6 +17,7 @@ Tbsi_GetDeviceInfo
1717Tbsi_Get_OwnerAuth
1818Tbsi_Get_TCG_Log
1919Tbsi_Get_TCG_Log_Ex
20Tbsi_Is_Tpm_Present
2021Tbsi_Physical_Presence_Command
2122Tbsi_Revoke_Attestation
2223Tbsi_ShaHash
lib/libc/mingw/lib-common/ucrtbase-common.def.in created+2709
......@@ -0,0 +1,2709 @@
1#ifdef DEF_DEBUG
2#define F_DEBUG(x) x
3#define F_NON_DEBUG(x)
4#else
5#define F_DEBUG(x)
6#define F_NON_DEBUG(x) x
7#endif
8
9; This is list of symbols available in the first public UCRT version (ucrtbase.dll and ucrtbased.dll)
10; First public ucrtbase.dll version is 10.0.10137.0 and is part of the Microsoft Visual C++ 2015 Redistributable version 14.0.23026.0
11; First public ucrtbased.dll version is 10.0.10150.0 and is part of the Microsoft Visual Studio 2015 (Universal CRT Headers Libraries and Sources)
12F_I386(_CIacos)
13F_I386(_CIasin)
14F_I386(_CIatan)
15F_I386(_CIatan2)
16F_I386(_CIcos)
17F_I386(_CIcosh)
18F_I386(_CIexp)
19F_I386(_CIfmod)
20F_I386(_CIlog)
21F_I386(_CIlog10)
22F_I386(_CIpow)
23F_I386(_CIsin)
24F_I386(_CIsinh)
25F_I386(_CIsqrt)
26F_I386(_CItan)
27F_I386(_CItanh)
28_Cbuild
29_Cmulcc
30_Cmulcr
31_CreateFrameInfo
32F_DEBUG(_CrtCheckMemory)
33F_DEBUG(_CrtDbgReport)
34F_DEBUG(_CrtDbgReportW)
35F_DEBUG(_CrtDoForAllClientObjects)
36F_DEBUG(_CrtDumpMemoryLeaks)
37F_DEBUG(_CrtGetAllocHook)
38F_DEBUG(_CrtGetDebugFillThreshold)
39F_DEBUG(_CrtGetDumpClient)
40F_DEBUG(_CrtGetReportHook)
41F_DEBUG(_CrtIsMemoryBlock)
42F_DEBUG(_CrtIsValidHeapPointer)
43F_DEBUG(_CrtIsValidPointer)
44F_DEBUG(_CrtMemCheckpoint)
45F_DEBUG(_CrtMemDifference)
46F_DEBUG(_CrtMemDumpAllObjectsSince)
47F_DEBUG(_CrtMemDumpStatistics)
48F_DEBUG(_CrtReportBlockType)
49F_DEBUG(_CrtSetAllocHook)
50F_DEBUG(_CrtSetBreakAlloc)
51F_DEBUG(_CrtSetDbgBlockType)
52F_DEBUG(_CrtSetDbgFlag)
53F_DEBUG(_CrtSetDebugFillThreshold)
54F_DEBUG(_CrtSetDumpClient)
55F_DEBUG(_CrtSetReportFile)
56F_DEBUG(_CrtSetReportHook)
57F_DEBUG(_CrtSetReportHook2)
58F_DEBUG(_CrtSetReportHookW2)
59F_DEBUG(_CrtSetReportMode)
60F_I386(_CxxThrowException@8)
61F_NON_I386(_CxxThrowException)
62F_I386(_EH_prolog)
63_Exit
64_FCbuild
65_FCmulcc
66_FCmulcr
67F_ARM32(_FPE_Raise)
68_FindAndUnlinkFrame
69F_X64(_GetImageBase)
70F_X64(_GetThrowImageBase)
71_Getdays
72_Getmonths
73_Gettnames
74_IsExceptionObjectToBeDestroyed
75_LCbuild
76_LCmulcc
77_LCmulcr
78F_I386(_NLG_Dispatch2@4)
79F_I386(_NLG_Return@12)
80F_I386(_NLG_Return2)
81F_X64(_SetImageBase)
82F_X64(_SetThrowImageBase)
83_SetWinRTOutOfMemoryExceptionCallback
84_Strftime
85F_DEBUG(_VCrtDbgReportA)
86F_DEBUG(_VCrtDbgReportW)
87_W_Getdays
88_W_Getmonths
89_W_Gettnames
90_Wcsftime
91__AdjustPointer
92__BuildCatchObject
93__BuildCatchObjectHelper
94F_NON_I386(__C_specific_handler)
95__CxxDetectRethrow
96__CxxExceptionFilter
97__CxxFrameHandler
98__CxxFrameHandler2
99__CxxFrameHandler3
100F_I386(__CxxLongjmpUnwind@4)
101__CxxQueryExceptionSize
102__CxxRegisterExceptionObject
103__CxxUnregisterExceptionObject
104__DestructExceptionObject
105__FrameUnwindFilter
106__GetPlatformExceptionInfo
107F_NON_I386(__NLG_Dispatch2)
108F_NON_I386(__NLG_Return2)
109__RTCastToVoid
110__RTDynamicCast
111__RTtypeid
112__TypeMatch
113___lc_codepage_func
114___lc_collate_cp_func
115___lc_locale_name_func
116___mb_cur_max_func
117___mb_cur_max_l_func
118__acrt_iob_func
119__conio_common_vcprintf
120__conio_common_vcprintf_p
121__conio_common_vcprintf_s
122__conio_common_vcscanf
123__conio_common_vcwprintf
124__conio_common_vcwprintf_p
125__conio_common_vcwprintf_s
126__conio_common_vcwscanf
127F_I386(__control87_2)
128__current_exception
129__current_exception_context
130__daylight
131__dcrt_get_wide_environment_from_os
132__dcrt_initial_narrow_environment DATA
133__doserrno
134__dstbias
135__fpe_flt_rounds
136__fpecode
137__initialize_lconv_for_unsigned_char
138F_I386(__intrinsic_abnormal_termination)
139F_NON_ARM64(__intrinsic_setjmp)
140F64(__intrinsic_setjmpex)
141__isascii
142__iscsym
143__iscsymf
144__iswcsym
145__iswcsymf
146F_ARM32(__jump_unwind)
147F_I386(__libm_sse2_acos)
148F_I386(__libm_sse2_acosf)
149F_I386(__libm_sse2_asin)
150F_I386(__libm_sse2_asinf)
151F_I386(__libm_sse2_atan)
152F_I386(__libm_sse2_atan2)
153F_I386(__libm_sse2_atanf)
154F_I386(__libm_sse2_cos)
155F_I386(__libm_sse2_cosf)
156F_I386(__libm_sse2_exp)
157F_I386(__libm_sse2_expf)
158F_I386(__libm_sse2_log)
159F_I386(__libm_sse2_log10)
160F_I386(__libm_sse2_log10f)
161F_I386(__libm_sse2_logf)
162F_I386(__libm_sse2_pow)
163F_I386(__libm_sse2_powf)
164F_I386(__libm_sse2_sin)
165F_I386(__libm_sse2_sinf)
166F_I386(__libm_sse2_tan)
167F_I386(__libm_sse2_tanf)
168__p___argc
169__p___argv
170__p___wargv
171__p__acmdln
172__p__commode
173F_DEBUG(__p__crtBreakAlloc)
174F_DEBUG(__p__crtDbgFlag)
175__p__environ
176__p__fmode
177__p__mbcasemap
178__p__mbctype
179__p__pgmptr
180__p__wcmdln
181__p__wenviron
182__p__wpgmptr
183__pctype_func
184__processing_throw
185__pwctype_func
186__pxcptinfoptrs
187__report_gsfailure
188__setusermatherr
189__std_exception_copy
190__std_exception_destroy
191__std_type_info_compare
192__std_type_info_destroy_list
193__std_type_info_hash
194__std_type_info_name
195__stdio_common_vfprintf
196__stdio_common_vfprintf_p
197__stdio_common_vfprintf_s
198__stdio_common_vfscanf
199__stdio_common_vfwprintf
200__stdio_common_vfwprintf_p
201__stdio_common_vfwprintf_s
202__stdio_common_vfwscanf
203__stdio_common_vsnprintf_s
204__stdio_common_vsnwprintf_s
205__stdio_common_vsprintf
206__stdio_common_vsprintf_p
207__stdio_common_vsprintf_s
208__stdio_common_vsscanf
209__stdio_common_vswprintf
210__stdio_common_vswprintf_p
211__stdio_common_vswprintf_s
212__stdio_common_vswscanf
213__strncnt
214__sys_errlist
215__sys_nerr
216__threadhandle
217__threadid
218__timezone
219__toascii
220__tzname
221#if !defined(DEF_DEBUG) || !defined(DEF_ARM64)
222; symbols __unDName and __unDNameEx are available in all versions except ARM64 ucrtbased.dll
223__unDName
224__unDNameEx
225#endif
226__uncaught_exception
227__wcserror
228__wcserror_s
229__wcsncnt
230_abs64
231_access
232_access_s
233_aligned_free
234F_DEBUG(_aligned_free_dbg)
235_aligned_malloc
236F_DEBUG(_aligned_malloc_dbg)
237_aligned_msize
238F_DEBUG(_aligned_msize_dbg)
239_aligned_offset_malloc
240F_DEBUG(_aligned_offset_malloc_dbg)
241_aligned_offset_realloc
242F_DEBUG(_aligned_offset_realloc_dbg)
243_aligned_offset_recalloc
244F_DEBUG(_aligned_offset_recalloc_dbg)
245_aligned_realloc
246F_DEBUG(_aligned_realloc_dbg)
247_aligned_recalloc
248F_DEBUG(_aligned_recalloc_dbg)
249_assert
250_atodbl
251_atodbl_l
252_atof_l
253_atoflt
254_atoflt_l
255_atoi64
256_atoi64_l
257_atoi_l
258_atol_l
259_atoldbl
260_atoldbl_l
261_atoll_l
262_beep
263_beginthread
264_beginthreadex
265_byteswap_uint64
266_byteswap_ulong
267_byteswap_ushort
268_c_exit
269_cabs DATA ; DATA set manually
270_callnewh
271_calloc_base
272F_DEBUG(_calloc_dbg)
273_cexit
274_cgets
275_cgets_s
276_cgetws
277_cgetws_s
278_chdir
279_chdrive
280_chgsign
281_chgsignf
282F_I386(_chkesp)
283_chmod
284_chsize
285_chsize_s
286F_DEBUG(_chvalidator)
287F_DEBUG(_chvalidator_l)
288_clearfp
289_close
290_commit
291_configthreadlocale
292_configure_narrow_argv
293_configure_wide_argv
294_control87
295_controlfp
296_controlfp_s
297_copysign
298_copysignf
299_cputs
300_cputws
301_creat
302_create_locale
303_crt_at_quick_exit
304_crt_atexit
305F_I386(_crt_debugger_hook)
306_ctime32
307_ctime32_s
308_ctime64
309_ctime64_s
310_cwait
311_d_int
312_dclass
313_dexp
314_difftime32
315_difftime64
316_dlog
317_dnorm
318_dpcomp
319_dpoly
320_dscale
321_dsign
322_dsin
323_dtest
324_dunscale
325_dup
326_dup2
327_dupenv_s
328F_DEBUG(_dupenv_s_dbg)
329_ecvt
330_ecvt_s
331_endthread
332_endthreadex
333_eof
334_errno
335_except1
336F_I386(_except_handler2)
337F_I386(_except_handler3)
338F_I386(_except_handler4_common)
339_execl
340_execle
341_execlp
342_execlpe
343_execute_onexit_table
344_execv
345_execve
346_execvp
347_execvpe
348_exit
349_expand
350F_DEBUG(_expand_dbg)
351_fclose_nolock
352_fcloseall
353_fcvt
354_fcvt_s
355_fd_int
356_fdclass
357_fdexp
358_fdlog
359_fdnorm
360_fdopen
361_fdpcomp
362_fdpoly
363_fdscale
364_fdsign
365_fdsin
366_fdtest
367_fdunscale
368_fflush_nolock
369_fgetc_nolock
370_fgetchar
371_fgetwc_nolock
372_fgetwchar
373_filelength
374_filelengthi64
375_fileno
376_findclose
377_findfirst32
378_findfirst32i64
379_findfirst64
380_findfirst64i32
381_findnext32
382_findnext32i64
383_findnext64
384_findnext64i32
385_finite
386F_NON_I386(_finitef)
387_flushall
388_fpclass
389F_X64(_fpclassf)
390_fpieee_flt
391_fpreset DATA ; DATA added manually
392_fputc_nolock
393_fputchar
394_fputwc_nolock
395_fputwchar
396_fread_nolock
397_fread_nolock_s
398_free_base
399F_DEBUG(_free_dbg)
400_free_locale
401_fseek_nolock
402_fseeki64
403_fseeki64_nolock
404_fsopen
405_fstat32
406_fstat32i64
407_fstat64
408_fstat64i32
409_ftell_nolock
410_ftelli64
411_ftelli64_nolock
412_ftime32
413_ftime32_s
414_ftime64
415_ftime64_s
416F_I386(_ftol)
417_fullpath
418F_DEBUG(_fullpath_dbg)
419_futime32
420_futime64
421_fwrite_nolock
422_gcvt
423_gcvt_s
424F_X64(_get_FMA3_enable)
425_get_current_locale
426_get_daylight
427_get_doserrno
428_get_dstbias
429_get_errno
430_get_fmode
431_get_heap_handle
432_get_initial_narrow_environment
433_get_initial_wide_environment
434_get_invalid_parameter_handler
435_get_narrow_winmain_command_line
436_get_osfhandle
437_get_pgmptr
438_get_printf_count_output
439_get_purecall_handler
440_get_stream_buffer_pointers
441_get_terminate
442_get_thread_local_invalid_parameter_handler
443_get_timezone
444_get_tzname
445_get_unexpected
446_get_wide_winmain_command_line
447_get_wpgmptr
448_getc_nolock
449_getch
450_getch_nolock
451_getche
452_getche_nolock
453_getcwd
454F_DEBUG(_getcwd_dbg)
455_getdcwd
456F_DEBUG(_getdcwd_dbg)
457_getdiskfree
458_getdllprocaddr
459_getdrive
460_getdrives
461_getmaxstdio
462_getmbcp
463_getpid
464_getsystime
465_getw
466_getwc_nolock
467_getwch
468_getwch_nolock
469_getwche
470_getwche_nolock
471_getws
472_getws_s
473F_I386(_global_unwind2)
474_gmtime32
475_gmtime32_s
476_gmtime64
477_gmtime64_s
478_heapchk
479_heapmin
480_heapwalk
481_hypot
482_hypotf
483_i64toa
484_i64toa_s
485_i64tow
486_i64tow_s
487_initialize_narrow_environment
488_initialize_onexit_table
489_initialize_wide_environment
490_initterm
491_initterm_e
492F_DEBUG(_invalid_parameter)
493_invalid_parameter_noinfo
494_invalid_parameter_noinfo_noreturn
495_invoke_watson
496#if !defined(DEF_DEBUG) || !defined(DEF_ARM64)
497; symbol _is_exception_typeof is available in all versions except ARM64 ucrtbased.dll
498_is_exception_typeof
499#endif
500_isalnum_l
501_isalpha_l
502_isatty
503_isblank_l
504_iscntrl_l
505_isctype
506_isctype_l
507_isdigit_l
508_isgraph_l
509_isleadbyte_l
510_islower_l
511_ismbbalnum
512_ismbbalnum_l
513_ismbbalpha
514_ismbbalpha_l
515_ismbbblank
516_ismbbblank_l
517_ismbbgraph
518_ismbbgraph_l
519_ismbbkalnum
520_ismbbkalnum_l
521_ismbbkana
522_ismbbkana_l
523_ismbbkprint
524_ismbbkprint_l
525_ismbbkpunct
526_ismbbkpunct_l
527_ismbblead
528_ismbblead_l
529_ismbbprint
530_ismbbprint_l
531_ismbbpunct
532_ismbbpunct_l
533_ismbbtrail
534_ismbbtrail_l
535_ismbcalnum
536_ismbcalnum_l
537_ismbcalpha
538_ismbcalpha_l
539_ismbcblank
540_ismbcblank_l
541_ismbcdigit
542_ismbcdigit_l
543_ismbcgraph
544_ismbcgraph_l
545_ismbchira
546_ismbchira_l
547_ismbckata
548_ismbckata_l
549_ismbcl0
550_ismbcl0_l
551_ismbcl1
552_ismbcl1_l
553_ismbcl2
554_ismbcl2_l
555_ismbclegal
556_ismbclegal_l
557_ismbclower
558_ismbclower_l
559_ismbcprint
560_ismbcprint_l
561_ismbcpunct
562_ismbcpunct_l
563_ismbcspace
564_ismbcspace_l
565_ismbcsymbol
566_ismbcsymbol_l
567_ismbcupper
568_ismbcupper_l
569_ismbslead
570_ismbslead_l
571_ismbstrail
572_ismbstrail_l
573_isnan
574F_X64(_isnanf)
575_isprint_l
576_ispunct_l
577_isspace_l
578_isupper_l
579_iswalnum_l
580_iswalpha_l
581_iswblank_l
582_iswcntrl_l
583_iswcsym_l
584_iswcsymf_l
585_iswctype_l
586_iswdigit_l
587_iswgraph_l
588_iswlower_l
589_iswprint_l
590_iswpunct_l
591_iswspace_l
592_iswupper_l
593_iswxdigit_l
594_isxdigit_l
595_itoa
596_itoa_s
597_itow
598_itow_s
599_j0
600_j1
601_jn
602_kbhit
603_ld_int
604_ldclass
605_ldexp
606_ldlog
607_ldpcomp
608_ldpoly
609_ldscale
610_ldsign
611_ldsin
612_ldtest
613_ldunscale
614_lfind
615_lfind_s
616F_I386(_libm_sse2_acos_precise)
617F_I386(_libm_sse2_asin_precise)
618F_I386(_libm_sse2_atan_precise)
619F_I386(_libm_sse2_cos_precise)
620F_I386(_libm_sse2_exp_precise)
621F_I386(_libm_sse2_log10_precise)
622F_I386(_libm_sse2_log_precise)
623F_I386(_libm_sse2_pow_precise)
624F_I386(_libm_sse2_sin_precise)
625F_I386(_libm_sse2_sqrt_precise)
626F_I386(_libm_sse2_tan_precise)
627_loaddll
628F64(_local_unwind)
629F_I386(_local_unwind2)
630F_I386(_local_unwind4)
631_localtime32
632_localtime32_s
633_localtime64
634_localtime64_s
635_lock_file
636_lock_locales
637_locking
638_logb
639F_NON_I386(_logbf)
640F_I386(_longjmpex)
641_lrotl
642_lrotr
643_lsearch
644_lsearch_s
645_lseek
646_lseeki64
647_ltoa
648_ltoa_s
649_ltow
650_ltow_s
651_makepath
652_makepath_s
653_malloc_base
654F_DEBUG(_malloc_dbg)
655_mbbtombc
656_mbbtombc_l
657_mbbtype
658_mbbtype_l
659_mbcasemap DATA
660_mbccpy
661_mbccpy_l
662_mbccpy_s
663_mbccpy_s_l
664_mbcjistojms
665_mbcjistojms_l
666_mbcjmstojis
667_mbcjmstojis_l
668_mbclen
669_mbclen_l
670_mbctohira
671_mbctohira_l
672_mbctokata
673_mbctokata_l
674_mbctolower
675_mbctolower_l
676_mbctombb
677_mbctombb_l
678_mbctoupper
679_mbctoupper_l
680_mblen_l
681_mbsbtype
682_mbsbtype_l
683_mbscat_s
684_mbscat_s_l
685_mbschr
686_mbschr_l
687_mbscmp
688_mbscmp_l
689_mbscoll
690_mbscoll_l
691_mbscpy_s
692_mbscpy_s_l
693_mbscspn
694_mbscspn_l
695_mbsdec
696_mbsdec_l
697_mbsdup
698F_DEBUG(_mbsdup_dbg)
699_mbsicmp
700_mbsicmp_l
701_mbsicoll
702_mbsicoll_l
703_mbsinc
704_mbsinc_l
705_mbslen
706_mbslen_l
707_mbslwr
708_mbslwr_l
709_mbslwr_s
710_mbslwr_s_l
711_mbsnbcat
712_mbsnbcat_l
713_mbsnbcat_s
714_mbsnbcat_s_l
715_mbsnbcmp
716_mbsnbcmp_l
717_mbsnbcnt
718_mbsnbcnt_l
719_mbsnbcoll
720_mbsnbcoll_l
721_mbsnbcpy
722_mbsnbcpy_l
723_mbsnbcpy_s
724_mbsnbcpy_s_l
725_mbsnbicmp
726_mbsnbicmp_l
727_mbsnbicoll
728_mbsnbicoll_l
729_mbsnbset
730_mbsnbset_l
731_mbsnbset_s
732_mbsnbset_s_l
733_mbsncat
734_mbsncat_l
735_mbsncat_s
736_mbsncat_s_l
737_mbsnccnt
738_mbsnccnt_l
739_mbsncmp
740_mbsncmp_l
741_mbsncoll
742_mbsncoll_l
743_mbsncpy
744_mbsncpy_l
745_mbsncpy_s
746_mbsncpy_s_l
747_mbsnextc
748_mbsnextc_l
749_mbsnicmp
750_mbsnicmp_l
751_mbsnicoll
752_mbsnicoll_l
753_mbsninc
754_mbsninc_l
755_mbsnlen
756_mbsnlen_l
757_mbsnset
758_mbsnset_l
759_mbsnset_s
760_mbsnset_s_l
761_mbspbrk
762_mbspbrk_l
763_mbsrchr
764_mbsrchr_l
765_mbsrev
766_mbsrev_l
767_mbsset
768_mbsset_l
769_mbsset_s
770_mbsset_s_l
771_mbsspn
772_mbsspn_l
773_mbsspnp
774_mbsspnp_l
775_mbsstr
776_mbsstr_l
777_mbstok
778_mbstok_l
779_mbstok_s
780_mbstok_s_l
781_mbstowcs_l
782_mbstowcs_s_l
783_mbstrlen
784_mbstrlen_l
785_mbstrnlen
786_mbstrnlen_l
787_mbsupr
788_mbsupr_l
789_mbsupr_s
790_mbsupr_s_l
791_mbtowc_l
792_memccpy
793_memicmp
794_memicmp_l
795_mkdir
796_mkgmtime32
797_mkgmtime64
798_mktemp
799_mktemp_s
800_mktime32
801_mktime64
802_msize
803F_DEBUG(_msize_dbg)
804_nextafter
805F_X64(_nextafterf)
806F_I386(_o__CIacos)
807F_I386(_o__CIasin)
808F_I386(_o__CIatan)
809F_I386(_o__CIatan2)
810F_I386(_o__CIcos)
811F_I386(_o__CIcosh)
812F_I386(_o__CIexp)
813F_I386(_o__CIfmod)
814F_I386(_o__CIlog)
815F_I386(_o__CIlog10)
816F_I386(_o__CIpow)
817F_I386(_o__CIsin)
818F_I386(_o__CIsinh)
819F_I386(_o__CIsqrt)
820F_I386(_o__CItan)
821F_I386(_o__CItanh)
822_o__Getdays
823_o__Getmonths
824_o__Gettnames
825_o__Strftime
826_o__W_Getdays
827_o__W_Getmonths
828_o__W_Gettnames
829_o__Wcsftime
830_o___acrt_iob_func
831_o___conio_common_vcprintf
832_o___conio_common_vcprintf_p
833_o___conio_common_vcprintf_s
834_o___conio_common_vcscanf
835_o___conio_common_vcwprintf
836_o___conio_common_vcwprintf_p
837_o___conio_common_vcwprintf_s
838_o___conio_common_vcwscanf
839_o___daylight
840_o___dstbias
841_o___fpe_flt_rounds
842F_I386(_o___libm_sse2_acos)
843F_I386(_o___libm_sse2_acosf)
844F_I386(_o___libm_sse2_asin)
845F_I386(_o___libm_sse2_asinf)
846F_I386(_o___libm_sse2_atan)
847F_I386(_o___libm_sse2_atan2)
848F_I386(_o___libm_sse2_atanf)
849F_I386(_o___libm_sse2_cos)
850F_I386(_o___libm_sse2_cosf)
851F_I386(_o___libm_sse2_exp)
852F_I386(_o___libm_sse2_expf)
853F_I386(_o___libm_sse2_log)
854F_I386(_o___libm_sse2_log10)
855F_I386(_o___libm_sse2_log10f)
856F_I386(_o___libm_sse2_logf)
857F_I386(_o___libm_sse2_pow)
858F_I386(_o___libm_sse2_powf)
859F_I386(_o___libm_sse2_sin)
860F_I386(_o___libm_sse2_sinf)
861F_I386(_o___libm_sse2_tan)
862F_I386(_o___libm_sse2_tanf)
863_o___p___argc
864_o___p___argv
865_o___p___wargv
866_o___p__acmdln
867_o___p__commode
868_o___p__environ
869_o___p__fmode
870_o___p__mbcasemap
871_o___p__mbctype
872_o___p__pgmptr
873_o___p__wcmdln
874_o___p__wenviron
875_o___p__wpgmptr
876_o___pctype_func
877_o___pwctype_func
878_o___stdio_common_vfprintf
879_o___stdio_common_vfprintf_p
880_o___stdio_common_vfprintf_s
881_o___stdio_common_vfscanf
882_o___stdio_common_vfwprintf
883_o___stdio_common_vfwprintf_p
884_o___stdio_common_vfwprintf_s
885_o___stdio_common_vfwscanf
886_o___stdio_common_vsnprintf_s
887_o___stdio_common_vsnwprintf_s
888_o___stdio_common_vsprintf
889_o___stdio_common_vsprintf_p
890_o___stdio_common_vsprintf_s
891_o___stdio_common_vsscanf
892_o___stdio_common_vswprintf
893_o___stdio_common_vswprintf_p
894_o___stdio_common_vswprintf_s
895_o___stdio_common_vswscanf
896_o___timezone
897_o___tzname
898_o___wcserror
899_o__access
900_o__access_s
901_o__aligned_free
902_o__aligned_malloc
903_o__aligned_msize
904_o__aligned_offset_malloc
905_o__aligned_offset_realloc
906_o__aligned_offset_recalloc
907_o__aligned_realloc
908_o__aligned_recalloc
909_o__atodbl
910_o__atodbl_l
911_o__atof_l
912_o__atoflt
913_o__atoflt_l
914_o__atoi64
915_o__atoi64_l
916_o__atoi_l
917_o__atol_l
918_o__atoldbl
919_o__atoldbl_l
920_o__atoll_l
921_o__beep
922_o__beginthread
923_o__beginthreadex
924_o__cabs
925_o__callnewh
926_o__calloc_base
927_o__cgets
928_o__cgets_s
929_o__cgetws
930_o__cgetws_s
931_o__chdir
932_o__chdrive
933_o__chmod
934_o__chsize
935_o__chsize_s
936_o__close
937_o__commit
938_o__configure_wide_argv
939_o__cputs
940_o__cputws
941_o__creat
942_o__create_locale
943_o__ctime32_s
944_o__ctime64_s
945_o__cwait
946_o__d_int
947_o__dclass
948_o__difftime32
949_o__difftime64
950_o__dlog
951_o__dnorm
952_o__dpcomp
953_o__dpoly
954_o__dscale
955_o__dsign
956_o__dsin
957_o__dtest
958_o__dunscale
959_o__dup
960_o__dup2
961_o__dupenv_s
962_o__ecvt
963_o__ecvt_s
964_o__endthread
965_o__endthreadex
966_o__eof
967_o__errno
968_o__except1
969_o__execute_onexit_table
970_o__execv
971_o__execve
972_o__execvp
973_o__execvpe
974_o__expand
975_o__fclose_nolock
976_o__fcloseall
977_o__fcvt
978_o__fcvt_s
979_o__fd_int
980_o__fdclass
981_o__fdexp
982_o__fdlog
983_o__fdopen
984_o__fdpcomp
985_o__fdpoly
986_o__fdscale
987_o__fdsign
988_o__fdsin
989_o__fflush_nolock
990_o__fgetc_nolock
991_o__fgetchar
992_o__fgetwc_nolock
993_o__fgetwchar
994_o__filelength
995_o__filelengthi64
996_o__fileno
997_o__findclose
998_o__findfirst32
999_o__findfirst32i64
1000_o__findfirst64
1001_o__findfirst64i32
1002_o__findnext32
1003_o__findnext32i64
1004_o__findnext64
1005_o__findnext64i32
1006_o__flushall
1007_o__fpclass
1008F_X64(_o__fpclassf)
1009_o__fputc_nolock
1010_o__fputchar
1011_o__fputwc_nolock
1012_o__fputwchar
1013_o__fread_nolock
1014_o__fread_nolock_s
1015_o__free_base
1016_o__free_locale
1017_o__fseek_nolock
1018_o__fseeki64
1019_o__fseeki64_nolock
1020_o__fsopen
1021_o__fstat32
1022_o__fstat32i64
1023_o__fstat64
1024_o__fstat64i32
1025_o__ftell_nolock
1026_o__ftelli64
1027_o__ftelli64_nolock
1028_o__ftime32
1029_o__ftime32_s
1030_o__ftime64
1031_o__ftime64_s
1032_o__fullpath
1033_o__futime32
1034_o__futime64
1035_o__fwrite_nolock
1036_o__gcvt
1037_o__gcvt_s
1038_o__get_daylight
1039_o__get_doserrno
1040_o__get_dstbias
1041_o__get_errno
1042_o__get_fmode
1043_o__get_heap_handle
1044_o__get_invalid_parameter_handler
1045_o__get_narrow_winmain_command_line
1046_o__get_osfhandle
1047_o__get_pgmptr
1048_o__get_stream_buffer_pointers
1049_o__get_terminate
1050_o__get_thread_local_invalid_parameter_handler
1051_o__get_timezone
1052_o__get_tzname
1053_o__get_wide_winmain_command_line
1054_o__get_wpgmptr
1055_o__getc_nolock
1056_o__getch
1057_o__getch_nolock
1058_o__getche
1059_o__getche_nolock
1060_o__getcwd
1061_o__getdcwd
1062_o__getdiskfree
1063_o__getdllprocaddr
1064_o__getdrive
1065_o__getdrives
1066_o__getmbcp
1067_o__getsystime
1068_o__getw
1069_o__getwc_nolock
1070_o__getwch
1071_o__getwch_nolock
1072_o__getwche
1073_o__getwche_nolock
1074_o__getws
1075_o__getws_s
1076_o__gmtime32
1077_o__gmtime32_s
1078_o__gmtime64
1079_o__gmtime64_s
1080_o__heapchk
1081_o__heapmin
1082_o__hypot
1083_o__hypotf
1084_o__i64toa
1085_o__i64toa_s
1086_o__i64tow
1087_o__i64tow_s
1088_o__initialize_onexit_table
1089_o__invalid_parameter_noinfo
1090_o__invalid_parameter_noinfo_noreturn
1091_o__isatty
1092_o__isctype
1093_o__isctype_l
1094_o__isleadbyte_l
1095_o__ismbbalnum
1096_o__ismbbalnum_l
1097_o__ismbbalpha
1098_o__ismbbalpha_l
1099_o__ismbbblank
1100_o__ismbbblank_l
1101_o__ismbbgraph
1102_o__ismbbgraph_l
1103_o__ismbbkalnum
1104_o__ismbbkalnum_l
1105_o__ismbbkana
1106_o__ismbbkana_l
1107_o__ismbbkprint
1108_o__ismbbkprint_l
1109_o__ismbbkpunct
1110_o__ismbbkpunct_l
1111_o__ismbblead
1112_o__ismbblead_l
1113_o__ismbbprint
1114_o__ismbbprint_l
1115_o__ismbbpunct
1116_o__ismbbpunct_l
1117_o__ismbbtrail
1118_o__ismbbtrail_l
1119_o__ismbcalnum
1120_o__ismbcalnum_l
1121_o__ismbcalpha
1122_o__ismbcalpha_l
1123_o__ismbcblank
1124_o__ismbcblank_l
1125_o__ismbcdigit
1126_o__ismbcdigit_l
1127_o__ismbcgraph
1128_o__ismbcgraph_l
1129_o__ismbchira
1130_o__ismbchira_l
1131_o__ismbckata
1132_o__ismbckata_l
1133_o__ismbcl0
1134_o__ismbcl0_l
1135_o__ismbcl1
1136_o__ismbcl1_l
1137_o__ismbcl2
1138_o__ismbcl2_l
1139_o__ismbclegal
1140_o__ismbclegal_l
1141_o__ismbclower
1142_o__ismbclower_l
1143_o__ismbcprint
1144_o__ismbcprint_l
1145_o__ismbcpunct
1146_o__ismbcpunct_l
1147_o__ismbcspace
1148_o__ismbcspace_l
1149_o__ismbcsymbol
1150_o__ismbcsymbol_l
1151_o__ismbcupper
1152_o__ismbcupper_l
1153_o__ismbslead
1154_o__ismbslead_l
1155_o__ismbstrail
1156_o__ismbstrail_l
1157_o__iswctype_l
1158_o__itoa
1159_o__itoa_s
1160_o__itow
1161_o__itow_s
1162_o__j0
1163_o__j1
1164_o__jn
1165_o__kbhit
1166_o__ld_int
1167_o__ldclass
1168_o__ldexp
1169_o__ldlog
1170_o__ldpcomp
1171_o__ldpoly
1172_o__ldscale
1173_o__ldsign
1174_o__ldsin
1175_o__ldtest
1176_o__ldunscale
1177_o__lfind
1178_o__lfind_s
1179F_I386(_o__libm_sse2_acos_precise)
1180F_I386(_o__libm_sse2_asin_precise)
1181F_I386(_o__libm_sse2_atan_precise)
1182F_I386(_o__libm_sse2_cos_precise)
1183F_I386(_o__libm_sse2_exp_precise)
1184F_I386(_o__libm_sse2_log10_precise)
1185F_I386(_o__libm_sse2_log_precise)
1186F_I386(_o__libm_sse2_pow_precise)
1187F_I386(_o__libm_sse2_sin_precise)
1188F_I386(_o__libm_sse2_sqrt_precise)
1189F_I386(_o__libm_sse2_tan_precise)
1190_o__loaddll
1191_o__localtime32
1192_o__localtime32_s
1193_o__localtime64
1194_o__localtime64_s
1195_o__lock_file
1196_o__locking
1197_o__logb
1198F_NON_I386(_o__logbf)
1199_o__lsearch
1200_o__lsearch_s
1201_o__lseek
1202_o__lseeki64
1203_o__ltoa
1204_o__ltoa_s
1205_o__ltow
1206_o__ltow_s
1207_o__makepath
1208_o__makepath_s
1209_o__malloc_base
1210_o__mbbtombc
1211_o__mbbtombc_l
1212_o__mbbtype
1213_o__mbbtype_l
1214_o__mbccpy
1215_o__mbccpy_l
1216_o__mbccpy_s
1217_o__mbccpy_s_l
1218_o__mbcjistojms
1219_o__mbcjistojms_l
1220_o__mbcjmstojis
1221_o__mbcjmstojis_l
1222_o__mbclen
1223_o__mbclen_l
1224_o__mbctohira
1225_o__mbctohira_l
1226_o__mbctokata
1227_o__mbctokata_l
1228_o__mbctolower
1229_o__mbctolower_l
1230_o__mbctombb
1231_o__mbctombb_l
1232_o__mbctoupper
1233_o__mbctoupper_l
1234_o__mblen_l
1235_o__mbsbtype
1236_o__mbsbtype_l
1237_o__mbscat_s
1238_o__mbscat_s_l
1239_o__mbschr
1240_o__mbschr_l
1241_o__mbscmp
1242_o__mbscmp_l
1243_o__mbscoll
1244_o__mbscoll_l
1245_o__mbscpy_s
1246_o__mbscpy_s_l
1247_o__mbscspn
1248_o__mbscspn_l
1249_o__mbsdec
1250_o__mbsdec_l
1251_o__mbsicmp
1252_o__mbsicmp_l
1253_o__mbsicoll
1254_o__mbsicoll_l
1255_o__mbsinc
1256_o__mbsinc_l
1257_o__mbslen
1258_o__mbslen_l
1259_o__mbslwr
1260_o__mbslwr_l
1261_o__mbslwr_s
1262_o__mbslwr_s_l
1263_o__mbsnbcat
1264_o__mbsnbcat_l
1265_o__mbsnbcat_s
1266_o__mbsnbcat_s_l
1267_o__mbsnbcmp
1268_o__mbsnbcmp_l
1269_o__mbsnbcnt
1270_o__mbsnbcnt_l
1271_o__mbsnbcoll
1272_o__mbsnbcoll_l
1273_o__mbsnbcpy
1274_o__mbsnbcpy_l
1275_o__mbsnbcpy_s
1276_o__mbsnbcpy_s_l
1277_o__mbsnbicmp
1278_o__mbsnbicmp_l
1279_o__mbsnbicoll
1280_o__mbsnbicoll_l
1281_o__mbsnbset
1282_o__mbsnbset_l
1283_o__mbsnbset_s
1284_o__mbsnbset_s_l
1285_o__mbsncat
1286_o__mbsncat_l
1287_o__mbsncat_s
1288_o__mbsncat_s_l
1289_o__mbsnccnt
1290_o__mbsnccnt_l
1291_o__mbsncmp
1292_o__mbsncmp_l
1293_o__mbsncoll
1294_o__mbsncoll_l
1295_o__mbsncpy
1296_o__mbsncpy_l
1297_o__mbsncpy_s
1298_o__mbsncpy_s_l
1299_o__mbsnextc
1300_o__mbsnextc_l
1301_o__mbsnicmp
1302_o__mbsnicmp_l
1303_o__mbsnicoll
1304_o__mbsnicoll_l
1305_o__mbsninc
1306_o__mbsninc_l
1307_o__mbsnlen
1308_o__mbsnlen_l
1309_o__mbsnset
1310_o__mbsnset_l
1311_o__mbsnset_s
1312_o__mbsnset_s_l
1313_o__mbspbrk
1314_o__mbspbrk_l
1315_o__mbsrchr
1316_o__mbsrchr_l
1317_o__mbsrev
1318_o__mbsrev_l
1319_o__mbsset
1320_o__mbsset_l
1321_o__mbsset_s
1322_o__mbsset_s_l
1323_o__mbsspn
1324_o__mbsspn_l
1325_o__mbsspnp
1326_o__mbsspnp_l
1327_o__mbsstr
1328_o__mbsstr_l
1329_o__mbstok
1330_o__mbstok_l
1331_o__mbstok_s
1332_o__mbstok_s_l
1333_o__mbstowcs_l
1334_o__mbstowcs_s_l
1335_o__mbstrlen
1336_o__mbstrlen_l
1337_o__mbstrnlen
1338_o__mbstrnlen_l
1339_o__mbsupr
1340_o__mbsupr_l
1341_o__mbsupr_s
1342_o__mbsupr_s_l
1343_o__mbtowc_l
1344_o__memicmp
1345_o__memicmp_l
1346_o__mkdir
1347_o__mkgmtime32
1348_o__mkgmtime64
1349_o__mktemp
1350_o__mktemp_s
1351_o__mktime32
1352_o__mktime64
1353_o__msize
1354_o__nextafter
1355F_X64(_o__nextafterf)
1356_o__open_osfhandle
1357_o__pclose
1358_o__pipe
1359_o__popen
1360_o__putc_nolock
1361_o__putch
1362_o__putch_nolock
1363_o__putenv
1364_o__putenv_s
1365_o__putw
1366_o__putwc_nolock
1367_o__putwch
1368_o__putwch_nolock
1369_o__putws
1370_o__read
1371_o__realloc_base
1372_o__recalloc
1373_o__register_onexit_function
1374_o__resetstkoflw
1375_o__rmdir
1376_o__rmtmp
1377_o__scalb
1378F_X64(_o__scalbf)
1379_o__searchenv
1380_o__searchenv_s
1381_o__set_abort_behavior
1382_o__set_doserrno
1383_o__set_errno
1384_o__set_invalid_parameter_handler
1385_o__set_new_handler
1386_o__set_new_mode
1387_o__set_thread_local_invalid_parameter_handler
1388_o__seterrormode
1389_o__setmbcp
1390_o__setmode
1391_o__setsystime
1392_o__sleep
1393_o__sopen
1394_o__sopen_dispatch
1395_o__sopen_s
1396_o__spawnv
1397_o__spawnve
1398_o__spawnvp
1399_o__spawnvpe
1400_o__splitpath
1401_o__splitpath_s
1402_o__stat32
1403_o__stat32i64
1404_o__stat64
1405_o__stat64i32
1406_o__strcoll_l
1407_o__strdate
1408_o__strdate_s
1409_o__strdup
1410_o__strerror
1411_o__strerror_s
1412_o__strftime_l
1413_o__stricmp
1414_o__stricmp_l
1415_o__stricoll
1416_o__stricoll_l
1417_o__strlwr
1418_o__strlwr_l
1419_o__strlwr_s
1420_o__strlwr_s_l
1421_o__strncoll
1422_o__strncoll_l
1423_o__strnicmp
1424_o__strnicmp_l
1425_o__strnicoll
1426_o__strnicoll_l
1427_o__strnset_s
1428_o__strset_s
1429_o__strtime
1430_o__strtime_s
1431_o__strtod_l
1432_o__strtof_l
1433_o__strtoi64
1434_o__strtoi64_l
1435_o__strtol_l
1436F_ARM_ANY(_o__strtold_l) ; Can't use long double functions from the CRT on x86
1437_o__strtoll_l
1438_o__strtoui64
1439_o__strtoui64_l
1440_o__strtoul_l
1441_o__strtoull_l
1442_o__strupr
1443_o__strupr_l
1444_o__strupr_s
1445_o__strupr_s_l
1446_o__strxfrm_l
1447_o__swab
1448_o__tell
1449_o__telli64
1450_o__timespec32_get
1451_o__timespec64_get
1452_o__tolower
1453_o__tolower_l
1454_o__toupper
1455_o__toupper_l
1456_o__towlower_l
1457_o__towupper_l
1458_o__tzset
1459_o__ui64toa
1460_o__ui64toa_s
1461_o__ui64tow
1462_o__ui64tow_s
1463_o__ultoa
1464_o__ultoa_s
1465_o__ultow
1466_o__ultow_s
1467_o__umask
1468_o__umask_s
1469_o__ungetc_nolock
1470_o__ungetch
1471_o__ungetch_nolock
1472_o__ungetwc_nolock
1473_o__ungetwch
1474_o__ungetwch_nolock
1475_o__unlink
1476_o__unloaddll
1477_o__unlock_file
1478_o__utime32
1479_o__utime64
1480_o__waccess
1481_o__waccess_s
1482_o__wasctime
1483_o__wasctime_s
1484_o__wchdir
1485_o__wchmod
1486_o__wcreat
1487_o__wcreate_locale
1488_o__wcscoll_l
1489_o__wcsdup
1490_o__wcserror
1491_o__wcserror_s
1492_o__wcsftime_l
1493_o__wcsicmp
1494_o__wcsicmp_l
1495_o__wcsicoll
1496_o__wcsicoll_l
1497_o__wcslwr
1498_o__wcslwr_l
1499_o__wcslwr_s
1500_o__wcslwr_s_l
1501_o__wcsncoll
1502_o__wcsncoll_l
1503_o__wcsnicmp
1504_o__wcsnicmp_l
1505_o__wcsnicoll
1506_o__wcsnicoll_l
1507_o__wcsnset
1508_o__wcsnset_s
1509_o__wcsset
1510_o__wcsset_s
1511_o__wcstod_l
1512_o__wcstof_l
1513_o__wcstoi64
1514_o__wcstoi64_l
1515_o__wcstol_l
1516F_ARM_ANY(_o__wcstold_l) ; Can't use long double functions from the CRT on x86
1517_o__wcstoll_l
1518_o__wcstombs_l
1519_o__wcstombs_s_l
1520_o__wcstoui64
1521_o__wcstoui64_l
1522_o__wcstoul_l
1523_o__wcstoull_l
1524_o__wcsupr
1525_o__wcsupr_l
1526_o__wcsupr_s
1527_o__wcsupr_s_l
1528_o__wcsxfrm_l
1529_o__wctime32
1530_o__wctime32_s
1531_o__wctime64
1532_o__wctime64_s
1533_o__wctomb_l
1534_o__wctomb_s_l
1535_o__wdupenv_s
1536_o__wexecv
1537_o__wexecve
1538_o__wexecvp
1539_o__wexecvpe
1540_o__wfdopen
1541_o__wfindfirst32
1542_o__wfindfirst32i64
1543_o__wfindfirst64
1544_o__wfindfirst64i32
1545_o__wfindnext32
1546_o__wfindnext32i64
1547_o__wfindnext64
1548_o__wfindnext64i32
1549_o__wfopen
1550_o__wfopen_s
1551_o__wfreopen
1552_o__wfreopen_s
1553_o__wfsopen
1554_o__wfullpath
1555_o__wgetcwd
1556_o__wgetdcwd
1557_o__wgetenv
1558_o__wgetenv_s
1559_o__wmakepath
1560_o__wmakepath_s
1561_o__wmkdir
1562_o__wmktemp
1563_o__wmktemp_s
1564_o__wperror
1565_o__wpopen
1566_o__wputenv
1567_o__wputenv_s
1568_o__wremove
1569_o__wrename
1570_o__write
1571_o__wrmdir
1572_o__wsearchenv
1573_o__wsearchenv_s
1574_o__wsetlocale
1575_o__wsopen_dispatch
1576_o__wsopen_s
1577_o__wspawnv
1578_o__wspawnve
1579_o__wspawnvp
1580_o__wspawnvpe
1581_o__wsplitpath
1582_o__wsplitpath_s
1583_o__wstat32
1584_o__wstat32i64
1585_o__wstat64
1586_o__wstat64i32
1587_o__wstrdate
1588_o__wstrdate_s
1589_o__wstrtime
1590_o__wstrtime_s
1591_o__wsystem
1592_o__wtmpnam_s
1593_o__wtof
1594_o__wtof_l
1595_o__wtoi
1596_o__wtoi64
1597_o__wtoi64_l
1598_o__wtoi_l
1599_o__wtol
1600_o__wtol_l
1601_o__wtoll
1602_o__wtoll_l
1603_o__wunlink
1604_o__wutime32
1605_o__wutime64
1606_o__y0
1607_o__y1
1608_o__yn
1609_o_abort
1610_o_acos
1611F_NON_I386(_o_acosf)
1612_o_acosh
1613_o_acoshf
1614F_ARM_ANY(_o_acoshl) ; Can't use long double functions from the CRT on x86
1615_o_asctime
1616_o_asctime_s
1617_o_asin
1618F_NON_I386(_o_asinf)
1619_o_asinh
1620_o_asinhf
1621F_ARM_ANY(_o_asinhl) ; Can't use long double functions from the CRT on x86
1622_o_atan
1623_o_atan2
1624F_NON_I386(_o_atan2f)
1625F_NON_I386(_o_atanf)
1626_o_atanh
1627_o_atanhf
1628F_ARM_ANY(_o_atanhl) ; Can't use long double functions from the CRT on x86
1629_o_atof
1630_o_atoi
1631_o_atol
1632_o_atoll
1633_o_bsearch
1634_o_bsearch_s
1635_o_btowc
1636_o_calloc
1637_o_cbrt
1638_o_cbrtf
1639_o_ceil
1640F_NON_I386(_o_ceilf)
1641_o_clearerr
1642_o_clearerr_s
1643_o_cos
1644F_NON_I386(_o_cosf)
1645_o_cosh
1646F_NON_I386(_o_coshf)
1647_o_erf
1648_o_erfc
1649_o_erfcf
1650F_ARM_ANY(_o_erfcl) ; Can't use long double functions from the CRT on x86
1651_o_erff
1652F_ARM_ANY(_o_erfl) ; Can't use long double functions from the CRT on x86
1653_o_exp
1654_o_exp2
1655_o_exp2f
1656F_ARM_ANY(_o_exp2l) ; Can't use long double functions from the CRT on x86
1657F_NON_I386(_o_expf)
1658_o_fabs
1659F_ARM_ANY(_o_fabsf)
1660_o_fclose
1661_o_feof
1662_o_ferror
1663_o_fflush
1664_o_fgetc
1665_o_fgetpos
1666_o_fgets
1667_o_fgetwc
1668_o_fgetws
1669_o_floor
1670F_NON_I386(_o_floorf)
1671_o_fma
1672_o_fmaf
1673F_ARM_ANY(_o_fmal) ; Can't use long double functions from the CRT on x86
1674_o_fmod
1675F_NON_I386(_o_fmodf)
1676_o_fopen
1677_o_fopen_s
1678_o_fputc
1679_o_fputs
1680_o_fputwc
1681_o_fputws
1682_o_fread
1683_o_fread_s
1684_o_free
1685_o_freopen
1686_o_freopen_s
1687_o_frexp
1688_o_fseek
1689_o_fsetpos
1690_o_ftell
1691_o_fwrite
1692_o_getc
1693_o_getchar
1694_o_getenv
1695_o_getenv_s
1696_o_gets
1697_o_gets_s
1698_o_getwc
1699_o_getwchar
1700_o_hypot
1701_o_is_wctype
1702_o_isalnum
1703_o_isalpha
1704_o_isblank
1705_o_iscntrl
1706_o_isdigit
1707_o_isgraph
1708_o_isleadbyte
1709_o_islower
1710_o_isprint
1711_o_ispunct
1712_o_isspace
1713_o_isupper
1714_o_iswalnum
1715_o_iswalpha
1716_o_iswascii
1717_o_iswblank
1718_o_iswcntrl
1719_o_iswctype
1720_o_iswdigit
1721_o_iswgraph
1722_o_iswlower
1723_o_iswprint
1724_o_iswpunct
1725_o_iswspace
1726_o_iswupper
1727_o_iswxdigit
1728_o_isxdigit
1729_o_ldexp
1730_o_lgamma
1731_o_lgammaf
1732F_ARM_ANY(_o_lgammal) ; Can't use long double functions from the CRT on x86
1733_o_llrint
1734_o_llrintf
1735F_ARM_ANY(_o_llrintl) ; Can't use long double functions from the CRT on x86
1736_o_llround
1737_o_llroundf
1738F_ARM_ANY(_o_llroundl) ; Can't use long double functions from the CRT on x86
1739_o_localeconv
1740_o_log
1741_o_log10
1742F_NON_I386(_o_log10f)
1743_o_log1p
1744_o_log1pf
1745F_ARM_ANY(_o_log1pl) ; Can't use long double functions from the CRT on x86
1746_o_log2
1747_o_log2f
1748F_ARM_ANY(_o_log2l) ; Can't use long double functions from the CRT on x86
1749_o_logb
1750_o_logbf
1751F_ARM_ANY(_o_logbl) ; Can't use long double functions from the CRT on x86
1752F_NON_I386(_o_logf)
1753_o_lrint
1754_o_lrintf
1755F_ARM_ANY(_o_lrintl) ; Can't use long double functions from the CRT on x86
1756_o_lround
1757_o_lroundf
1758F_ARM_ANY(_o_lroundl) ; Can't use long double functions from the CRT on x86
1759_o_malloc
1760_o_mblen
1761_o_mbrlen
1762_o_mbrtoc16
1763_o_mbrtoc32
1764_o_mbrtowc
1765_o_mbsrtowcs
1766_o_mbsrtowcs_s
1767_o_mbstowcs
1768_o_mbstowcs_s
1769_o_mbtowc
1770_o_memset
1771_o_modf
1772F_NON_I386(_o_modff)
1773_o_nan
1774_o_nanf
1775F_ARM_ANY(_o_nanl) ; Can't use long double functions from the CRT on x86
1776_o_nearbyint
1777_o_nearbyintf
1778F_ARM_ANY(_o_nearbyintl) ; Can't use long double functions from the CRT on x86
1779_o_nextafter
1780_o_nextafterf
1781F_ARM_ANY(_o_nextafterl) ; Can't use long double functions from the CRT on x86
1782F_ARM_ANY(_o_nexttoward) ; Can't use long double functions from the CRT on x86
1783F_ARM_ANY(_o_nexttowardf) ; Can't use long double functions from the CRT on x86
1784F_ARM_ANY(_o_nexttowardl) ; Can't use long double functions from the CRT on x86
1785_o_pow
1786_o_powf
1787_o_putc
1788_o_putchar
1789_o_puts
1790_o_putwc
1791_o_putwchar
1792_o_qsort
1793_o_qsort_s
1794_o_raise
1795_o_rand
1796_o_rand_s
1797_o_realloc
1798_o_remainder
1799_o_remainderf
1800F_ARM_ANY(_o_remainderl) ; Can't use long double functions from the CRT on x86
1801_o_remove
1802_o_remquo
1803_o_remquof
1804F_ARM_ANY(_o_remquol) ; Can't use long double functions from the CRT on x86
1805_o_rewind
1806_o_rint
1807_o_rintf
1808F_ARM_ANY(_o_rintl) ; Can't use long double functions from the CRT on x86
1809_o_round
1810_o_roundf
1811F_ARM_ANY(_o_roundl) ; Can't use long double functions from the CRT on x86
1812_o_scalbln
1813_o_scalblnf
1814F_ARM_ANY(_o_scalblnl) ; Can't use long double functions from the CRT on x86
1815_o_scalbn
1816_o_scalbnf
1817F_ARM_ANY(_o_scalbnl) ; Can't use long double functions from the CRT on x86
1818_o_set_terminate
1819_o_setbuf
1820_o_setvbuf
1821_o_sin
1822F_NON_I386(_o_sinf)
1823_o_sinh
1824F_NON_I386(_o_sinhf)
1825_o_sqrt
1826F_NON_I386(_o_sqrtf)
1827_o_srand
1828_o_strcat_s
1829_o_strcoll
1830_o_strcpy_s
1831_o_strerror
1832_o_strerror_s
1833_o_strftime
1834_o_strncat_s
1835_o_strncpy_s
1836_o_strtod
1837_o_strtof
1838_o_strtok
1839_o_strtok_s
1840_o_strtol
1841F_ARM_ANY(_o_strtold) ; Can't use long double functions from the CRT on x86
1842_o_strtoll
1843_o_strtoul
1844_o_strtoull
1845_o_system
1846_o_tan
1847F_NON_I386(_o_tanf)
1848_o_tanh
1849F_NON_I386(_o_tanhf)
1850_o_terminate
1851_o_tgamma
1852_o_tgammaf
1853F_ARM_ANY(_o_tgammal) ; Can't use long double functions from the CRT on x86
1854_o_tmpfile_s
1855_o_tmpnam_s
1856_o_tolower
1857_o_toupper
1858_o_towlower
1859_o_towupper
1860_o_ungetc
1861_o_ungetwc
1862_o_wcrtomb
1863_o_wcrtomb_s
1864_o_wcscat_s
1865_o_wcscoll
1866_o_wcscpy
1867_o_wcscpy_s
1868_o_wcsftime
1869_o_wcsncat_s
1870_o_wcsncpy_s
1871_o_wcsrtombs
1872_o_wcsrtombs_s
1873_o_wcstod
1874_o_wcstof
1875_o_wcstok
1876_o_wcstok_s
1877_o_wcstol
1878F_ARM_ANY(_o_wcstold) ; Can't use long double functions from the CRT on x86
1879_o_wcstoll
1880_o_wcstombs
1881_o_wcstombs_s
1882_o_wcstoul
1883_o_wcstoull
1884_o_wctob
1885_o_wctomb
1886_o_wctomb_s
1887_o_wmemcpy_s
1888_o_wmemmove_s
1889_open
1890_open_osfhandle
1891_pclose
1892_pipe
1893_popen
1894_purecall
1895_putc_nolock
1896_putch
1897_putch_nolock
1898_putenv
1899_putenv_s
1900_putw
1901_putwc_nolock
1902_putwch
1903_putwch_nolock
1904_putws
1905_query_app_type
1906_query_new_handler
1907_query_new_mode
1908_read
1909_realloc_base
1910F_DEBUG(_realloc_dbg)
1911_recalloc
1912F_DEBUG(_recalloc_dbg)
1913_register_onexit_function
1914_register_thread_local_exe_atexit_callback
1915_resetstkoflw
1916_rmdir
1917_rmtmp
1918_rotl
1919_rotl64
1920_rotr
1921_rotr64
1922_scalb
1923F_X64(_scalbf)
1924_searchenv
1925_searchenv_s
1926_seh_filter_dll
1927_seh_filter_exe
1928F_X64(_set_FMA3_enable)
1929F_I386(_seh_longjmp_unwind4@4)
1930F_I386(_seh_longjmp_unwind@4)
1931F_I386(_set_SSE2_enable)
1932_set_abort_behavior
1933_set_app_type
1934_set_controlfp
1935_set_doserrno
1936_set_errno
1937_set_error_mode
1938_set_fmode
1939_set_invalid_parameter_handler
1940_set_new_handler
1941_set_new_mode
1942_set_printf_count_output
1943_set_purecall_handler
1944_set_se_translator
1945_set_thread_local_invalid_parameter_handler
1946_seterrormode
1947F_I386(_setjmp3)
1948_setmaxstdio
1949_setmbcp
1950_setmode
1951_setsystime
1952_sleep
1953_sopen
1954_sopen_dispatch
1955_sopen_s
1956_spawnl
1957_spawnle
1958_spawnlp
1959_spawnlpe
1960_spawnv
1961_spawnve
1962_spawnvp
1963_spawnvpe
1964_splitpath
1965_splitpath_s
1966_stat32
1967_stat32i64
1968_stat64
1969_stat64i32
1970_statusfp
1971F_I386(_statusfp2)
1972_strcoll_l
1973_strdate
1974_strdate_s
1975_strdup
1976F_DEBUG(_strdup_dbg)
1977_strerror
1978_strerror_s
1979_strftime_l
1980_stricmp
1981_stricmp_l
1982_stricoll
1983_stricoll_l
1984_strlwr
1985_strlwr_l
1986_strlwr_s
1987_strlwr_s_l
1988_strncoll
1989_strncoll_l
1990_strnicmp
1991_strnicmp_l
1992_strnicoll
1993_strnicoll_l
1994_strnset
1995_strnset_s
1996_strrev
1997_strset
1998_strset_s
1999_strtime
2000_strtime_s
2001_strtod_l
2002_strtof_l
2003_strtoi64
2004_strtoi64_l
2005_strtoimax_l
2006_strtol_l
2007F_ARM_ANY(_strtold_l) ; Can't use long double functions from the CRT on x86
2008_strtoll_l
2009_strtoui64
2010_strtoui64_l
2011_strtoul_l
2012_strtoull_l
2013_strtoumax_l
2014_strupr
2015_strupr_l
2016_strupr_s
2017_strupr_s_l
2018_strxfrm_l
2019_swab
2020_tell
2021_telli64
2022_tempnam
2023F_DEBUG(_tempnam_dbg)
2024_time32
2025_time64
2026_timespec32_get
2027_timespec64_get
2028_tolower
2029_tolower_l
2030_toupper
2031_toupper_l
2032_towlower_l
2033_towupper_l
2034_tzset DATA ; This is wrapped in the compat code.
2035_ui64toa
2036_ui64toa_s
2037_ui64tow
2038_ui64tow_s
2039_ultoa
2040_ultoa_s
2041_ultow
2042_ultow_s
2043_umask
2044_umask_s
2045_ungetc_nolock
2046_ungetch
2047_ungetch_nolock
2048_ungetwc_nolock
2049_ungetwch
2050_ungetwch_nolock
2051_unlink
2052_unloaddll
2053_unlock_file
2054_unlock_locales
2055_utime32
2056_utime64
2057_waccess
2058_waccess_s
2059_wasctime
2060_wasctime_s
2061_wassert
2062_wchdir
2063_wchmod
2064_wcreat
2065_wcreate_locale
2066_wcscoll_l
2067_wcsdup
2068F_DEBUG(_wcsdup_dbg)
2069_wcserror
2070_wcserror_s
2071_wcsftime_l
2072_wcsicmp
2073_wcsicmp_l
2074_wcsicoll
2075_wcsicoll_l
2076_wcslwr
2077_wcslwr_l
2078_wcslwr_s
2079_wcslwr_s_l
2080_wcsncoll
2081_wcsncoll_l
2082_wcsnicmp
2083_wcsnicmp_l
2084_wcsnicoll
2085_wcsnicoll_l
2086_wcsnset
2087_wcsnset_s
2088_wcsrev
2089_wcsset
2090_wcsset_s
2091_wcstod_l
2092_wcstof_l
2093_wcstoi64
2094_wcstoi64_l
2095_wcstoimax_l
2096_wcstol_l
2097F_ARM_ANY(_wcstold_l) ; Can't use long double functions from the CRT on x86
2098_wcstoll_l
2099_wcstombs_l
2100_wcstombs_s_l
2101_wcstoui64
2102_wcstoui64_l
2103_wcstoul_l
2104_wcstoull_l
2105_wcstoumax_l
2106_wcsupr
2107_wcsupr_l
2108_wcsupr_s
2109_wcsupr_s_l
2110_wcsxfrm_l
2111_wctime32
2112_wctime32_s
2113_wctime64
2114_wctime64_s
2115_wctomb_l
2116_wctomb_s_l
2117_wctype DATA
2118_wdupenv_s
2119F_DEBUG(_wdupenv_s_dbg)
2120_wexecl
2121_wexecle
2122_wexeclp
2123_wexeclpe
2124_wexecv
2125_wexecve
2126_wexecvp
2127_wexecvpe
2128_wfdopen
2129_wfindfirst32
2130_wfindfirst32i64
2131_wfindfirst64
2132_wfindfirst64i32
2133_wfindnext32
2134_wfindnext32i64
2135_wfindnext64
2136_wfindnext64i32
2137_wfopen
2138_wfopen_s
2139_wfreopen
2140_wfreopen_s
2141_wfsopen
2142_wfullpath
2143F_DEBUG(_wfullpath_dbg)
2144_wgetcwd
2145F_DEBUG(_wgetcwd_dbg)
2146_wgetdcwd
2147F_DEBUG(_wgetdcwd_dbg)
2148_wgetenv
2149_wgetenv_s
2150_wmakepath
2151_wmakepath_s
2152_wmkdir
2153_wmktemp
2154_wmktemp_s
2155_wopen
2156_wperror
2157_wpopen
2158_wputenv
2159_wputenv_s
2160_wremove
2161_wrename
2162_write
2163_wrmdir
2164_wsearchenv
2165_wsearchenv_s
2166_wsetlocale
2167_wsopen
2168_wsopen_dispatch
2169_wsopen_s
2170_wspawnl
2171_wspawnle
2172_wspawnlp
2173_wspawnlpe
2174_wspawnv
2175_wspawnve
2176_wspawnvp
2177_wspawnvpe
2178_wsplitpath
2179_wsplitpath_s
2180_wstat32
2181_wstat32i64
2182_wstat64
2183_wstat64i32
2184_wstrdate
2185_wstrdate_s
2186_wstrtime
2187_wstrtime_s
2188_wsystem
2189_wtempnam
2190F_DEBUG(_wtempnam_dbg)
2191_wtmpnam
2192_wtmpnam_s
2193_wtof
2194_wtof_l
2195_wtoi
2196_wtoi64
2197_wtoi64_l
2198_wtoi_l
2199_wtol
2200_wtol_l
2201_wtoll
2202_wtoll_l
2203_wunlink
2204_wutime32
2205_wutime64
2206_y0
2207_y1
2208_yn
2209abort
2210abs
2211acos
2212F_NON_I386(acosf)
2213acosh
2214acoshf
2215F_ARM_ANY(acoshl) ; Can't use long double functions from the CRT on x86
2216asctime
2217asctime_s
2218asin
2219F_NON_I386(asinf)
2220asinh
2221asinhf
2222F_ARM_ANY(asinhl) ; Can't use long double functions from the CRT on x86
2223atan
2224atan2
2225F_NON_I386(atan2f)
2226F_NON_I386(atanf)
2227atanh
2228atanhf
2229F_ARM_ANY(atanhl) ; Can't use long double functions from the CRT on x86
2230atof
2231atoi
2232atol
2233atoll
2234bsearch
2235bsearch_s
2236btowc
2237c16rtomb
2238c32rtomb
2239cabs
2240cabsf
2241F_ARM_ANY(cabsl) ; Can't use long double functions from the CRT on x86
2242cacos
2243cacosf
2244cacosh
2245cacoshf
2246F_ARM_ANY(cacoshl) ; Can't use long double functions from the CRT on x86
2247F_ARM_ANY(cacosl) ; Can't use long double functions from the CRT on x86
2248calloc
2249carg
2250cargf
2251F_ARM_ANY(cargl) ; Can't use long double functions from the CRT on x86
2252casin
2253casinf
2254casinh
2255casinhf
2256F_ARM_ANY(casinhl) ; Can't use long double functions from the CRT on x86
2257F_ARM_ANY(casinl) ; Can't use long double functions from the CRT on x86
2258catan
2259catanf
2260catanh
2261catanhf
2262F_ARM_ANY(catanhl) ; Can't use long double functions from the CRT on x86
2263F_ARM_ANY(catanl) ; Can't use long double functions from the CRT on x86
2264cbrt
2265cbrtf
2266F_ARM_ANY(cbrtl) ; Can't use long double functions from the CRT on x86
2267ccos
2268ccosf
2269ccosh
2270ccoshf
2271F_ARM_ANY(ccoshl) ; Can't use long double functions from the CRT on x86
2272F_ARM_ANY(ccosl) ; Can't use long double functions from the CRT on x86
2273ceil
2274F_NON_I386(ceilf)
2275cexp
2276cexpf
2277F_ARM_ANY(cexpl) ; Can't use long double functions from the CRT on x86
2278cimag
2279cimagf
2280F_ARM_ANY(cimagl) ; Can't use long double functions from the CRT on x86
2281clearerr
2282clearerr_s
2283clock
2284clog
2285clog10
2286clog10f
2287F_ARM_ANY(clog10l) ; Can't use long double functions from the CRT on x86
2288clogf
2289F_ARM_ANY(clogl) ; Can't use long double functions from the CRT on x86
2290conj
2291conjf
2292F_ARM_ANY(conjl) ; Can't use long double functions from the CRT on x86
2293copysign
2294copysignf
2295F_ARM_ANY(copysignl) ; Can't use long double functions from the CRT on x86
2296cos
2297F_NON_I386(cosf)
2298cosh
2299F_NON_I386(coshf)
2300cpow
2301cpowf
2302F_ARM_ANY(cpowl) ; Can't use long double functions from the CRT on x86
2303cproj
2304cprojf
2305F_ARM_ANY(cprojl) ; Can't use long double functions from the CRT on x86
2306creal
2307crealf
2308F_ARM_ANY(creall) ; Can't use long double functions from the CRT on x86
2309csin
2310csinf
2311csinh
2312csinhf
2313F_ARM_ANY(csinhl) ; Can't use long double functions from the CRT on x86
2314F_ARM_ANY(csinl) ; Can't use long double functions from the CRT on x86
2315csqrt
2316csqrtf
2317F_ARM_ANY(csqrtl) ; Can't use long double functions from the CRT on x86
2318ctan
2319ctanf
2320ctanh
2321ctanhf
2322F_ARM_ANY(ctanhl) ; Can't use long double functions from the CRT on x86
2323F_ARM_ANY(ctanl) ; Can't use long double functions from the CRT on x86
2324div
2325erf
2326erfc
2327erfcf
2328F_ARM_ANY(erfcl) ; Can't use long double functions from the CRT on x86
2329erff
2330F_ARM_ANY(erfl) ; Can't use long double functions from the CRT on x86
2331exit
2332exp
2333exp2
2334exp2f
2335F_ARM_ANY(exp2l) ; Can't use long double functions from the CRT on x86
2336F_NON_I386(expf)
2337expm1
2338expm1f
2339F_ARM_ANY(expm1l) ; Can't use long double functions from the CRT on x86
2340fabs
2341F_ARM_ANY(fabsf)
2342fclose
2343fdim
2344fdimf
2345F_ARM_ANY(fdiml) ; Can't use long double functions from the CRT on x86
2346; Don't use the float env functions from UCRT; fesetround doesn't seem to have
2347; any effect on the FPU control word as required by other libmingwex math
2348; routines.
2349feclearexcept DATA
2350fegetenv DATA
2351fegetexceptflag DATA
2352fegetround DATA
2353feholdexcept DATA
2354feof
2355ferror
2356fesetenv DATA
2357fesetexceptflag DATA
2358fesetround DATA
2359fetestexcept DATA
2360fflush
2361fgetc
2362fgetpos
2363fgets
2364fgetwc
2365fgetws
2366floor
2367F_NON_I386(floorf)
2368fma
2369fmaf
2370F_ARM_ANY(fmal) ; Can't use long double functions from the CRT on x86
2371fmax
2372fmaxf
2373F_ARM_ANY(fmaxl) ; Can't use long double functions from the CRT on x86
2374fmin
2375fminf
2376F_ARM_ANY(fminl) ; Can't use long double functions from the CRT on x86
2377fmod
2378F_NON_I386(fmodf)
2379fopen
2380fopen_s
2381fputc
2382fputs
2383fputwc
2384fputws
2385fread
2386fread_s
2387free
2388freopen
2389freopen_s
2390frexp
2391fseek
2392fsetpos
2393ftell
2394fwrite
2395getc
2396getchar
2397getenv
2398getenv_s
2399gets
2400gets_s
2401getwc
2402getwchar
2403hypot
2404ilogb
2405ilogbf
2406F_ARM_ANY(ilogbl) ; Can't use long double functions from the CRT on x86
2407imaxabs
2408imaxdiv
2409is_wctype
2410isalnum
2411isalpha
2412isblank
2413iscntrl
2414isdigit
2415isgraph
2416isleadbyte
2417islower
2418isprint
2419ispunct
2420isspace
2421isupper
2422iswalnum
2423iswalpha
2424iswascii
2425iswblank
2426iswcntrl
2427iswctype
2428iswdigit
2429iswgraph
2430iswlower
2431iswprint
2432iswpunct
2433iswspace
2434iswupper
2435iswxdigit
2436isxdigit
2437labs
2438ldexp
2439ldiv
2440; The UCRT lgamma functions don't set/provide the signgam variable like
2441; the mingw ones do. Therefore prefer the libmingwex version instead.
2442lgamma DATA
2443lgammaf DATA
2444F_ARM_ANY(lgammal DATA) ; Can't use long double functions from the CRT on x86
2445llabs
2446lldiv
2447llrint
2448llrintf
2449F_ARM_ANY(llrintl) ; Can't use long double functions from the CRT on x86
2450llround
2451llroundf
2452F_ARM_ANY(llroundl) ; Can't use long double functions from the CRT on x86
2453localeconv
2454log
2455log10
2456F_NON_I386(log10f)
2457log1p
2458log1pf
2459F_ARM_ANY(log1pl) ; Can't use long double functions from the CRT on x86
2460log2
2461log2f
2462F_ARM_ANY(log2l) ; Can't use long double functions from the CRT on x86
2463logb
2464logbf
2465F_ARM_ANY(logbl) ; Can't use long double functions from the CRT on x86
2466F_NON_I386(logf)
2467longjmp
2468lrint
2469lrintf
2470F_ARM_ANY(lrintl) ; Can't use long double functions from the CRT on x86
2471lround
2472lroundf
2473F_ARM_ANY(lroundl) ; Can't use long double functions from the CRT on x86
2474malloc
2475mblen
2476mbrlen
2477mbrtoc16
2478mbrtoc32
2479mbrtowc
2480mbsrtowcs
2481mbsrtowcs_s
2482mbstowcs
2483mbstowcs_s
2484mbtowc
2485memchr
2486memcmp
2487memcpy
2488memcpy_s
2489memmove
2490memmove_s
2491memset
2492modf
2493F_NON_I386(modff)
2494nan
2495nanf
2496F_ARM_ANY(nanl) ; Can't use long double functions from the CRT on x86
2497nearbyint
2498nearbyintf
2499F_ARM_ANY(nearbyintl) ; Can't use long double functions from the CRT on x86
2500nextafter
2501nextafterf
2502F_ARM_ANY(nextafterl) ; Can't use long double functions from the CRT on x86
2503; All of the nexttoward functions take the second parameter as long double,
2504; making them unusable for x86.
2505F_ARM_ANY(nexttoward) ; Can't use long double functions from the CRT on x86
2506F_ARM_ANY(nexttowardf) ; Can't use long double functions from the CRT on x86
2507F_ARM_ANY(nexttowardl) ; Can't use long double functions from the CRT on x86
2508norm
2509normf
2510norml
2511perror
2512pow
2513F_NON_I386(powf) ; Missing in Wine's ucrtbase.dll for i386 in Wine 9.15 and older
2514putc
2515putchar
2516puts
2517putwc
2518putwchar
2519qsort
2520qsort_s
2521quick_exit
2522raise
2523rand
2524rand_s
2525realloc
2526remainder
2527remainderf
2528F_ARM_ANY(remainderl) ; Can't use long double functions from the CRT on x86
2529remove
2530remquo
2531remquof
2532F_ARM_ANY(remquol) ; Can't use long double functions from the CRT on x86
2533rename
2534rewind
2535rint
2536rintf
2537F_ARM_ANY(rintl) ; Can't use long double functions from the CRT on x86
2538round
2539roundf
2540F_ARM_ANY(roundl) ; Can't use long double functions from the CRT on x86
2541scalbln
2542scalblnf
2543F_ARM_ANY(scalblnl) ; Can't use long double functions from the CRT on x86
2544scalbn
2545scalbnf
2546F_ARM_ANY(scalbnl) ; Can't use long double functions from the CRT on x86
2547set_terminate
2548set_unexpected
2549setbuf
2550F_X64(setjmp)
2551setlocale
2552setvbuf
2553signal
2554sin
2555F_NON_I386(sinf)
2556; if we implement sinh, we can set it DATA only.
2557sinh
2558F_NON_I386(sinhf)
2559sqrt
2560F_NON_I386(sqrtf)
2561srand
2562strcat
2563strcat_s
2564strchr
2565strcmp
2566strcoll
2567strcpy
2568strcpy_s
2569strcspn
2570strerror
2571strerror_s
2572strftime
2573strlen
2574strncat
2575strncat_s
2576strncmp
2577strncpy
2578strncpy_s
2579strnlen
2580strpbrk
2581strrchr
2582strspn
2583strstr
2584strtod
2585strtof
2586strtoimax
2587strtok
2588strtok_s
2589strtol
2590F_ARM_ANY(strtold) ; Can't use long double functions from the CRT on x86
2591strtoll
2592strtoul
2593strtoull
2594strtoumax
2595strxfrm
2596system
2597tan
2598F_NON_I386(tanf)
2599; if we implement tanh, we can set it to DATA only.
2600tanh
2601F_NON_I386(tanhf)
2602terminate
2603tgamma
2604tgammaf
2605F_ARM_ANY(tgammal) ; Can't use long double functions from the CRT on x86
2606tmpfile
2607tmpfile_s
2608tmpnam
2609tmpnam_s
2610tolower
2611toupper
2612towctrans
2613towlower
2614towupper
2615trunc
2616truncf
2617F_ARM_ANY(truncl) ; Can't use long double functions from the CRT on x86
2618unexpected
2619ungetc
2620ungetwc
2621wcrtomb
2622wcrtomb_s
2623wcscat
2624wcscat_s
2625wcschr
2626wcscmp
2627wcscoll
2628wcscpy
2629wcscpy_s
2630wcscspn
2631wcsftime
2632wcslen
2633wcsncat
2634wcsncat_s
2635wcsncmp
2636wcsncpy
2637wcsncpy_s
2638wcsnlen
2639wcspbrk
2640wcsrchr
2641wcsrtombs
2642wcsrtombs_s
2643wcsspn
2644wcsstr
2645wcstod
2646wcstof
2647wcstoimax
2648wcstok
2649wcstok_s
2650wcstol
2651F_ARM_ANY(wcstold) ; Can't use long double functions from the CRT on x86
2652wcstoll
2653wcstombs
2654wcstombs_s
2655wcstoul
2656wcstoull
2657wcstoumax
2658wcsxfrm
2659wctob
2660wctomb
2661wctomb_s
2662wctrans
2663wctype
2664wmemcpy_s
2665wmemmove_s
2666
2667; These symbols were added in some later version of ucrtbase.dll and ucrtbased.dll
2668; They were added into ucrtbase.dll version 10.0.10563.0 which is part of the Microsoft Visual C++ 2015 Redistributable version 14.0.23506.0
2669_o____lc_codepage_func
2670_o____lc_collate_cp_func
2671_o____lc_locale_name_func
2672_o____mb_cur_max_func
2673_o___std_exception_copy
2674_o___std_exception_destroy
2675_o___std_type_info_destroy_list
2676_o___std_type_info_name
2677_o__cexit
2678_o__configthreadlocale
2679_o__configure_narrow_argv
2680_o__controlfp_s
2681_o__crt_atexit
2682_o__exit
2683_o__get_initial_narrow_environment
2684_o__get_initial_wide_environment
2685_o__initialize_narrow_environment
2686_o__initialize_wide_environment
2687_o__purecall
2688_o__seh_filter_dll
2689_o__seh_filter_exe
2690_o__set_app_type
2691_o__set_fmode
2692_o_exit
2693_o_memcpy_s
2694_o_rename
2695_o_setlocale
2696
2697; All symbols below this line are not available in Windows XP version of ucrtbase.dll
2698; Also those symbols are not available in any version of ucrtbased.dll
2699
2700; These symbols were added in ucrtbase.dll version 10.0.14393.0
2701; This is part of the Windows 10 Anniversary Update (Redstone 1)
2702F_NON_DEBUG(__std_terminate)
2703F_NON_DEBUG(__uncaught_exceptions)
2704
2705; These symbols were added in ucrtbase.dll version 10.0.17134.1
2706F_NON_DEBUG(F_NON_I386(__C_specific_handler_noexcept))
2707
2708; These symbols were added in ucrtbase.dll version 10.0.19041.1
2709F_NON_DEBUG(F_X64(__CxxFrameHandler4))
lib/libc/mingw/lib-common/ucrtbase.def.in+7-2657
......@@ -2,2661 +2,11 @@ LIBRARY "ucrtbase.dll"
22EXPORTS
33
44#include "func.def.in"
5#define UCRTBASE
6#include "msvcrt-common.def.in"
75
8#ifdef DEF_I386
9_CIacos
10_CIasin
11_CIatan
12_CIatan2
13_CIcos
14_CIcosh
15_CIexp
16_CIfmod
17_CIlog
18_CIlog10
19_CIpow
20_CIsin
21_CIsinh
22_CIsqrt
23_CItan
24_CItanh
25#endif
26_Cbuild
27_Cmulcc
28_Cmulcr
29_CreateFrameInfo
30F_I386(_CxxThrowException@8)
31F_NON_I386(_CxxThrowException)
32F_I386(_EH_prolog)
33_Exit
34_FCbuild
35_FCmulcc
36_FCmulcr
37_FindAndUnlinkFrame
38_GetImageBase
39_GetThrowImageBase
40_Getdays
41_Getmonths
42_Gettnames
43_IsExceptionObjectToBeDestroyed
44_LCbuild
45_LCmulcc
46_LCmulcr
47_SetImageBase
48_SetThrowImageBase
49_NLG_Dispatch2
50_NLG_Return
51_NLG_Return2
52_SetWinRTOutOfMemoryExceptionCallback
53_Strftime
54_W_Getdays
55_W_Getmonths
56_W_Gettnames
57_Wcsftime
58__AdjustPointer
59__BuildCatchObject
60__BuildCatchObjectHelper
61F_NON_I386(__C_specific_handler)
62__CxxDetectRethrow
63__CxxExceptionFilter
64__CxxFrameHandler
65__CxxFrameHandler2
66__CxxFrameHandler3
67F_I386(__CxxLongjmpUnwind@4)
68__CxxQueryExceptionSize
69__CxxRegisterExceptionObject
70__CxxUnregisterExceptionObject
71__DestructExceptionObject
72__FrameUnwindFilter
73__GetPlatformExceptionInfo
74__NLG_Dispatch2
75__NLG_Return2
76__RTCastToVoid
77__RTDynamicCast
78__RTtypeid
79__TypeMatch
80___lc_codepage_func
81___lc_collate_cp_func
82___lc_locale_name_func
83___mb_cur_max_func
84___mb_cur_max_l_func
85__acrt_iob_func
86__conio_common_vcprintf
87__conio_common_vcprintf_p
88__conio_common_vcprintf_s
89__conio_common_vcscanf
90__conio_common_vcwprintf
91__conio_common_vcwprintf_p
92__conio_common_vcwprintf_s
93__conio_common_vcwscanf
94F_I386(__control87_2)
95__current_exception
96__current_exception_context
97__daylight
98__dcrt_get_wide_environment_from_os
99__dcrt_initial_narrow_environment
100__doserrno
101__dstbias
102__fpe_flt_rounds
103__fpecode
104__initialize_lconv_for_unsigned_char
105__lconv_init == __initialize_lconv_for_unsigned_char
106__intrinsic_abnormal_termination
107__intrinsic_setjmp
108F64(__intrinsic_setjmpex)
109__isascii
110__iscsym
111__iscsymf
112__iswcsym
113__iswcsymf
114#ifdef DEF_I386
115__libm_sse2_acos
116__libm_sse2_acosf
117__libm_sse2_asin
118__libm_sse2_asinf
119__libm_sse2_atan
120__libm_sse2_atan2
121__libm_sse2_atanf
122__libm_sse2_cos
123__libm_sse2_cosf
124__libm_sse2_exp
125__libm_sse2_expf
126__libm_sse2_log
127__libm_sse2_log10
128__libm_sse2_log10f
129__libm_sse2_logf
130__libm_sse2_pow
131__libm_sse2_powf
132__libm_sse2_sin
133__libm_sse2_sinf
134__libm_sse2_tan
135__libm_sse2_tanf
136#endif
137__p___argc
138__p___argv
139__p___wargv
140__p__acmdln
141__p__commode
142__p__environ
143__p__fmode
144__p__mbcasemap
145__p__mbctype
146__p__pgmptr
147__p__wcmdln
148__p__wenviron
149__p__wpgmptr
150__pctype_func
151__processing_throw
152__pwctype_func
153__pxcptinfoptrs
154__report_gsfailure
155__setusermatherr
156__std_exception_copy
157__std_exception_destroy
158__std_type_info_compare
159__std_type_info_destroy_list
160__std_type_info_hash
161__std_type_info_name
162__stdio_common_vfprintf
163__stdio_common_vfprintf_p
164__stdio_common_vfprintf_s
165__stdio_common_vfscanf
166__stdio_common_vfwprintf
167__stdio_common_vfwprintf_p
168__stdio_common_vfwprintf_s
169__stdio_common_vfwscanf
170__stdio_common_vsnprintf_s
171__stdio_common_vsnwprintf_s
172__stdio_common_vsprintf
173__stdio_common_vsprintf_p
174__stdio_common_vsprintf_s
175__stdio_common_vsscanf
176__stdio_common_vswprintf
177__stdio_common_vswprintf_p
178__stdio_common_vswprintf_s
179__stdio_common_vswscanf
180__strncnt
181__sys_errlist
182__sys_nerr
183__threadhandle
184__threadid
185__timezone
186__toascii
187__tzname
188__unDName
189__unDNameEx
190__uncaught_exception
191__wcserror
192__wcserror_s
193__wcsncnt
194_abs64
195_access
196_access_s
197_aligned_free
198_aligned_malloc
199_aligned_msize
200_aligned_offset_malloc
201_aligned_offset_realloc
202_aligned_offset_recalloc
203_aligned_realloc
204_aligned_recalloc
205; DATA set manually
206_assert
207_atodbl
208_atodbl_l
209_atof_l
210_atoflt
211_atoflt_l
212_atoi64
213_atoi64_l
214_atoi_l
215_atol_l
216_atoldbl
217_atoldbl_l
218_atoll_l
219_beep
220_beginthread
221_beginthreadex
222_byteswap_uint64
223_byteswap_ulong
224_byteswap_ushort
225_c_exit
226; DATA set manually
227_cabs DATA
228_callnewh
229_calloc_base
230_cexit
231_cgets
232_cgets_s
233_cgetws
234_cgetws_s
235_chdir
236_chdrive
237_chgsign
238_chgsignf
239F_I386(_chkesp)
240_chmod
241_chsize
242_chsize_s
243_clearfp
244_close
245_commit
246_configthreadlocale
247_configure_narrow_argv
248_configure_wide_argv
249_control87
250_controlfp
251_controlfp_s
252_copysign
253_copysignf
254_cputs
255_cputws
256_creat
257_create_locale
258_crt_at_quick_exit
259_crt_atexit
260_crt_debugger_hook
261_ctime32
262_ctime32_s
263_ctime64
264_ctime64_s
265_cwait
266_d_int
267_dclass
268_dexp
269_difftime32
270_difftime64
271_dlog
272_dnorm
273_dpcomp
274_dpoly
275_dscale
276_dsign
277_dsin
278_dtest
279_dunscale
280_dup
281_dup2
282_dupenv_s
283_ecvt
284_ecvt_s
285_endthread
286_endthreadex
287_eof
288_errno
289_except1
290F_I386(_except_handler2)
291F_I386(_except_handler3)
292F_I386(_except_handler4_common)
293_execl
294_execle
295_execlp
296_execlpe
297_execute_onexit_table
298_execv
299_execve
300_execvp
301_execvpe
302_exit
303_expand
304_fclose_nolock
305_fcloseall
306_fcvt
307_fcvt_s
308_fd_int
309_fdclass
310_fdexp
311_fdlog
312_fdnorm
313_fdopen
314_fdpcomp
315_fdpoly
316_fdscale
317_fdsign
318_fdsin
319_fdtest
320_fdunscale
321_fflush_nolock
322_fgetc_nolock
323_fgetchar
324_fgetwc_nolock
325_fgetwchar
326_filelength
327_filelengthi64
328_fileno
329_findclose
330_findfirst == _findfirst64
331_findfirst32
332_findfirst32i64
333_findfirst64
334_findfirst64i32
335_findnext == _findnext64
336_findnext32
337_findnext32i64
338_findnext64
339_findnext64i32
340_finite
341F_NON_I386(_finitef)
342_flushall
343_fpclass
344_fpclassf
345F_NON_I386(_fpieee_flt)
346; DATA added manually
347_fpreset DATA
348_fputc_nolock
349_fputchar
350_fputwc_nolock
351_fputwchar
352_fread_nolock
353_fread_nolock_s
354_free_base
355_free_locale
356_fseek_nolock
357_fseeki64
358_fseeki64_nolock
359_fsopen
360_fstat32
361_fstat32i64
362_fstat64
363_fstat64i32
364_ftell_nolock
365_ftelli64
366_ftelli64_nolock
367_ftime == _ftime64
368_ftime32
369_ftime32_s
370_ftime64
371_ftime64_s
372F_I386(_ftol)
373_fullpath
374_futime == _futime64
375_futime32
376_futime64
377_fwrite_nolock
378_gcvt
379_gcvt_s
380_get_FMA3_enable
381_get_current_locale
382_get_daylight
383_get_doserrno
384_get_dstbias
385_get_errno
386_get_fmode
387_get_heap_handle
388_get_initial_narrow_environment
389_get_initial_wide_environment
390_get_invalid_parameter_handler
391_get_narrow_winmain_command_line
392_get_osfhandle
393_get_pgmptr
394_get_printf_count_output
395_get_purecall_handler
396_get_stream_buffer_pointers
397_get_terminate
398_get_thread_local_invalid_parameter_handler
399_get_timezone
400_get_tzname
401_get_unexpected
402_get_wide_winmain_command_line
403_get_wpgmptr
404_getc_nolock
405_getch
406_getch_nolock
407_getche
408_getche_nolock
409_getcwd
410_getdcwd
411_getdiskfree
412_getdllprocaddr
413_getdrive
414_getdrives
415_getmaxstdio
416_getmbcp
417_getpid
418_getsystime
419_getw
420_getwc_nolock
421_getwch
422_getwch_nolock
423_getwche
424_getwche_nolock
425_getws
426_getws_s
427F_I386(_global_unwind2)
428_gmtime32
429_gmtime32_s
430_gmtime64
431_gmtime64_s
432_heapchk
433_heapmin
434_heapwalk
435_hypot
436_hypotf
437_i64toa
438_i64toa_s
439_i64tow
440_i64tow_s
441_initialize_narrow_environment
442_initialize_onexit_table
443_initialize_wide_environment
444_initterm
445_initterm_e
446_invalid_parameter_noinfo
447_invalid_parameter_noinfo_noreturn
448_invoke_watson
449_is_exception_typeof
450_isalnum_l
451_isalpha_l
452_isatty
453_isblank_l
454_iscntrl_l
455_isctype
456_isctype_l
457_isdigit_l
458_isgraph_l
459_isleadbyte_l
460_islower_l
461_ismbbalnum
462_ismbbalnum_l
463_ismbbalpha
464_ismbbalpha_l
465_ismbbblank
466_ismbbblank_l
467_ismbbgraph
468_ismbbgraph_l
469_ismbbkalnum
470_ismbbkalnum_l
471_ismbbkana
472_ismbbkana_l
473_ismbbkprint
474_ismbbkprint_l
475_ismbbkpunct
476_ismbbkpunct_l
477_ismbblead
478_ismbblead_l
479_ismbbprint
480_ismbbprint_l
481_ismbbpunct
482_ismbbpunct_l
483_ismbbtrail
484_ismbbtrail_l
485_ismbcalnum
486_ismbcalnum_l
487_ismbcalpha
488_ismbcalpha_l
489_ismbcblank
490_ismbcblank_l
491_ismbcdigit
492_ismbcdigit_l
493_ismbcgraph
494_ismbcgraph_l
495_ismbchira
496_ismbchira_l
497_ismbckata
498_ismbckata_l
499_ismbcl0
500_ismbcl0_l
501_ismbcl1
502_ismbcl1_l
503_ismbcl2
504_ismbcl2_l
505_ismbclegal
506_ismbclegal_l
507_ismbclower
508_ismbclower_l
509_ismbcprint
510_ismbcprint_l
511_ismbcpunct
512_ismbcpunct_l
513_ismbcspace
514_ismbcspace_l
515_ismbcsymbol
516_ismbcsymbol_l
517_ismbcupper
518_ismbcupper_l
519_ismbslead
520_ismbslead_l
521_ismbstrail
522_ismbstrail_l
523_isnan
524F_X64(_isnanf)
525_isprint_l
526_ispunct_l
527_isspace_l
528_isupper_l
529_iswalnum_l
530_iswalpha_l
531_iswblank_l
532_iswcntrl_l
533_iswcsym_l
534_iswcsymf_l
535_iswctype_l
536_iswdigit_l
537_iswgraph_l
538_iswlower_l
539_iswprint_l
540_iswpunct_l
541_iswspace_l
542_iswupper_l
543_iswxdigit_l
544_isxdigit_l
545_itoa
546_itoa_s
547_itow
548_itow_s
549_j0
550_j1
551_jn
552_kbhit
553_ld_int
554_ldclass
555_ldexp
556_ldlog
557_ldpcomp
558_ldpoly
559_ldscale
560_ldsign
561_ldsin
562_ldtest
563_ldunscale
564_lfind
565_lfind_s
566#ifdef DEF_I386
567_libm_sse2_acos_precise
568_libm_sse2_asin_precise
569_libm_sse2_atan_precise
570_libm_sse2_cos_precise
571_libm_sse2_exp_precise
572_libm_sse2_log10_precise
573_libm_sse2_log_precise
574_libm_sse2_pow_precise
575_libm_sse2_sin_precise
576_libm_sse2_sqrt_precise
577_libm_sse2_tan_precise
578#endif
579_loaddll
580F_X64(_local_unwind)
581F_I386(_local_unwind2)
582F_I386(_local_unwind4)
583_localtime32
584_localtime32_s
585_localtime64
586_localtime64_s
587_lock_file
588_lock_locales
589_locking
590_logb
591F_NON_I386(_logbf)
592F_I386(_longjmpex)
593_lrotl
594_lrotr
595_lsearch
596_lsearch_s
597_lseek
598_lseeki64
599_ltoa
600_ltoa_s
601_ltow
602_ltow_s
603_makepath
604_makepath_s
605_malloc_base
606_mbbtombc
607_mbbtombc_l
608_mbbtype
609_mbbtype_l
610; DATA added manually
611_mbcasemap DATA
612_mbccpy
613_mbccpy_l
614_mbccpy_s
615_mbccpy_s_l
616_mbcjistojms
617_mbcjistojms_l
618_mbcjmstojis
619_mbcjmstojis_l
620_mbclen
621_mbclen_l
622_mbctohira
623_mbctohira_l
624_mbctokata
625_mbctokata_l
626_mbctolower
627_mbctolower_l
628_mbctombb
629_mbctombb_l
630_mbctoupper
631_mbctoupper_l
632_mblen_l
633_mbsbtype
634_mbsbtype_l
635_mbscat_s
636_mbscat_s_l
637_mbschr
638_mbschr_l
639_mbscmp
640_mbscmp_l
641_mbscoll
642_mbscoll_l
643_mbscpy_s
644_mbscpy_s_l
645_mbscspn
646_mbscspn_l
647_mbsdec
648_mbsdec_l
649_mbsdup
650_mbsicmp
651_mbsicmp_l
652_mbsicoll
653_mbsicoll_l
654_mbsinc
655_mbsinc_l
656_mbslen
657_mbslen_l
658_mbslwr
659_mbslwr_l
660_mbslwr_s
661_mbslwr_s_l
662_mbsnbcat
663_mbsnbcat_l
664_mbsnbcat_s
665_mbsnbcat_s_l
666_mbsnbcmp
667_mbsnbcmp_l
668_mbsnbcnt
669_mbsnbcnt_l
670_mbsnbcoll
671_mbsnbcoll_l
672_mbsnbcpy
673_mbsnbcpy_l
674_mbsnbcpy_s
675_mbsnbcpy_s_l
676_mbsnbicmp
677_mbsnbicmp_l
678_mbsnbicoll
679_mbsnbicoll_l
680_mbsnbset
681_mbsnbset_l
682_mbsnbset_s
683_mbsnbset_s_l
684_mbsncat
685_mbsncat_l
686_mbsncat_s
687_mbsncat_s_l
688_mbsnccnt
689_mbsnccnt_l
690_mbsncmp
691_mbsncmp_l
692_mbsncoll
693_mbsncoll_l
694_mbsncpy
695_mbsncpy_l
696_mbsncpy_s
697_mbsncpy_s_l
698_mbsnextc
699_mbsnextc_l
700_mbsnicmp
701_mbsnicmp_l
702_mbsnicoll
703_mbsnicoll_l
704_mbsninc
705_mbsninc_l
706_mbsnlen
707_mbsnlen_l
708_mbsnset
709_mbsnset_l
710_mbsnset_s
711_mbsnset_s_l
712_mbspbrk
713_mbspbrk_l
714_mbsrchr
715_mbsrchr_l
716_mbsrev
717_mbsrev_l
718_mbsset
719_mbsset_l
720_mbsset_s
721_mbsset_s_l
722_mbsspn
723_mbsspn_l
724_mbsspnp
725_mbsspnp_l
726_mbsstr
727_mbsstr_l
728_mbstok
729_mbstok_l
730_mbstok_s
731_mbstok_s_l
732_mbstowcs_l
733_mbstowcs_s_l
734_mbstrlen
735_mbstrlen_l
736_mbstrnlen
737_mbstrnlen_l
738_mbsupr
739_mbsupr_l
740_mbsupr_s
741_mbsupr_s_l
742_mbtowc_l
743_memccpy
744_memicmp
745_memicmp_l
746_mkdir
747_mkgmtime32
748_mkgmtime64
749_mktemp
750_mktemp_s
751_mktime32
752_mktime64
753_msize
754_nextafter
755F_X64(_nextafterf)
756_o__CIacos
757_o__CIasin
758_o__CIatan
759_o__CIatan2
760_o__CIcos
761_o__CIcosh
762_o__CIexp
763_o__CIfmod
764_o__CIlog
765_o__CIlog10
766_o__CIpow
767_o__CIsin
768_o__CIsinh
769_o__CIsqrt
770_o__CItan
771_o__CItanh
772_o__Getdays
773_o__Getmonths
774_o__Gettnames
775_o__Strftime
776_o__W_Getdays
777_o__W_Getmonths
778_o__W_Gettnames
779_o__Wcsftime
780_o____lc_codepage_func
781_o____lc_collate_cp_func
782_o____lc_locale_name_func
783_o____mb_cur_max_func
784_o___acrt_iob_func
785_o___conio_common_vcprintf
786_o___conio_common_vcprintf_p
787_o___conio_common_vcprintf_s
788_o___conio_common_vcscanf
789_o___conio_common_vcwprintf
790_o___conio_common_vcwprintf_p
791_o___conio_common_vcwprintf_s
792_o___conio_common_vcwscanf
793_o___daylight
794_o___dstbias
795_o___fpe_flt_rounds
796_o___libm_sse2_acos
797_o___libm_sse2_acosf
798_o___libm_sse2_asin
799_o___libm_sse2_asinf
800_o___libm_sse2_atan
801_o___libm_sse2_atan2
802_o___libm_sse2_atanf
803_o___libm_sse2_cos
804_o___libm_sse2_cosf
805_o___libm_sse2_exp
806_o___libm_sse2_expf
807_o___libm_sse2_log
808_o___libm_sse2_log10
809_o___libm_sse2_log10f
810_o___libm_sse2_logf
811_o___libm_sse2_pow
812_o___libm_sse2_powf
813_o___libm_sse2_sin
814_o___libm_sse2_sinf
815_o___libm_sse2_tan
816_o___libm_sse2_tanf
817_o___p___argc
818_o___p___argv
819_o___p___wargv
820_o___p__acmdln
821_o___p__commode
822_o___p__environ
823_o___p__fmode
824_o___p__mbcasemap
825_o___p__mbctype
826_o___p__pgmptr
827_o___p__wcmdln
828_o___p__wenviron
829_o___p__wpgmptr
830_o___pctype_func
831_o___pwctype_func
832_o___std_exception_copy
833_o___std_exception_destroy
834_o___std_type_info_destroy_list
835_o___std_type_info_name
836_o___stdio_common_vfprintf
837_o___stdio_common_vfprintf_p
838_o___stdio_common_vfprintf_s
839_o___stdio_common_vfscanf
840_o___stdio_common_vfwprintf
841_o___stdio_common_vfwprintf_p
842_o___stdio_common_vfwprintf_s
843_o___stdio_common_vfwscanf
844_o___stdio_common_vsnprintf_s
845_o___stdio_common_vsnwprintf_s
846_o___stdio_common_vsprintf
847_o___stdio_common_vsprintf_p
848_o___stdio_common_vsprintf_s
849_o___stdio_common_vsscanf
850_o___stdio_common_vswprintf
851_o___stdio_common_vswprintf_p
852_o___stdio_common_vswprintf_s
853_o___stdio_common_vswscanf
854_o___timezone
855_o___tzname
856_o___wcserror
857_o__access
858_o__access_s
859_o__aligned_free
860_o__aligned_malloc
861_o__aligned_msize
862_o__aligned_offset_malloc
863_o__aligned_offset_realloc
864_o__aligned_offset_recalloc
865_o__aligned_realloc
866_o__aligned_recalloc
867_o__atodbl
868_o__atodbl_l
869_o__atof_l
870_o__atoflt
871_o__atoflt_l
872_o__atoi64
873_o__atoi64_l
874_o__atoi_l
875_o__atol_l
876_o__atoldbl
877_o__atoldbl_l
878_o__atoll_l
879_o__beep
880_o__beginthread
881_o__beginthreadex
882_o__cabs
883_o__callnewh
884_o__calloc_base
885_o__cexit
886_o__cgets
887_o__cgets_s
888_o__cgetws
889_o__cgetws_s
890_o__chdir
891_o__chdrive
892_o__chmod
893_o__chsize
894_o__chsize_s
895_o__close
896_o__commit
897_o__configthreadlocale
898_o__configure_narrow_argv
899_o__configure_wide_argv
900_o__controlfp_s
901_o__cputs
902_o__cputws
903_o__creat
904_o__create_locale
905_o__crt_atexit
906_o__ctime32_s
907_o__ctime64_s
908_o__cwait
909_o__d_int
910_o__dclass
911_o__difftime32
912_o__difftime64
913_o__dlog
914_o__dnorm
915_o__dpcomp
916_o__dpoly
917_o__dscale
918_o__dsign
919_o__dsin
920_o__dtest
921_o__dunscale
922_o__dup
923_o__dup2
924_o__dupenv_s
925_o__ecvt
926_o__ecvt_s
927_o__endthread
928_o__endthreadex
929_o__eof
930_o__errno
931_o__except1
932_o__execute_onexit_table
933_o__execv
934_o__execve
935_o__execvp
936_o__execvpe
937_o__exit
938_o__expand
939_o__fclose_nolock
940_o__fcloseall
941_o__fcvt
942_o__fcvt_s
943_o__fd_int
944_o__fdclass
945_o__fdexp
946_o__fdlog
947_o__fdopen
948_o__fdpcomp
949_o__fdpoly
950_o__fdscale
951_o__fdsign
952_o__fdsin
953_o__fflush_nolock
954_o__fgetc_nolock
955_o__fgetchar
956_o__fgetwc_nolock
957_o__fgetwchar
958_o__filelength
959_o__filelengthi64
960_o__fileno
961_o__findclose
962_o__findfirst32
963_o__findfirst32i64
964_o__findfirst64
965_o__findfirst64i32
966_o__findnext32
967_o__findnext32i64
968_o__findnext64
969_o__findnext64i32
970_o__flushall
971_o__fpclass
972_o__fpclassf
973_o__fputc_nolock
974_o__fputchar
975_o__fputwc_nolock
976_o__fputwchar
977_o__fread_nolock
978_o__fread_nolock_s
979_o__free_base
980_o__free_locale
981_o__fseek_nolock
982_o__fseeki64
983_o__fseeki64_nolock
984_o__fsopen
985_o__fstat32
986_o__fstat32i64
987_o__fstat64
988_o__fstat64i32
989_o__ftell_nolock
990_o__ftelli64
991_o__ftelli64_nolock
992_o__ftime32
993_o__ftime32_s
994_o__ftime64
995_o__ftime64_s
996_o__fullpath
997_o__futime32
998_o__futime64
999_o__fwrite_nolock
1000_o__gcvt
1001_o__gcvt_s
1002_o__get_daylight
1003_o__get_doserrno
1004_o__get_dstbias
1005_o__get_errno
1006_o__get_fmode
1007_o__get_heap_handle
1008_o__get_initial_narrow_environment
1009_o__get_initial_wide_environment
1010_o__get_invalid_parameter_handler
1011_o__get_narrow_winmain_command_line
1012_o__get_osfhandle
1013_o__get_pgmptr
1014_o__get_stream_buffer_pointers
1015_o__get_terminate
1016_o__get_thread_local_invalid_parameter_handler
1017_o__get_timezone
1018_o__get_tzname
1019_o__get_wide_winmain_command_line
1020_o__get_wpgmptr
1021_o__getc_nolock
1022_o__getch
1023_o__getch_nolock
1024_o__getche
1025_o__getche_nolock
1026_o__getcwd
1027_o__getdcwd
1028_o__getdiskfree
1029_o__getdllprocaddr
1030_o__getdrive
1031_o__getdrives
1032_o__getmbcp
1033_o__getsystime
1034_o__getw
1035_o__getwc_nolock
1036_o__getwch
1037_o__getwch_nolock
1038_o__getwche
1039_o__getwche_nolock
1040_o__getws
1041_o__getws_s
1042_o__gmtime32
1043_o__gmtime32_s
1044_o__gmtime64
1045_o__gmtime64_s
1046_o__heapchk
1047_o__heapmin
1048_o__hypot
1049_o__hypotf
1050_o__i64toa
1051_o__i64toa_s
1052_o__i64tow
1053_o__i64tow_s
1054_o__initialize_narrow_environment
1055_o__initialize_onexit_table
1056_o__initialize_wide_environment
1057_o__invalid_parameter_noinfo
1058_o__invalid_parameter_noinfo_noreturn
1059_o__isatty
1060_o__isctype
1061_o__isctype_l
1062_o__isleadbyte_l
1063_o__ismbbalnum
1064_o__ismbbalnum_l
1065_o__ismbbalpha
1066_o__ismbbalpha_l
1067_o__ismbbblank
1068_o__ismbbblank_l
1069_o__ismbbgraph
1070_o__ismbbgraph_l
1071_o__ismbbkalnum
1072_o__ismbbkalnum_l
1073_o__ismbbkana
1074_o__ismbbkana_l
1075_o__ismbbkprint
1076_o__ismbbkprint_l
1077_o__ismbbkpunct
1078_o__ismbbkpunct_l
1079_o__ismbblead
1080_o__ismbblead_l
1081_o__ismbbprint
1082_o__ismbbprint_l
1083_o__ismbbpunct
1084_o__ismbbpunct_l
1085_o__ismbbtrail
1086_o__ismbbtrail_l
1087_o__ismbcalnum
1088_o__ismbcalnum_l
1089_o__ismbcalpha
1090_o__ismbcalpha_l
1091_o__ismbcblank
1092_o__ismbcblank_l
1093_o__ismbcdigit
1094_o__ismbcdigit_l
1095_o__ismbcgraph
1096_o__ismbcgraph_l
1097_o__ismbchira
1098_o__ismbchira_l
1099_o__ismbckata
1100_o__ismbckata_l
1101_o__ismbcl0
1102_o__ismbcl0_l
1103_o__ismbcl1
1104_o__ismbcl1_l
1105_o__ismbcl2
1106_o__ismbcl2_l
1107_o__ismbclegal
1108_o__ismbclegal_l
1109_o__ismbclower
1110_o__ismbclower_l
1111_o__ismbcprint
1112_o__ismbcprint_l
1113_o__ismbcpunct
1114_o__ismbcpunct_l
1115_o__ismbcspace
1116_o__ismbcspace_l
1117_o__ismbcsymbol
1118_o__ismbcsymbol_l
1119_o__ismbcupper
1120_o__ismbcupper_l
1121_o__ismbslead
1122_o__ismbslead_l
1123_o__ismbstrail
1124_o__ismbstrail_l
1125_o__iswctype_l
1126_o__itoa
1127_o__itoa_s
1128_o__itow
1129_o__itow_s
1130_o__j0
1131_o__j1
1132_o__jn
1133_o__kbhit
1134_o__ld_int
1135_o__ldclass
1136_o__ldexp
1137_o__ldlog
1138_o__ldpcomp
1139_o__ldpoly
1140_o__ldscale
1141_o__ldsign
1142_o__ldsin
1143_o__ldtest
1144_o__ldunscale
1145_o__lfind
1146_o__lfind_s
1147_o__libm_sse2_acos_precise
1148_o__libm_sse2_asin_precise
1149_o__libm_sse2_atan_precise
1150_o__libm_sse2_cos_precise
1151_o__libm_sse2_exp_precise
1152_o__libm_sse2_log10_precise
1153_o__libm_sse2_log_precise
1154_o__libm_sse2_pow_precise
1155_o__libm_sse2_sin_precise
1156_o__libm_sse2_sqrt_precise
1157_o__libm_sse2_tan_precise
1158_o__loaddll
1159_o__localtime32
1160_o__localtime32_s
1161_o__localtime64
1162_o__localtime64_s
1163_o__lock_file
1164_o__locking
1165_o__logb
1166_o__logbf
1167_o__lsearch
1168_o__lsearch_s
1169_o__lseek
1170_o__lseeki64
1171_o__ltoa
1172_o__ltoa_s
1173_o__ltow
1174_o__ltow_s
1175_o__makepath
1176_o__makepath_s
1177_o__malloc_base
1178_o__mbbtombc
1179_o__mbbtombc_l
1180_o__mbbtype
1181_o__mbbtype_l
1182_o__mbccpy
1183_o__mbccpy_l
1184_o__mbccpy_s
1185_o__mbccpy_s_l
1186_o__mbcjistojms
1187_o__mbcjistojms_l
1188_o__mbcjmstojis
1189_o__mbcjmstojis_l
1190_o__mbclen
1191_o__mbclen_l
1192_o__mbctohira
1193_o__mbctohira_l
1194_o__mbctokata
1195_o__mbctokata_l
1196_o__mbctolower
1197_o__mbctolower_l
1198_o__mbctombb
1199_o__mbctombb_l
1200_o__mbctoupper
1201_o__mbctoupper_l
1202_o__mblen_l
1203_o__mbsbtype
1204_o__mbsbtype_l
1205_o__mbscat_s
1206_o__mbscat_s_l
1207_o__mbschr
1208_o__mbschr_l
1209_o__mbscmp
1210_o__mbscmp_l
1211_o__mbscoll
1212_o__mbscoll_l
1213_o__mbscpy_s
1214_o__mbscpy_s_l
1215_o__mbscspn
1216_o__mbscspn_l
1217_o__mbsdec
1218_o__mbsdec_l
1219_o__mbsicmp
1220_o__mbsicmp_l
1221_o__mbsicoll
1222_o__mbsicoll_l
1223_o__mbsinc
1224_o__mbsinc_l
1225_o__mbslen
1226_o__mbslen_l
1227_o__mbslwr
1228_o__mbslwr_l
1229_o__mbslwr_s
1230_o__mbslwr_s_l
1231_o__mbsnbcat
1232_o__mbsnbcat_l
1233_o__mbsnbcat_s
1234_o__mbsnbcat_s_l
1235_o__mbsnbcmp
1236_o__mbsnbcmp_l
1237_o__mbsnbcnt
1238_o__mbsnbcnt_l
1239_o__mbsnbcoll
1240_o__mbsnbcoll_l
1241_o__mbsnbcpy
1242_o__mbsnbcpy_l
1243_o__mbsnbcpy_s
1244_o__mbsnbcpy_s_l
1245_o__mbsnbicmp
1246_o__mbsnbicmp_l
1247_o__mbsnbicoll
1248_o__mbsnbicoll_l
1249_o__mbsnbset
1250_o__mbsnbset_l
1251_o__mbsnbset_s
1252_o__mbsnbset_s_l
1253_o__mbsncat
1254_o__mbsncat_l
1255_o__mbsncat_s
1256_o__mbsncat_s_l
1257_o__mbsnccnt
1258_o__mbsnccnt_l
1259_o__mbsncmp
1260_o__mbsncmp_l
1261_o__mbsncoll
1262_o__mbsncoll_l
1263_o__mbsncpy
1264_o__mbsncpy_l
1265_o__mbsncpy_s
1266_o__mbsncpy_s_l
1267_o__mbsnextc
1268_o__mbsnextc_l
1269_o__mbsnicmp
1270_o__mbsnicmp_l
1271_o__mbsnicoll
1272_o__mbsnicoll_l
1273_o__mbsninc
1274_o__mbsninc_l
1275_o__mbsnlen
1276_o__mbsnlen_l
1277_o__mbsnset
1278_o__mbsnset_l
1279_o__mbsnset_s
1280_o__mbsnset_s_l
1281_o__mbspbrk
1282_o__mbspbrk_l
1283_o__mbsrchr
1284_o__mbsrchr_l
1285_o__mbsrev
1286_o__mbsrev_l
1287_o__mbsset
1288_o__mbsset_l
1289_o__mbsset_s
1290_o__mbsset_s_l
1291_o__mbsspn
1292_o__mbsspn_l
1293_o__mbsspnp
1294_o__mbsspnp_l
1295_o__mbsstr
1296_o__mbsstr_l
1297_o__mbstok
1298_o__mbstok_l
1299_o__mbstok_s
1300_o__mbstok_s_l
1301_o__mbstowcs_l
1302_o__mbstowcs_s_l
1303_o__mbstrlen
1304_o__mbstrlen_l
1305_o__mbstrnlen
1306_o__mbstrnlen_l
1307_o__mbsupr
1308_o__mbsupr_l
1309_o__mbsupr_s
1310_o__mbsupr_s_l
1311_o__mbtowc_l
1312_o__memicmp
1313_o__memicmp_l
1314_o__mkdir
1315_o__mkgmtime32
1316_o__mkgmtime64
1317_o__mktemp
1318_o__mktemp_s
1319_o__mktime32
1320_o__mktime64
1321_o__msize
1322_o__nextafter
1323_o__nextafterf
1324_o__open_osfhandle
1325_o__pclose
1326_o__pipe
1327_o__popen
1328_o__purecall
1329_o__putc_nolock
1330_o__putch
1331_o__putch_nolock
1332_o__putenv
1333_o__putenv_s
1334_o__putw
1335_o__putwc_nolock
1336_o__putwch
1337_o__putwch_nolock
1338_o__putws
1339_o__read
1340_o__realloc_base
1341_o__recalloc
1342_o__register_onexit_function
1343_o__resetstkoflw
1344_o__rmdir
1345_o__rmtmp
1346_o__scalb
1347_o__scalbf
1348_o__searchenv
1349_o__searchenv_s
1350_o__seh_filter_dll
1351_o__seh_filter_exe
1352_o__set_abort_behavior
1353_o__set_app_type
1354_o__set_doserrno
1355_o__set_errno
1356_o__set_fmode
1357_o__set_invalid_parameter_handler
1358_o__set_new_handler
1359_o__set_new_mode
1360_o__set_thread_local_invalid_parameter_handler
1361_o__seterrormode
1362_o__setmbcp
1363_o__setmode
1364_o__setsystime
1365_o__sleep
1366_o__sopen
1367_o__sopen_dispatch
1368_o__sopen_s
1369_o__spawnv
1370_o__spawnve
1371_o__spawnvp
1372_o__spawnvpe
1373_o__splitpath
1374_o__splitpath_s
1375_o__stat32
1376_o__stat32i64
1377_o__stat64
1378_o__stat64i32
1379_o__strcoll_l
1380_o__strdate
1381_o__strdate_s
1382_o__strdup
1383_o__strerror
1384_o__strerror_s
1385_o__strftime_l
1386_o__stricmp
1387_o__stricmp_l
1388_o__stricoll
1389_o__stricoll_l
1390_o__strlwr
1391_o__strlwr_l
1392_o__strlwr_s
1393_o__strlwr_s_l
1394_o__strncoll
1395_o__strncoll_l
1396_o__strnicmp
1397_o__strnicmp_l
1398_o__strnicoll
1399_o__strnicoll_l
1400_o__strnset_s
1401_o__strset_s
1402_o__strtime
1403_o__strtime_s
1404_o__strtod_l
1405_o__strtof_l
1406_o__strtoi64
1407_o__strtoi64_l
1408_o__strtol_l
1409_o__strtold_l
1410_o__strtoll_l
1411_o__strtoui64
1412_o__strtoui64_l
1413_o__strtoul_l
1414_o__strtoull_l
1415_o__strupr
1416_o__strupr_l
1417_o__strupr_s
1418_o__strupr_s_l
1419_o__strxfrm_l
1420_o__swab
1421_o__tell
1422_o__telli64
1423_o__timespec32_get
1424_o__timespec64_get
1425_o__tolower
1426_o__tolower_l
1427_o__toupper
1428_o__toupper_l
1429_o__towlower_l
1430_o__towupper_l
1431_o__tzset
1432_o__ui64toa
1433_o__ui64toa_s
1434_o__ui64tow
1435_o__ui64tow_s
1436_o__ultoa
1437_o__ultoa_s
1438_o__ultow
1439_o__ultow_s
1440_o__umask
1441_o__umask_s
1442_o__ungetc_nolock
1443_o__ungetch
1444_o__ungetch_nolock
1445_o__ungetwc_nolock
1446_o__ungetwch
1447_o__ungetwch_nolock
1448_o__unlink
1449_o__unloaddll
1450_o__unlock_file
1451_o__utime32
1452_o__utime64
1453_o__waccess
1454_o__waccess_s
1455_o__wasctime
1456_o__wasctime_s
1457_o__wchdir
1458_o__wchmod
1459_o__wcreat
1460_o__wcreate_locale
1461_o__wcscoll_l
1462_o__wcsdup
1463_o__wcserror
1464_o__wcserror_s
1465_o__wcsftime_l
1466_o__wcsicmp
1467_o__wcsicmp_l
1468_o__wcsicoll
1469_o__wcsicoll_l
1470_o__wcslwr
1471_o__wcslwr_l
1472_o__wcslwr_s
1473_o__wcslwr_s_l
1474_o__wcsncoll
1475_o__wcsncoll_l
1476_o__wcsnicmp
1477_o__wcsnicmp_l
1478_o__wcsnicoll
1479_o__wcsnicoll_l
1480_o__wcsnset
1481_o__wcsnset_s
1482_o__wcsset
1483_o__wcsset_s
1484_o__wcstod_l
1485_o__wcstof_l
1486_o__wcstoi64
1487_o__wcstoi64_l
1488_o__wcstol_l
1489_o__wcstold_l
1490_o__wcstoll_l
1491_o__wcstombs_l
1492_o__wcstombs_s_l
1493_o__wcstoui64
1494_o__wcstoui64_l
1495_o__wcstoul_l
1496_o__wcstoull_l
1497_o__wcsupr
1498_o__wcsupr_l
1499_o__wcsupr_s
1500_o__wcsupr_s_l
1501_o__wcsxfrm_l
1502_o__wctime32
1503_o__wctime32_s
1504_o__wctime64
1505_o__wctime64_s
1506_o__wctomb_l
1507_o__wctomb_s_l
1508_o__wdupenv_s
1509_o__wexecv
1510_o__wexecve
1511_o__wexecvp
1512_o__wexecvpe
1513_o__wfdopen
1514_o__wfindfirst32
1515_o__wfindfirst32i64
1516_o__wfindfirst64
1517_o__wfindfirst64i32
1518_o__wfindnext32
1519_o__wfindnext32i64
1520_o__wfindnext64
1521_o__wfindnext64i32
1522_o__wfopen
1523_o__wfopen_s
1524_o__wfreopen
1525_o__wfreopen_s
1526_o__wfsopen
1527_o__wfullpath
1528_o__wgetcwd
1529_o__wgetdcwd
1530_o__wgetenv
1531_o__wgetenv_s
1532_o__wmakepath
1533_o__wmakepath_s
1534_o__wmkdir
1535_o__wmktemp
1536_o__wmktemp_s
1537_o__wperror
1538_o__wpopen
1539_o__wputenv
1540_o__wputenv_s
1541_o__wremove
1542_o__wrename
1543_o__write
1544_o__wrmdir
1545_o__wsearchenv
1546_o__wsearchenv_s
1547_o__wsetlocale
1548_o__wsopen_dispatch
1549_o__wsopen_s
1550_o__wspawnv
1551_o__wspawnve
1552_o__wspawnvp
1553_o__wspawnvpe
1554_o__wsplitpath
1555_o__wsplitpath_s
1556_o__wstat32
1557_o__wstat32i64
1558_o__wstat64
1559_o__wstat64i32
1560_o__wstrdate
1561_o__wstrdate_s
1562_o__wstrtime
1563_o__wstrtime_s
1564_o__wsystem
1565_o__wtmpnam_s
1566_o__wtof
1567_o__wtof_l
1568_o__wtoi
1569_o__wtoi64
1570_o__wtoi64_l
1571_o__wtoi_l
1572_o__wtol
1573_o__wtol_l
1574_o__wtoll
1575_o__wtoll_l
1576_o__wunlink
1577_o__wutime32
1578_o__wutime64
1579_o__y0
1580_o__y1
1581_o__yn
1582_o_abort
1583_o_acos
1584_o_acosf
1585_o_acosh
1586_o_acoshf
1587_o_acoshl
1588_o_asctime
1589_o_asctime_s
1590_o_asin
1591_o_asinf
1592_o_asinh
1593_o_asinhf
1594_o_asinhl
1595_o_atan
1596_o_atan2
1597_o_atan2f
1598_o_atanf
1599_o_atanh
1600_o_atanhf
1601_o_atanhl
1602_o_atof
1603_o_atoi
1604_o_atol
1605_o_atoll
1606_o_bsearch
1607_o_bsearch_s
1608_o_btowc
1609_o_calloc
1610_o_cbrt
1611_o_cbrtf
1612_o_ceil
1613_o_ceilf
1614_o_clearerr
1615_o_clearerr_s
1616_o_cos
1617_o_cosf
1618_o_cosh
1619_o_coshf
1620_o_erf
1621_o_erfc
1622_o_erfcf
1623_o_erfcl
1624_o_erff
1625_o_erfl
1626_o_exit
1627_o_exp
1628_o_exp2
1629_o_exp2f
1630_o_exp2l
1631_o_expf
1632_o_fabs
1633_o_fclose
1634_o_feof
1635_o_ferror
1636_o_fflush
1637_o_fgetc
1638_o_fgetpos
1639_o_fgets
1640_o_fgetwc
1641_o_fgetws
1642_o_floor
1643_o_floorf
1644_o_fma
1645_o_fmaf
1646_o_fmal
1647_o_fmod
1648_o_fmodf
1649_o_fopen
1650_o_fopen_s
1651_o_fputc
1652_o_fputs
1653_o_fputwc
1654_o_fputws
1655_o_fread
1656_o_fread_s
1657_o_free
1658_o_freopen
1659_o_freopen_s
1660_o_frexp
1661_o_fseek
1662_o_fsetpos
1663_o_ftell
1664_o_fwrite
1665_o_getc
1666_o_getchar
1667_o_getenv
1668_o_getenv_s
1669_o_gets
1670_o_gets_s
1671_o_getwc
1672_o_getwchar
1673_o_hypot
1674_o_is_wctype
1675_o_isalnum
1676_o_isalpha
1677_o_isblank
1678_o_iscntrl
1679_o_isdigit
1680_o_isgraph
1681_o_isleadbyte
1682_o_islower
1683_o_isprint
1684_o_ispunct
1685_o_isspace
1686_o_isupper
1687_o_iswalnum
1688_o_iswalpha
1689_o_iswascii
1690_o_iswblank
1691_o_iswcntrl
1692_o_iswctype
1693_o_iswdigit
1694_o_iswgraph
1695_o_iswlower
1696_o_iswprint
1697_o_iswpunct
1698_o_iswspace
1699_o_iswupper
1700_o_iswxdigit
1701_o_isxdigit
1702_o_ldexp
1703_o_lgamma
1704_o_lgammaf
1705_o_lgammal
1706_o_llrint
1707_o_llrintf
1708_o_llrintl
1709_o_llround
1710_o_llroundf
1711_o_llroundl
1712_o_localeconv
1713_o_log
1714_o_log10
1715_o_log10f
1716_o_log1p
1717_o_log1pf
1718_o_log1pl
1719_o_log2
1720_o_log2f
1721_o_log2l
1722_o_logb
1723_o_logbf
1724_o_logbl
1725_o_logf
1726_o_lrint
1727_o_lrintf
1728_o_lrintl
1729_o_lround
1730_o_lroundf
1731_o_lroundl
1732_o_malloc
1733_o_mblen
1734_o_mbrlen
1735_o_mbrtoc16
1736_o_mbrtoc32
1737_o_mbrtowc
1738_o_mbsrtowcs
1739_o_mbsrtowcs_s
1740_o_mbstowcs
1741_o_mbstowcs_s
1742_o_mbtowc
1743_o_memcpy_s
1744_o_memset
1745_o_modf
1746_o_modff
1747_o_nan
1748_o_nanf
1749_o_nanl
1750_o_nearbyint
1751_o_nearbyintf
1752_o_nearbyintl
1753_o_nextafter
1754_o_nextafterf
1755_o_nextafterl
1756_o_nexttoward
1757_o_nexttowardf
1758_o_nexttowardl
1759_o_pow
1760_o_powf
1761_o_putc
1762_o_putchar
1763_o_puts
1764_o_putwc
1765_o_putwchar
1766_o_qsort
1767_o_qsort_s
1768_o_raise
1769_o_rand
1770_o_rand_s
1771_o_realloc
1772_o_remainder
1773_o_remainderf
1774_o_remainderl
1775_o_remove
1776_o_remquo
1777_o_remquof
1778_o_remquol
1779_o_rename
1780_o_rewind
1781_o_rint
1782_o_rintf
1783_o_rintl
1784_o_round
1785_o_roundf
1786_o_roundl
1787_o_scalbln
1788_o_scalblnf
1789_o_scalblnl
1790_o_scalbn
1791_o_scalbnf
1792_o_scalbnl
1793_o_set_terminate
1794_o_setbuf
1795_o_setlocale
1796_o_setvbuf
1797_o_sin
1798_o_sinf
1799_o_sinh
1800_o_sinhf
1801_o_sqrt
1802_o_sqrtf
1803_o_srand
1804_o_strcat_s
1805_o_strcoll
1806_o_strcpy_s
1807_o_strerror
1808_o_strerror_s
1809_o_strftime
1810_o_strncat_s
1811_o_strncpy_s
1812_o_strtod
1813_o_strtof
1814_o_strtok
1815_o_strtok_s
1816_o_strtol
1817_o_strtold
1818_o_strtoll
1819_o_strtoul
1820_o_strtoull
1821_o_system
1822_o_tan
1823_o_tanf
1824_o_tanh
1825_o_tanhf
1826_o_terminate
1827_o_tgamma
1828_o_tgammaf
1829_o_tgammal
1830_o_tmpfile_s
1831_o_tmpnam_s
1832_o_tolower
1833_o_toupper
1834_o_towlower
1835_o_towupper
1836_o_ungetc
1837_o_ungetwc
1838_o_wcrtomb
1839_o_wcrtomb_s
1840_o_wcscat_s
1841_o_wcscoll
1842_o_wcscpy
1843_o_wcscpy_s
1844_o_wcsftime
1845_o_wcsncat_s
1846_o_wcsncpy_s
1847_o_wcsrtombs
1848_o_wcsrtombs_s
1849_o_wcstod
1850_o_wcstof
1851_o_wcstok
1852_o_wcstok_s
1853_o_wcstol
1854_o_wcstold
1855_o_wcstoll
1856_o_wcstombs
1857_o_wcstombs_s
1858_o_wcstoul
1859_o_wcstoull
1860_o_wctob
1861_o_wctomb
1862_o_wctomb_s
1863_o_wmemcpy_s
1864_o_wmemmove_s
1865_open
1866_open_osfhandle
1867_pclose
1868_pipe
1869_popen
1870_purecall
1871_putc_nolock
1872_putch
1873_putch_nolock
1874_putenv
1875_putenv_s
1876_putw
1877_putwc_nolock
1878_putwch
1879_putwch_nolock
1880_putws
1881_query_app_type
1882_query_new_handler
1883_query_new_mode
1884_read
1885_realloc_base
1886_recalloc
1887_register_onexit_function
1888_register_thread_local_exe_atexit_callback
1889_resetstkoflw
1890_rmdir
1891_rmtmp
1892_rotl
1893_rotl64
1894_rotr
1895_rotr64
1896_scalb
1897F_X64(_scalbf)
1898_searchenv
1899_searchenv_s
1900_seh_filter_dll
1901_seh_filter_exe
1902F64(_set_FMA3_enable)
1903F_I386(_seh_longjmp_unwind4@4)
1904F_I386(_seh_longjmp_unwind@4)
1905F_I386(_set_SSE2_enable)
1906_set_abort_behavior
1907_set_app_type
1908__set_app_type == _set_app_type
1909_set_controlfp
1910_set_doserrno
1911_set_errno
1912_set_error_mode
1913_set_fmode
1914_set_invalid_parameter_handler
1915_set_new_handler
1916_set_new_mode
1917_set_printf_count_output
1918_set_purecall_handler
1919_set_se_translator
1920_set_thread_local_invalid_parameter_handler
1921_seterrormode
1922F_I386(_setjmp3)
1923_setmaxstdio
1924_setmbcp
1925_setmode
1926_setsystime
1927_sleep
1928_sopen
1929_sopen_dispatch
1930_sopen_s
1931_spawnl
1932_spawnle
1933_spawnlp
1934_spawnlpe
1935_spawnv
1936_spawnve
1937_spawnvp
1938_spawnvpe
1939_splitpath
1940_splitpath_s
1941_stat32
1942_stat32i64
1943_stat64
1944_stat64i32
1945_statusfp
1946F_I386(_statusfp2)
1947_strcmpi == _stricmp
1948_strcoll_l
1949_strdate
1950_strdate_s
1951_strdup
1952_strerror
1953_strerror_s
1954_strftime_l
1955_stricmp
1956_stricmp_l
1957_stricoll
1958_stricoll_l
1959_strlwr
1960_strlwr_l
1961_strlwr_s
1962_strlwr_s_l
1963_strncoll
1964_strncoll_l
1965_strnicmp
1966_strnicmp_l
1967_strnicoll
1968_strnicoll_l
1969_strnset
1970_strnset_s
1971_strrev
1972_strset
1973_strset_s
1974_strtime
1975_strtime_s
1976_strtod_l
1977_strtof_l
1978_strtoi64
1979_strtoi64_l
1980_strtoimax_l
1981_strtol_l
1982_strtold_l
1983_strtoll_l
1984_strtoui64
1985_strtoui64_l
1986_strtoul_l
1987_strtoull_l
1988_strtoumax_l
1989_strupr
1990_strupr_l
1991_strupr_s
1992_strupr_s_l
1993_strxfrm_l
1994_swab
1995_tell
1996_telli64
1997_tempnam
1998_time32
1999_time64
2000_timespec32_get
2001_timespec64_get
2002_tolower
2003_tolower_l
2004_toupper
2005_toupper_l
2006_towlower_l
2007_towupper_l
2008; This is wrapped in the compat code.
2009_tzset DATA
2010_ui64toa
2011_ui64toa_s
2012_ui64tow
2013_ui64tow_s
2014_ultoa
2015_ultoa_s
2016_ultow
2017_ultow_s
2018_umask
2019_umask_s
2020_ungetc_nolock
2021_ungetch
2022_ungetch_nolock
2023_ungetwc_nolock
2024_ungetwch
2025_ungetwch_nolock
2026_unlink
2027_unloaddll
2028_unlock_file
2029_unlock_locales
2030_utime == _utime64
2031_utime32
2032_utime64
2033_waccess
2034_waccess_s
2035_wasctime
2036_wasctime_s
2037_wassert
2038_wchdir
2039_wchmod
2040_wcreat
2041_wcreate_locale
2042_wcscoll_l
2043_wcsdup
2044_wcserror
2045_wcserror_s
2046_wcsftime_l
2047_wcsicmp
2048_wcsicmp_l
2049_wcsicoll
2050_wcsicoll_l
2051_wcslwr
2052_wcslwr_l
2053_wcslwr_s
2054_wcslwr_s_l
2055_wcsncoll
2056_wcsncoll_l
2057_wcsnicmp
2058_wcsnicmp_l
2059_wcsnicoll
2060_wcsnicoll_l
2061_wcsnset
2062_wcsnset_s
2063_wcsrev
2064_wcsset
2065_wcsset_s
2066_wcstod_l
2067_wcstof_l
2068_wcstoi64
2069_wcstoi64_l
2070_wcstoimax_l
2071_wcstol_l
2072_wcstold_l
2073_wcstoll_l
2074_wcstombs_l
2075_wcstombs_s_l
2076_wcstoui64
2077_wcstoui64_l
2078_wcstoul_l
2079_wcstoull_l
2080_wcstoumax_l
2081_wcsupr
2082_wcsupr_l
2083_wcsupr_s
2084_wcsupr_s_l
2085_wcsxfrm_l
2086_wctime32
2087_wctime32_s
2088_wctime64
2089_wctime64_s
2090_wctomb_l
2091_wctomb_s_l
2092_wctype
2093_wdupenv_s
2094_wexecl
2095_wexecle
2096_wexeclp
2097_wexeclpe
2098_wexecv
2099_wexecve
2100_wexecvp
2101_wexecvpe
2102_wfdopen
2103_wfindfirst32
2104_wfindfirst32i64
2105_wfindfirst64
2106_wfindfirst64i32
2107_wfindnext32
2108_wfindnext32i64
2109_wfindnext64
2110_wfindnext64i32
2111_wfopen
2112_wfopen_s
2113_wfreopen
2114_wfreopen_s
2115_wfsopen
2116_wfullpath
2117_wgetcwd
2118_wgetdcwd
2119_wgetenv
2120_wgetenv_s
2121_wmakepath
2122_wmakepath_s
2123_wmkdir
2124_wmktemp
2125_wmktemp_s
2126_wopen
2127_wperror
2128_wpopen
2129_wputenv
2130_wputenv_s
2131_wremove
2132_wrename
2133_write
2134_wrmdir
2135_wsearchenv
2136_wsearchenv_s
2137_wsetlocale
2138_wsopen
2139_wsopen_dispatch
2140_wsopen_s
2141_wspawnl
2142_wspawnle
2143_wspawnlp
2144_wspawnlpe
2145_wspawnv
2146_wspawnve
2147_wspawnvp
2148_wspawnvpe
2149_wsplitpath
2150_wsplitpath_s
2151_wstat32
2152_wstat32i64
2153_wstat64
2154_wstat64i32
2155_wstrdate
2156_wstrdate_s
2157_wstrtime
2158_wstrtime_s
2159_wsystem
2160_wtempnam
2161_wtmpnam
2162_wtmpnam_s
2163_wtof
2164_wtof_l
2165_wtoi
2166_wtoi64
2167_wtoi64_l
2168_wtoi_l
2169_wtol
2170_wtol_l
2171_wtoll
2172_wtoll_l
2173_wunlink
2174_wutime == _wutime64
2175_wutime32
2176_wutime64
2177_y0
2178_y1
2179_yn
2180abort
2181abs
2182acos
2183F_NON_I386(acosf)
2184F_ARM_ANY(acosl == acos)
2185acosh
2186acoshf
2187acoshl F_X86_ANY(DATA)
2188asctime
2189asctime_s
2190asin
2191F_NON_I386(asinf)
2192F_ARM_ANY(asinl == asin)
2193asinh
2194asinhf
2195asinhl F_X86_ANY(DATA)
2196atan
2197atan2
2198F_NON_I386(atan2f)
2199F_ARM_ANY(atan2l == atan2)
2200F_NON_I386(atanf)
2201F_ARM_ANY(atanl == atan)
2202atanh
2203atanhf
2204atanhl F_X86_ANY(DATA)
2205atof
2206atoi
2207atol
2208atoll
2209bsearch
2210bsearch_s
2211btowc
2212c16rtomb
2213c32rtomb
2214cabs
2215cabsf
2216cabsl
2217cacos
2218cacosf
2219cacosh
2220cacoshf
2221cacoshl
2222cacosl
2223calloc
2224carg
2225cargf
2226cargl
2227casin
2228casinf
2229casinh
2230casinhf
2231casinhl
2232casinl
2233catan
2234catanf
2235catanh
2236catanhf
2237catanhl
2238catanl
2239cbrt
2240cbrtf
2241cbrtl F_X86_ANY(DATA)
2242ccos
2243ccosf
2244ccosh
2245ccoshf
2246ccoshl
2247ccosl
2248ceil
2249F_NON_I386(ceilf)
2250F_ARM_ANY(ceill == ceil)
2251cexp
2252cexpf
2253cexpl
2254cimag
2255cimagf
2256cimagl
2257clearerr
2258clearerr_s
2259clock
2260clog
2261clog10
2262clog10f
2263clog10l
2264clogf
2265clogl
2266conj
2267conjf
2268conjl
2269copysign
2270copysignf
2271copysignl F_X86_ANY(DATA)
2272cos
2273F_NON_I386(cosf)
2274F_ARM_ANY(cosl == cos)
2275cosh
2276F_NON_I386(coshf)
2277cpow
2278cpowf
2279cpowl
2280cproj
2281cprojf
2282cprojl
2283creal
2284crealf
2285creall
2286csin
2287csinf
2288csinh
2289csinhf
2290csinhl
2291csinl
2292csqrt
2293csqrtf
2294csqrtl
2295ctan
2296ctanf
2297ctanh
2298ctanhf
2299ctanhl
2300ctanl
2301div
2302erf
2303erfc
2304erfcf
2305erfcl F_X86_ANY(DATA)
2306erff
2307erfl F_X86_ANY(DATA)
2308exit
2309exp
2310exp2
2311exp2f
2312exp2l F_X86_ANY(DATA)
2313F_NON_I386(expf)
2314F_ARM_ANY(expl == exp)
2315expm1
2316expm1f
2317expm1l F_X86_ANY(DATA)
2318fabs
2319F_ARM_ANY(fabsf)
2320fclose
2321fdim
2322fdimf
2323fdiml F_X86_ANY(DATA)
2324; Don't use the float env functions from UCRT; fesetround doesn't seem to have
2325; any effect on the FPU control word as required by other libmingwex math
2326; routines.
2327feclearexcept DATA
2328fegetenv DATA
2329fegetexceptflag DATA
2330fegetround DATA
2331feholdexcept DATA
2332feof
2333ferror
2334fesetenv DATA
2335fesetexceptflag DATA
2336fesetround DATA
2337fetestexcept DATA
2338fflush
2339fgetc
2340fgetpos
2341fgets
2342fgetwc
2343fgetws
2344floor
2345F_NON_I386(floorf)
2346F_ARM_ANY(floorl == floor)
2347fma
2348fmaf
2349fmal F_X86_ANY(DATA)
2350fmax
2351fmaxf
2352fmaxl F_X86_ANY(DATA)
2353fmin
2354fminf
2355fminl F_X86_ANY(DATA)
2356fmod
2357F_NON_I386(fmodf)
2358F_ARM_ANY(fmodl == fmod)
2359fopen
2360fopen_s
2361fputc
2362fputs
2363fputwc
2364fputws
2365fread
2366fread_s
2367free
2368freopen
2369freopen_s
2370frexp
2371fseek
2372fsetpos
2373ftell
2374fwrite
2375getc
2376getchar
2377getenv
2378getenv_s
2379gets
2380gets_s
2381getwc
2382getwchar
2383hypot
2384ilogb
2385ilogbf
2386ilogbl F_X86_ANY(DATA)
2387imaxabs
2388imaxdiv
2389is_wctype
2390isalnum
2391isalpha
2392isblank
2393iscntrl
2394isdigit
2395isgraph
2396isleadbyte
2397islower
2398isprint
2399ispunct
2400isspace
2401isupper
2402iswalnum
2403iswalpha
2404iswascii
2405iswblank
2406iswcntrl
2407iswctype
2408iswdigit
2409iswgraph
2410iswlower
2411iswprint
2412iswpunct
2413iswspace
2414iswupper
2415iswxdigit
2416isxdigit
2417labs
2418ldexp
2419ldiv
2420; The UCRT lgamma functions don't set/provide the signgam variable like
2421; the mingw ones do. Therefore prefer the libmingwex version instead.
2422lgamma DATA
2423lgammaf DATA
2424lgammal DATA
2425llabs
2426lldiv
2427llrint
2428llrintf
2429llrintl F_X86_ANY(DATA)
2430llround
2431llroundf
2432llroundl F_X86_ANY(DATA)
2433localeconv
2434log
2435log10
2436F_NON_I386(log10f)
2437F_ARM_ANY(log10l == log10)
2438log1p
2439log1pf
2440log1pl F_X86_ANY(DATA)
2441log2
2442log2f
2443log2l F_X86_ANY(DATA)
2444logb
2445logbf
2446logbl F_X86_ANY(DATA)
2447F_NON_I386(logf)
2448F_ARM_ANY(logl == log)
2449longjmp
2450lrint
2451lrintf
2452lrintl F_X86_ANY(DATA)
2453lround
2454lroundf
2455lroundl F_X86_ANY(DATA)
2456malloc
2457mblen
2458mbrlen
2459mbrtoc16
2460mbrtoc32
2461mbrtowc
2462mbsrtowcs
2463mbsrtowcs_s
2464mbstowcs
2465mbstowcs_s
2466mbtowc
2467memchr
2468memcmp
2469memcpy
2470memcpy_s
2471memmove
2472memmove_s
2473memset
2474modf
2475F_NON_I386(modff)
2476nan
2477nanf
2478nanl F_X86_ANY(DATA)
2479nearbyint
2480nearbyintf
2481nearbyintl F_X86_ANY(DATA)
2482nextafter
2483nextafterf
2484nextafterl F_X86_ANY(DATA)
2485; All of the nexttoward functions take the second parameter as long doubke,
2486; making them unusable for x86.
2487nexttoward F_X86_ANY(DATA)
2488nexttowardf F_X86_ANY(DATA)
2489nexttowardl F_X86_ANY(DATA)
2490norm
2491normf
2492norml
2493perror
2494pow
2495F_NON_I386(powf)
2496F_ARM_ANY(powl == pow)
2497putc
2498putchar
2499puts
2500putwc
2501putwchar
2502qsort
2503qsort_s
2504quick_exit
2505raise
2506rand
2507rand_s
2508realloc
2509remainder
2510remainderf
2511remainderl F_X86_ANY(DATA)
2512remove
2513remquo
2514remquof
2515remquol F_X86_ANY(DATA)
2516rename
2517rewind
2518rint
2519rintf
2520rintl F_X86_ANY(DATA)
2521round
2522roundf
2523roundl F_X86_ANY(DATA)
2524scalbln
2525scalblnf
2526scalblnl F_X86_ANY(DATA)
2527scalbn
2528scalbnf
2529scalbnl F_X86_ANY(DATA)
2530set_terminate
2531set_unexpected
2532setbuf
2533F_X64(setjmp)
2534setlocale
2535setvbuf
2536signal
2537sin
2538F_NON_I386(sinf)
2539F_ARM_ANY(sinl == sin)
2540; if we implement sinh, we can set it DATA only.
2541sinh
2542F_NON_I386(sinhf)
2543sqrt
2544F_NON_I386(sqrtf)
2545srand
2546strcat
2547strcat_s
2548strchr
2549strcmp
2550strcmpi == _stricmp
2551strcoll
2552strcpy
2553strcpy_s
2554strcspn
2555strerror
2556strerror_s
2557strftime
2558strlen
2559strncat
2560strncat_s
2561strncmp
2562strncpy
2563strncpy_s
2564; strnlen replaced by emu
2565strpbrk
2566strrchr
2567strspn
2568strstr
2569strtod
2570strtof
2571strtoimax
2572strtok
2573strtok_s
2574strtol
2575; Can't use long double functions from the CRT on x86
2576F_ARM_ANY(strtold)
2577strtoll
2578strtoul
2579strtoull
2580strtoumax
2581strxfrm
2582system
2583tan
2584F_NON_I386(tanf)
2585F_ARM_ANY(tanl == tan)
2586; if we implement tanh, we can set it to DATA only.
2587tanh
2588F_NON_I386(tanhf)
2589terminate
2590tgamma
2591tgammaf
2592tgammal F_X86_ANY(DATA)
2593tmpfile
2594tmpfile_s
2595tmpnam
2596tmpnam_s
2597tolower
2598toupper
2599towctrans
2600towlower
2601towupper
2602trunc
2603truncf
2604truncl F_X86_ANY(DATA)
2605unexpected
2606ungetc
2607ungetwc
2608utime == _utime64
2609wcrtomb
2610wcrtomb_s
2611wcscat
2612wcscat_s
2613wcschr
2614wcscmp
2615wcscoll
2616wcscpy
2617wcscpy_s
2618wcscspn
2619wcsftime
2620wcslen
2621wcsncat
2622wcsncat_s
2623wcsncmp
2624wcsncpy
2625wcsncpy_s
2626; We provide replacement implementation in libmingwex
2627wcsnlen DATA
2628wcspbrk
2629wcsrchr
2630wcsrtombs
2631wcsrtombs_s
2632wcsspn
2633wcsstr
2634wcstod
2635wcstof
2636wcstoimax
2637wcstok
2638wcstok_s
2639wcstol
2640; Can't use long double functions from the CRT on x86
2641F_ARM_ANY(wcstold)
2642wcstoll
2643wcstombs
2644wcstombs_s
2645wcstoul
2646wcstoull
2647wcstoumax
2648wcsxfrm
2649wctob
2650wctomb
2651wctomb_s
2652wctrans
2653wctype
2654wmemcpy_s
2655wmemmove_s
2656; These functions may satisfy configure scripts.
2657ctime == _ctime64
2658gmtime == _gmtime64
2659localtime == _localtime64
2660mktime == _mktime64
2661time == _time64
2662timespec_get == _timespec64_get
6; Include common ucrtbase symbols for non-debug build ucrtbase.dll
7#undef DEF_DEBUG
8#include "ucrtbase-common.def.in"
9
10; Include symbol aliases for compatibility with msvcrt.dll
11#define UCRTBASE
12#include "crt-aliases.def.in"
lib/libc/mingw/lib-common/ucrtbased.def.in created+12
......@@ -0,0 +1,12 @@
1LIBRARY "ucrtbased.dll"
2EXPORTS
3
4#include "func.def.in"
5
6; Include common ucrtbase symbols for debug build ucrtbased.dll
7#define DEF_DEBUG
8#include "ucrtbase-common.def.in"
9
10; Include symbol aliases for compatibility with msvcrt.dll
11#define UCRTBASE
12#include "crt-aliases.def.in"
lib/libc/mingw/lib-common/user32.def.in+20
......@@ -115,6 +115,7 @@ CreateMDIWindowA
115115CreateMDIWindowW
116116CreateMenu
117117CreatePopupMenu
118CreateSyntheticPointerDevice
118119CreateSystemThreads
119120CreateWindowExA
120121CreateWindowExW
......@@ -178,6 +179,7 @@ DestroyDCompositionHwndTarget
178179DestroyIcon
179180DestroyMenu
180181DestroyReasons
182DestroySyntheticPointerDevice
181183DestroyWindow
182184DeviceEventWorker
183185DialogBoxIndirectParamA
......@@ -325,6 +327,8 @@ GetDCEx
325327GetDesktopID
326328GetDesktopWindow
327329GetDialogBaseUnits
330GetDialogControlDpiChangeBehavior
331GetDialogDpiChangeBehavior
328332GetDisplayAutoRotationPreferences
329333GetDisplayConfigBufferSizes
330334GetDlgCtrlID
......@@ -333,9 +337,12 @@ GetDlgItemInt
333337GetDlgItemTextA
334338GetDlgItemTextW
335339GetDoubleClickTime
340GetDpiAwarenessContextForProcess
336341GetDpiForMonitorInternal
337342GetDpiForSystem
338343GetDpiForWindow
344GetDpiFromDpiAwarenessContext
345GetExtendedPointerDeviceProperty
339346GetFocus
340347GetForegroundWindow
341348GetGestureConfig
......@@ -440,6 +447,7 @@ GetShellWindow
440447GetSubMenu
441448GetSysColor
442449GetSysColorBrush
450GetSystemDpiForProcess
443451GetSystemMenu
444452GetSystemMetrics
445453GetSystemMetricsForDpi
......@@ -448,6 +456,7 @@ GetTabbedTextExtentW
448456GetTaskmanWindow
449457GetThreadDesktop
450458GetThreadDpiAwarenessContext
459GetThreadDpiHostingBehavior
451460GetTitleBarInfo
452461GetTopLevelWindow
453462GetTopWindow
......@@ -468,6 +477,7 @@ GetWindowContextHelpId
468477GetWindowDC
469478GetWindowDisplayAffinity
470479GetWindowDpiAwarenessContext
480GetWindowDpiHostingBehavior
471481GetWindowFeedbackSetting
472482GetWindowInfo
473483GetWindowLongA
......@@ -515,6 +525,7 @@ InjectDeviceInput
515525InjectKeyboardInput
516526InjectMouseInput
517527InjectPointerInput
528InjectSyntheticPointerInput
518529InjectTouchInput
519530InsertMenuA
520531InsertMenuItemA
......@@ -672,6 +683,7 @@ QuerySendMessage
672683RIMAddInputObserver
673684RIMAreSiblingDevices
674685RIMDeviceIoControl
686RIMEnableMonitorMappingForDevice
675687RIMFreeInputBuffer
676688RIMGetDevicePreparsedData
677689RIMGetDevicePreparsedDataLockfree
......@@ -706,6 +718,7 @@ RegisterDManipHook
706718RegisterDeviceNotificationA
707719RegisterDeviceNotificationW
708720RegisterErrorReportingDialog
721RegisterForTooltipDismissNotification
709722RegisterFrostWindow
710723RegisterGhostWindow
711724RegisterHotKey
......@@ -758,6 +771,7 @@ SendMessageW
758771SendNotifyMessageA
759772SendNotifyMessageW
760773SetActiveWindow
774SetAdditionalForegroundBoostProcesses
761775SetCapture
762776SetCaretBlinkTime
763777SetCaretPos
......@@ -775,6 +789,8 @@ SetCursorContents
775789SetCursorPos
776790SetDebugErrorLevel
777791SetDeskWallpaper
792SetDialogControlDpiChangeBehavior
793SetDialogDpiChangeBehavior
778794SetDisplayAutoRotationPreferences
779795SetDisplayConfig
780796SetDlgItemInt
......@@ -811,6 +827,7 @@ SetProcessDPIAware
811827SetProcessDefaultLayout
812828SetProcessDpiAwarenessContext
813829SetProcessDpiAwarenessInternal
830SetProcessLaunchForegroundPolicy
814831SetProcessRestrictionExemption
815832SetProcessWindowStation
816833SetProgmanWindow
......@@ -831,6 +848,7 @@ SetSystemTimer
831848SetTaskmanWindow
832849SetThreadDesktop
833850SetThreadDpiAwarenessContext
851SetThreadDpiHostingBehavior
834852SetThreadInputBlocked
835853SetTimer
836854SetUserObjectInformationA
......@@ -859,6 +877,8 @@ SetWindowsHookA
859877SetWindowsHookExA
860878SetWindowsHookExW
861879SetWindowsHookW
880ShellMigrateWindow
881ShellSetWindowPos
862882ShowCaret
863883ShowCursor
864884ShowOwnedPopups
lib/libc/mingw/lib-common/vcruntime140.def.in created+94
......@@ -0,0 +1,94 @@
1LIBRARY "VCRUNTIME140.dll"
2EXPORTS
3
4#include "func.def.in"
5
6_CreateFrameInfo
7F_I386(_CxxThrowException@8)
8F_NON_I386(_CxxThrowException)
9F_I386(_EH_prolog)
10_FindAndUnlinkFrame
11_IsExceptionObjectToBeDestroyed
12F_I386(_NLG_Dispatch2@4)
13F_I386(_NLG_Return@12)
14F_I386(_NLG_Return2)
15_SetWinRTOutOfMemoryExceptionCallback
16__AdjustPointer
17__BuildCatchObject
18__BuildCatchObjectHelper
19F_NON_I386(__C_specific_handler)
20F_NON_I386(__C_specific_handler_noexcept)
21__CxxDetectRethrow
22__CxxExceptionFilter
23__CxxFrameHandler
24__CxxFrameHandler2
25__CxxFrameHandler3
26F_I386(__CxxLongjmpUnwind@4)
27__CxxQueryExceptionSize
28__CxxRegisterExceptionObject
29__CxxUnregisterExceptionObject
30__DestructExceptionObject
31__FrameUnwindFilter
32__GetPlatformExceptionInfo
33F_NON_I386(__NLG_Dispatch2)
34F_NON_I386(__NLG_Return2)
35__RTCastToVoid
36__RTDynamicCast
37__RTtypeid
38__TypeMatch
39__current_exception
40__current_exception_context
41F_NON_ARM64(__intrinsic_setjmp)
42F_NON_I386(__intrinsic_setjmpex)
43F_ARM32(__jump_unwind)
44__processing_throw
45__report_gsfailure
46__std_exception_copy
47__std_exception_destroy
48__std_terminate
49__std_type_info_compare
50__std_type_info_destroy_list
51__std_type_info_hash
52__std_type_info_name
53__telemetry_main_invoke_trigger
54__telemetry_main_return_trigger
55__unDName
56__unDNameEx
57__uncaught_exception
58__uncaught_exceptions
59__vcrt_GetModuleFileNameW
60__vcrt_GetModuleHandleW
61__vcrt_InitializeCriticalSectionEx
62__vcrt_LoadLibraryExW
63F_I386(_chkesp)
64F_I386(_except_handler2)
65F_I386(_except_handler3)
66F_I386(_except_handler4_common)
67_get_purecall_handler
68_get_unexpected
69F_I386(_global_unwind2)
70_is_exception_typeof
71F64(_local_unwind)
72F_I386(_local_unwind2)
73F_I386(_local_unwind4)
74F_I386(_longjmpex)
75_purecall
76F_I386(_seh_longjmp_unwind4@4)
77F_I386(_seh_longjmp_unwind@4)
78_set_purecall_handler
79_set_se_translator
80F_I386(_setjmp3)
81longjmp
82memchr
83memcmp
84memcpy
85memmove
86memset
87set_unexpected
88strchr
89strrchr
90strstr
91unexpected
92wcschr
93wcsrchr
94wcsstr
lib/libc/mingw/lib-common/vcruntime140_app.def.in+1-2
......@@ -39,8 +39,7 @@ __RTtypeid
3939__TypeMatch
4040__current_exception
4141__current_exception_context
42F_X86_ANY(__intrinsic_setjmp)
43F_ARM32(__intrinsic_setjmp)
42F_NON_ARM64(__intrinsic_setjmp)
4443F_NON_I386(__intrinsic_setjmpex)
4544F_ARM32(__jump_unwind)
4645__processing_throw
lib/libc/mingw/lib-common/vcruntime140d.def.in created+94
......@@ -0,0 +1,94 @@
1LIBRARY "VCRUNTIME140D.dll"
2EXPORTS
3
4#include "func.def.in"
5
6_CreateFrameInfo
7F_I386(_CxxThrowException@8)
8F_NON_I386(_CxxThrowException)
9F_I386(_EH_prolog)
10_FindAndUnlinkFrame
11_IsExceptionObjectToBeDestroyed
12F_I386(_NLG_Dispatch2@4)
13F_I386(_NLG_Return@12)
14F_I386(_NLG_Return2)
15_SetWinRTOutOfMemoryExceptionCallback
16__AdjustPointer
17__BuildCatchObject
18__BuildCatchObjectHelper
19F_NON_I386(__C_specific_handler)
20F_NON_I386(__C_specific_handler_noexcept)
21__CxxDetectRethrow
22__CxxExceptionFilter
23__CxxFrameHandler
24__CxxFrameHandler2
25__CxxFrameHandler3
26F_I386(__CxxLongjmpUnwind@4)
27__CxxQueryExceptionSize
28__CxxRegisterExceptionObject
29__CxxUnregisterExceptionObject
30__DestructExceptionObject
31__FrameUnwindFilter
32__GetPlatformExceptionInfo
33F_NON_I386(__NLG_Dispatch2)
34F_NON_I386(__NLG_Return2)
35__RTCastToVoid
36__RTDynamicCast
37__RTtypeid
38__TypeMatch
39__current_exception
40__current_exception_context
41F_NON_ARM64(__intrinsic_setjmp)
42F_NON_I386(__intrinsic_setjmpex)
43F_ARM32(__jump_unwind)
44__processing_throw
45__report_gsfailure
46__std_exception_copy
47__std_exception_destroy
48__std_terminate
49__std_type_info_compare
50__std_type_info_destroy_list
51__std_type_info_hash
52__std_type_info_name
53__telemetry_main_invoke_trigger
54__telemetry_main_return_trigger
55__unDName
56__unDNameEx
57__uncaught_exception
58__uncaught_exceptions
59__vcrt_GetModuleFileNameW
60__vcrt_GetModuleHandleW
61__vcrt_InitializeCriticalSectionEx
62__vcrt_LoadLibraryExW
63F_I386(_chkesp)
64F_I386(_except_handler2)
65F_I386(_except_handler3)
66F_I386(_except_handler4_common)
67_get_purecall_handler
68_get_unexpected
69F_I386(_global_unwind2)
70_is_exception_typeof
71F64(_local_unwind)
72F_I386(_local_unwind2)
73F_I386(_local_unwind4)
74F_I386(_longjmpex)
75_purecall
76F_I386(_seh_longjmp_unwind4@4)
77F_I386(_seh_longjmp_unwind@4)
78_set_purecall_handler
79_set_se_translator
80F_I386(_setjmp3)
81longjmp
82memchr
83memcmp
84memcpy
85memmove
86memset
87set_unexpected
88strchr
89strrchr
90strstr
91unexpected
92wcschr
93wcsrchr
94wcsstr
lib/libc/mingw/lib-common/winbrand.def created+23
......@@ -0,0 +1,23 @@
1;
2; Definition file of WINBRAND.dll
3; Automatic generated by gendef
4; written by Kai Tietz 2008-2014
5;
6LIBRARY "WINBRAND.dll"
7EXPORTS
8BrandingFormatString
9BrandingFormatStringForEdition
10BrandingLoadBitmap
11BrandingLoadCursor
12BrandingLoadIcon
13BrandingLoadImage
14BrandingLoadNeutralStringForEdition
15BrandingLoadString
16BrandingLoadStringForEdition
17EulaFreeBuffer
18GetEULAFile
19GetEULAFileEx
20GetEULAInCurrentUILanguage
21GetHinstanceByNameSpace
22GetInstalledEULAPath
23InstallEULA
lib/libc/mingw/lib-common/winhvplatform.def.in created+70
......@@ -0,0 +1,70 @@
1#include "func.def.in"
2
3LIBRARY "winhvplatform.dll"
4EXPORTS
5WHvAcceptPartitionMigration
6WHvAdviseGpaRange
7WHvAllocateVpciResource
8WHvCancelPartitionMigration
9WHvCancelRunVirtualProcessor
10WHvCompletePartitionMigration
11WHvCreateNotificationPort
12WHvCreatePartition
13WHvCreateTrigger
14WHvCreateVirtualProcessor
15WHvCreateVirtualProcessor2
16WHvCreateVpciDevice
17WHvDeleteNotificationPort
18WHvDeletePartition
19WHvDeleteTrigger
20WHvDeleteVirtualProcessor
21WHvDeleteVpciDevice
22WHvGetCapability
23F_X64(WHvGetInterruptTargetVpSet)
24WHvGetPartitionCounters
25WHvGetPartitionProperty
26WHvGetVirtualProcessorCounters
27F_X64(WHvGetVirtualProcessorCpuidOutput)
28F_X64(WHvGetVirtualProcessorInterruptControllerState)
29F_X64(WHvGetVirtualProcessorInterruptControllerState2)
30WHvGetVirtualProcessorRegisters
31WHvGetVirtualProcessorState
32F_X64(WHvGetVirtualProcessorXsaveState)
33WHvGetVpciDeviceInterruptTarget
34WHvGetVpciDeviceNotification
35WHvGetVpciDeviceProperty
36WHvMapGpaRange
37WHvMapGpaRange2
38WHvMapVpciDeviceInterrupt
39WHvMapVpciDeviceMmioRanges
40WHvPostVirtualProcessorSynicMessage
41WHvQueryGpaRangeDirtyBitmap
42WHvReadGpaRange
43WHvReadVpciDeviceRegister
44WHvRegisterPartitionDoorbellEvent
45WHvRequestInterrupt
46WHvRequestVpciDeviceInterrupt
47WHvResetPartition
48WHvResumePartitionTime
49WHvRetargetVpciDeviceInterrupt
50WHvRunVirtualProcessor
51WHvSetNotificationPortProperty
52WHvSetPartitionProperty
53F_X64(WHvSetVirtualProcessorInterruptControllerState)
54F_X64(WHvSetVirtualProcessorInterruptControllerState2)
55WHvSetVirtualProcessorRegisters
56WHvSetVirtualProcessorState
57F_X64(WHvSetVirtualProcessorXsaveState)
58WHvSetVpciDevicePowerState
59WHvSetupPartition
60WHvSignalVirtualProcessorSynicEvent
61WHvStartPartitionMigration
62WHvSuspendPartitionTime
63WHvTranslateGva
64WHvUnmapGpaRange
65WHvUnmapVpciDeviceInterrupt
66WHvUnmapVpciDeviceMmioRanges
67WHvUnregisterPartitionDoorbellEvent
68WHvUpdateTriggerParameters
69WHvWriteGpaRange
70WHvWriteVpciDeviceRegister
lib/libc/mingw/lib-common/wintrust.def created+167
......@@ -0,0 +1,167 @@
1;
2; Definition file of WINTRUST.dll
3; Automatic generated by gendef
4; written by Kai Tietz 2008-2014
5;
6LIBRARY "WINTRUST.dll"
7EXPORTS
8ComputeFirstPageHash
9CryptCATVerifyMember
10CryptSIPGetInfo
11CryptSIPGetRegWorkingFlags
12GenericChainCertificateTrust
13GenericChainFinalProv
14HTTPSCertificateTrust
15SetMessageDigestInfo
16SoftpubDefCertInit
17SoftpubFreeDefUsageCallData
18SoftpubLoadDefUsageCallData
19WTHelperCertFindIssuerCertificate
20AddPersonalTrustDBPages
21CatalogCompactHashDatabase
22ConfigCiFinalPolicy
23ConfigCiPackageFamilyNameCheck
24CryptCATAdminAcquireContext
25CryptCATAdminAcquireContext2
26CryptCATAdminAddCatalog
27CryptCATAdminCalcHashFromFileHandle
28CryptCATAdminCalcHashFromFileHandle2
29CryptCATAdminCalcHashFromFileHandle3
30CryptCATAdminEnumCatalogFromHash
31CryptCATAdminPauseServiceForBackup
32CryptCATAdminReleaseCatalogContext
33CryptCATAdminReleaseContext
34CryptCATAdminRemoveCatalog
35CryptCATAdminResolveCatalogPath
36CryptCATAllocSortedMemberInfo
37CryptCATCDFClose
38CryptCATCDFEnumAttributes
39CryptCATCDFEnumAttributesWithCDFTag
40CryptCATCDFEnumCatAttributes
41CryptCATCDFEnumMembers
42CryptCATCDFEnumMembersByCDFTag
43CryptCATCDFEnumMembersByCDFTagEx
44CryptCATCDFOpen
45CryptCATCatalogInfoFromContext
46CryptCATClose
47CryptCATEnumerateAttr
48CryptCATEnumerateCatAttr
49CryptCATEnumerateMember
50CryptCATFreeSortedMemberInfo
51CryptCATGetAttrInfo
52CryptCATGetCatAttrInfo
53CryptCATGetMemberInfo
54CryptCATHandleFromStore
55CryptCATOpen
56CryptCATPersistStore
57CryptCATPutAttrInfo
58CryptCATPutCatAttrInfo
59CryptCATPutMemberInfo
60CryptCATStoreFromHandle
61CryptSIPCreateIndirectData
62CryptSIPGetCaps
63CryptSIPGetSealedDigest
64CryptSIPGetSignedDataMsg
65CryptSIPPutSignedDataMsg
66CryptSIPRemoveSignedDataMsg
67CryptSIPVerifyIndirectData
68; DllRegisterServer
69; DllUnregisterServer
70DriverCleanupPolicy
71DriverFinalPolicy
72DriverInitializePolicy
73FindCertsByIssuer
74GetAuthenticodeSha256Hash
75HTTPSFinalProv
76IsCatalogFile
77MsCatConstructHashTag
78MsCatFreeHashTag
79OfficeCleanupPolicy
80OfficeInitializePolicy
81OpenPersonalTrustDBDialog
82OpenPersonalTrustDBDialogEx
83SoftpubAuthenticode
84SoftpubCheckCert
85SoftpubCleanup
86SoftpubDllRegisterServer
87SoftpubDllUnregisterServer
88SoftpubDumpStructure
89SoftpubInitialize
90SoftpubLoadMessage
91SoftpubLoadSignature
92SrpCheckSmartlockerEAandProcessToken
93TrustDecode
94TrustFindIssuerCertificate
95TrustFreeDecode
96TrustIsCertificateSelfSigned
97TrustOpenStores
98WTConvertCertCtxToChainInfo
99WTGetBioSignatureInfo
100WTGetPluginSignatureInfo
101WTGetSignatureInfo
102WTHelperCertCheckValidSignature
103WTHelperCertIsSelfSigned
104WTHelperCheckCertUsage
105WTHelperGetAgencyInfo
106WTHelperGetFileHandle
107WTHelperGetFileHash
108WTHelperGetFileName
109WTHelperGetKnownUsages
110WTHelperGetProvCertFromChain
111WTHelperGetProvPrivateDataFromChain
112WTHelperGetProvSignerFromChain
113WTHelperIsChainedToMicrosoft
114WTHelperIsChainedToMicrosoftFromStateData
115WTHelperIsInRootStore
116WTHelperOpenKnownStores
117WTHelperProvDataFromStateData
118WTIsFirstConfigCiResultPreferred
119WTLogConfigCiScriptEvent
120WTLogConfigCiSignerEvent
121WTValidateBioSignaturePolicy
122WVTAsn1CatMemberInfo2Decode
123WVTAsn1CatMemberInfo2Encode
124WVTAsn1CatMemberInfoDecode
125WVTAsn1CatMemberInfoEncode
126WVTAsn1CatNameValueDecode
127WVTAsn1CatNameValueEncode
128WVTAsn1IntentToSealAttributeDecode
129WVTAsn1IntentToSealAttributeEncode
130WVTAsn1SealingSignatureAttributeDecode
131WVTAsn1SealingSignatureAttributeEncode
132WVTAsn1SealingTimestampAttributeDecode
133WVTAsn1SealingTimestampAttributeEncode
134WVTAsn1SpcFinancialCriteriaInfoDecode
135WVTAsn1SpcFinancialCriteriaInfoEncode
136WVTAsn1SpcIndirectDataContentDecode
137WVTAsn1SpcIndirectDataContentEncode
138WVTAsn1SpcLinkDecode
139WVTAsn1SpcLinkEncode
140WVTAsn1SpcMinimalCriteriaInfoDecode
141WVTAsn1SpcMinimalCriteriaInfoEncode
142WVTAsn1SpcPeImageDataDecode
143WVTAsn1SpcPeImageDataEncode
144WVTAsn1SpcSigInfoDecode
145WVTAsn1SpcSigInfoEncode
146WVTAsn1SpcSpAgencyInfoDecode
147WVTAsn1SpcSpAgencyInfoEncode
148WVTAsn1SpcSpOpusInfoDecode
149WVTAsn1SpcSpOpusInfoEncode
150WVTAsn1SpcStatementTypeDecode
151WVTAsn1SpcStatementTypeEncode
152WinVerifyTrust
153WinVerifyTrustEx
154WintrustAddActionID
155WintrustAddDefaultForUsage
156WintrustCertificateTrust
157WintrustGetDefaultForUsage
158WintrustGetRegPolicyFlags
159WintrustLoadFunctionPointers
160WintrustRemoveActionID
161WintrustSetDefaultIncludePEPageHashes
162WintrustSetRegPolicyFlags
163WintrustUserWriteabilityCheck
164mscat32DllRegisterServer
165mscat32DllUnregisterServer
166mssip32DllRegisterServer
167mssip32DllUnregisterServer
lib/libc/mingw/lib-common/wscapi.def+14-4
......@@ -5,11 +5,16 @@
55;
66LIBRARY "WSCAPI.dll"
77EXPORTS
8wscLaunchAdminMakeDefaultUI
89wscShowAMSCN
9CLSID_WSCProductList
10IID_IWSCProductList
11IID_IWscProduct
12LIBID_wscAPILib
10CLSID_WSCDefaultProduct DATA
11CLSID_WSCProductList DATA
12; DllCanUnloadNow
13; DllGetClassObject
14IID_IWSCDefaultProduct DATA
15IID_IWSCProductList DATA
16IID_IWscProduct DATA
17LIBID_wscAPILib DATA
1318WscGetAntiMalwareUri
1419WscGetSecurityProviderHealth
1520WscQueryAntiMalwareUri
......@@ -26,13 +31,18 @@ wscGeneralSecurityGetStatus
2631wscGetAlertStatus
2732wscIcfEnable
2833wscIeSettingsFix
34wscInitiateOfflineCleaning
2935wscIsDefenderAntivirusSupported
3036wscLuaSettingsFix
37wscMakeDefaultProductRequest
38wscNotifyUserForNearExpiration
3139wscOverrideComponentStatus
3240wscPing
3341wscProductInfoFree
3442wscRegisterChangeNotification
3543wscRegisterSecurityProduct
44wscSetDefaultProduct
3645wscUnRegisterChangeNotification
3746wscUnregisterSecurityProduct
3847wscUpdateProductStatus
48wscUpdateProductSubStatus
lib/libc/mingw/lib32/bcryptprimitives.def created+18
......@@ -0,0 +1,18 @@
1;
2; Definition file of bcryptPrimitives.dll
3; Automatic generated by gendef 1.1
4; written by Kai Tietz 2008
5; The def file has to be processed by --kill-at (-k) option of dlltool or ld
6;
7LIBRARY "bcryptPrimitives.dll"
8EXPORTS
9GetAsymmetricEncryptionInterface@16
10GetCipherInterface@16
11GetHashInterface@16
12GetKeyDerivationInterface@16
13GetRngInterface@12
14GetSecretAgreementInterface@16
15GetSignatureInterface@16
16MSCryptConvertRsaPrivateBlobToFullRsaBlob@20
17ProcessPrng@8
18ProcessPrngGuid@4
lib/libc/mingw/lib32/cfgmgr32.def+32-2
......@@ -7,10 +7,12 @@ LIBRARY "CFGMGR32.dll"
77EXPORTS
88CMP_GetBlockedDriverInfo@16
99CMP_GetServerSideDeviceInstallFlags@12
10CMP_Get_Device_ID_List@16
11CMP_Get_Device_ID_List_Size@12
1012CMP_Init_Detection@4
11CMP_RegisterNotification@24
13CMP_RegisterServiceNotification@16
14CMP_Register_Notification@20
1215CMP_Report_LogOn@8
13CMP_UnregisterNotification@4
1416CMP_WaitNoPendingInstallEvents@4
1517CMP_WaitServicesAvailable@4
1618CM_Add_Driver_PackageW@40
......@@ -165,6 +167,7 @@ CM_Get_Version_Ex@4
165167CM_Import_PowerScheme@12
166168CM_Install_DevNodeW@32
167169CM_Install_DevNode_ExW@36
170CM_Install_DriverW@28
168171CM_Intersect_Range_List@16
169172CM_Invert_Range_List@20
170173CM_Is_Dock_Station_Present@4
......@@ -212,6 +215,7 @@ CM_Register_Device_InterfaceA@24
212215CM_Register_Device_InterfaceW@24
213216CM_Register_Device_Interface_ExA@28
214217CM_Register_Device_Interface_ExW@28
218CM_Register_Notification@16
215219CM_Remove_SubTree@8
216220CM_Remove_SubTree_Ex@12
217221CM_Request_Device_EjectA@20
......@@ -250,8 +254,34 @@ CM_Setup_DevNode_Ex@12
250254CM_Test_Range_Available@24
251255CM_Uninstall_DevNode@8
252256CM_Uninstall_DevNode_Ex@12
257CM_Uninstall_DriverW@28
253258CM_Unregister_Device_InterfaceA@8
254259CM_Unregister_Device_InterfaceW@8
255260CM_Unregister_Device_Interface_ExA@12
256261CM_Unregister_Device_Interface_ExW@12
262CM_Unregister_Notification@4
257263CM_Write_UserPowerKey@32
264DevCloseObjectQuery@4
265DevCreateObjectQuery@36
266DevCreateObjectQueryEx@44
267DevCreateObjectQueryFromId@40
268DevCreateObjectQueryFromIdEx@48
269DevCreateObjectQueryFromIds@40
270DevCreateObjectQueryFromIdsEx@48
271DevFindProperty@20
272DevFreeObjectProperties@8
273DevFreeObjects@8
274DevGetObjectProperties@28
275DevGetObjectPropertiesEx@36
276DevGetObjects@32
277DevGetObjectsEx@40
278DevSetObjectProperties@16
279SwDeviceClose@4
280SwDeviceCreate@32
281SwDeviceGetLifetime@8
282SwDeviceInterfacePropertySet@16
283SwDeviceInterfaceRegister@28
284SwDeviceInterfaceSetState@12
285SwDevicePropertySet@12
286SwDeviceSetLifetime@8
287SwMemFree@4
lib/libc/mingw/lib32/kernel32.def+2
......@@ -121,9 +121,11 @@ BuildCommDCBW@8
121121BuildIoRingCancelRequest@20
122122BuildIoRingFlushFile@24
123123BuildIoRingReadFile@44
124BuildIoRingReadFileScatter@40
124125BuildIoRingRegisterBuffers@16
125126BuildIoRingRegisterFileHandles@16
126127BuildIoRingWriteFile@48
128BuildIoRingWriteFileGather@44
127129CallNamedPipeA@28
128130CallNamedPipeW@28
129131CallbackMayRunLong@4
lib/libc/mingw/lib32/mstask.def-13
......@@ -18,16 +18,3 @@ SAGetNSAccountInformation@12
1818SASetAccountInformation@20
1919SASetNSAccountInformation@12
2020SetNetScheduleAccountInformation@12
21_ConvertAtJobsToTasks@0@0
22_DllCanUnloadNow@0@0
23_DllGetClassObject@12@12
24_GetNetScheduleAccountInformation@12@12
25_NetrJobAdd@12@12
26_NetrJobDel@12@12
27_NetrJobEnum@20@20
28_NetrJobGetInfo@12@12
29_SAGetAccountInformation@16@16
30_SAGetNSAccountInformation@12@12
31_SASetAccountInformation@20@20
32_SASetNSAccountInformation@12@12
33_SetNetScheduleAccountInformation@12@12
lib/libc/mingw/lib32/ninput.def created+37
......@@ -0,0 +1,37 @@
1;
2; Definition file of ninput.dll
3; Automatic generated by gendef
4; written by Kai Tietz 2008-2014
5;
6LIBRARY "ninput.dll"
7EXPORTS
8AddPointerInteractionContext@8
9BufferPointerPacketsInteractionContext@12
10CreateInteractionContext@4
11DestroyInteractionContext@4
12GetCrossSlideParameterInteractionContext@12
13GetHoldParameterInteractionContext@12
14GetInertiaParameterInteractionContext@12
15GetInteractionConfigurationInteractionContext@12
16GetMouseWheelParameterInteractionContext@12
17GetPropertyInteractionContext@12
18GetStateInteractionContext@12
19GetTapParameterInteractionContext@12
20GetTranslationParameterInteractionContext@12
21ProcessBufferedPacketsInteractionContext@4
22ProcessInertiaInteractionContext@4
23ProcessPointerFramesInteractionContext@16
24RegisterOutputCallbackInteractionContext2@12
25RegisterOutputCallbackInteractionContext@12
26RemovePointerInteractionContext@8
27ResetInteractionContext@4
28SetCrossSlideParametersInteractionContext@12
29SetHoldParameterInteractionContext@12
30SetInertiaParameterInteractionContext@12
31SetInteractionConfigurationInteractionContext@12
32SetMouseWheelParameterInteractionContext@12
33SetPivotInteractionContext@16
34SetPropertyInteractionContext@12
35SetTapParameterInteractionContext@12
36SetTranslationParameterInteractionContext@12
37StopInteractionContext@4
lib/libc/mingw/lib32/t2embed.def-11
......@@ -11,17 +11,6 @@ TTIsEmbeddingEnabled@8
1111TTIsEmbeddingEnabledForFacename@8
1212TTLoadEmbeddedFont@40
1313TTRunValidationTests@8
14_TTCharToUnicode@24@24
15_TTDeleteEmbeddedFont@12@12
16_TTEmbedFont@44@44
17_TTEmbedFontFromFileA@52@52
18_TTEnableEmbeddingForFacename@8@8
19_TTGetEmbeddedFontInfo@28@28
20_TTGetEmbeddingType@8@8
21_TTIsEmbeddingEnabled@8@8
22_TTIsEmbeddingEnabledForFacename@8@8
23_TTLoadEmbeddedFont@40@40
24_TTRunValidationTests@8@8
2514TTEmbedFontEx@44
2615TTRunValidationTestsEx@8
2716TTGetNewFontName@20
lib/libc/mingw/lib32/tbs.def+1
......@@ -17,6 +17,7 @@ Tbsi_GetDeviceInfo@8
1717Tbsi_Get_OwnerAuth@16
1818Tbsi_Get_TCG_Log@12
1919Tbsi_Get_TCG_Log_Ex@12
20Tbsi_Is_Tpm_Present@0
2021Tbsi_Physical_Presence_Command@20
2122Tbsi_Revoke_Attestation@0
2223Tbsi_ShaHash@32
lib/libc/mingw/lib32/usbd.def+3-9
......@@ -5,16 +5,15 @@
55;
66LIBRARY "USBD.SYS"
77EXPORTS
8; USBD_CreateConfigurationRequestEx@8
9; USBD_ParseConfigurationDescriptorEx@28
10; USBD_ParseDescriptors@16
8USBD_CreateConfigurationRequestEx@8
9USBD_ParseConfigurationDescriptorEx@28
10USBD_ParseDescriptors@16
1111DllInitialize@4
1212DllUnload@0
1313USBD_AllocateDeviceName@4
1414USBD_CalculateUsbBandwidth@12
1515USBD_CompleteRequest@8
1616USBD_CreateConfigurationRequest@8
17; _USBD_CreateConfigurationRequestEx@8@8
1817USBD_CreateDevice@20
1918USBD_Debug_GetHeap@16
2019USBD_Debug_LogEntry@16
......@@ -30,8 +29,6 @@ USBD_GetUSBDIVersion@4
3029USBD_InitializeDevice@24
3130USBD_MakePdoName@8
3231USBD_ParseConfigurationDescriptor@12
33; _USBD_ParseConfigurationDescriptorEx@28@28
34; _USBD_ParseDescriptors@16@16
3532USBD_QueryBusTime@8
3633USBD_RegisterHcDeviceCapabilities@12
3734USBD_RegisterHcFilter@8
......@@ -40,6 +37,3 @@ USBD_RemoveDevice@12
4037USBD_RestoreDevice@12
4138USBD_SetSuspendPowerState@8
4239USBD_WaitDeviceMutex@4
43USBD_CreateConfigurationRequestEx@8==_USBD_CreateConfigurationRequestEx@8
44USBD_ParseConfigurationDescriptorEx@28==_USBD_ParseConfigurationDescriptorEx@28
45USBD_ParseDescriptors@16==_USBD_ParseDescriptors@16
lib/libc/mingw/lib32/user32.def+5
......@@ -747,6 +747,7 @@ RegisterDeviceNotificationA@12
747747RegisterDeviceNotificationW@12
748748RegisterErrorReportingDialog@8
749749RegisterFrostWindow@8
750RegisterForTooltipDismissNotification@8
750751RegisterGhostWindow@8
751752RegisterHotKey@16
752753RegisterLogonProcess@8
......@@ -799,6 +800,7 @@ SendMessageW@16
799800SendNotifyMessageA@16
800801SendNotifyMessageW@16
801802SetActiveWindow@4
803SetAdditionalForegroundBoostProcesses@12
802804SetCapture@4
803805SetCaretBlinkTime@4
804806SetCaretPos@8
......@@ -856,6 +858,7 @@ SetProcessDPIAware@0
856858SetProcessDefaultLayout@4
857859SetProcessDpiAwarenessContext@4
858860SetProcessDpiAwarenessInternal@4
861SetProcessLaunchForegroundPolicy@8
859862SetProcessRestrictionExemption@4
860863SetProcessWindowStation@4
861864SetProgmanWindow@4
......@@ -913,6 +916,8 @@ SfmDxReleaseSwapChain@8
913916SfmDxReportPendingBindingsToDwm@0
914917SfmDxSetSwapChainBindingStatus@8
915918SfmDxSetSwapChainStats@8
919ShellMigrateWindow@12
920ShellSetWindowPos@24
916921ShowCaret@4
917922ShowCursor@4
918923ShowOwnedPopups@8
lib/libc/mingw/lib32/winbrand.def created+23
......@@ -0,0 +1,23 @@
1;
2; Definition file of WINBRAND.dll
3; Automatic generated by gendef
4; written by Kai Tietz 2008-2014
5;
6LIBRARY "WINBRAND.dll"
7EXPORTS
8BrandingFormatString@4
9BrandingFormatStringForEdition@12
10BrandingLoadBitmap@8
11BrandingLoadCursor@8
12BrandingLoadIcon@8
13BrandingLoadImage@24
14BrandingLoadNeutralStringForEdition@20
15BrandingLoadString@16
16BrandingLoadStringForEdition@24
17EulaFreeBuffer@4
18GetEULAFile@20
19GetEULAFileEx@24
20GetEULAInCurrentUILanguage@4
21GetHinstanceByNameSpace@4
22GetInstalledEULAPath@4
23InstallEULA@16
lib/libc/mingw/lib32/wintrust.def+37-8
......@@ -5,6 +5,7 @@
55;
66LIBRARY "WINTRUST.dll"
77EXPORTS
8ComputeFirstPageHash@16
89CryptCATVerifyMember@12
910CryptSIPGetInfo@4
1011CryptSIPGetRegWorkingFlags@4
......@@ -17,8 +18,13 @@ SoftpubLoadDefUsageCallData@8
1718WTHelperCertFindIssuerCertificate@28
1819AddPersonalTrustDBPages@12
1920CatalogCompactHashDatabase@16
21ConfigCiFinalPolicy@4
22ConfigCiPackageFamilyNameCheck@12
23CryptCATAdminAcquireContext2@20
2024CryptCATAdminAcquireContext@12
2125CryptCATAdminAddCatalog@16
26CryptCATAdminCalcHashFromFileHandle2@20
27CryptCATAdminCalcHashFromFileHandle3@20
2228CryptCATAdminCalcHashFromFileHandle@16
2329CryptCATAdminEnumCatalogFromHash@20
2430CryptCATAdminPauseServiceForBackup@8
......@@ -52,16 +58,19 @@ CryptCATPutCatAttrInfo@20
5258CryptCATPutMemberInfo@28
5359CryptCATStoreFromHandle@4
5460CryptSIPCreateIndirectData@12
61CryptSIPGetCaps@8
62CryptSIPGetSealedDigest@20
5563CryptSIPGetSignedDataMsg@20
5664CryptSIPPutSignedDataMsg@20
5765CryptSIPRemoveSignedDataMsg@8
5866CryptSIPVerifyIndirectData@8
59DllRegisterServer
60DllUnregisterServer
67; DllRegisterServer
68; DllUnregisterServer
6169DriverCleanupPolicy@4
6270DriverFinalPolicy@4
6371DriverInitializePolicy@4
6472FindCertsByIssuer@28
73GetAuthenticodeSha256Hash@12
6574HTTPSFinalProv@4
6675IsCatalogFile@8
6776MsCatConstructHashTag@12
......@@ -73,17 +82,22 @@ OpenPersonalTrustDBDialogEx@12
7382SoftpubAuthenticode@4
7483SoftpubCheckCert@16
7584SoftpubCleanup@4
76SoftpubDllRegisterServer
77SoftpubDllUnregisterServer
85SoftpubDllRegisterServer@0
86SoftpubDllUnregisterServer@0
7887SoftpubDumpStructure@4
7988SoftpubInitialize@4
8089SoftpubLoadMessage@4
8190SoftpubLoadSignature@4
91SrpCheckSmartlockerEAandProcessToken@12
8292TrustDecode@36
8393TrustFindIssuerCertificate@32
8494TrustFreeDecode@8
8595TrustIsCertificateSelfSigned@12
8696TrustOpenStores@16
97WTConvertCertCtxToChainInfo@12
98WTGetBioSignatureInfo@24
99WTGetPluginSignatureInfo@24
100WTGetSignatureInfo@24
87101WTHelperCertCheckValidSignature@4
88102WTHelperCertIsSelfSigned@8
89103WTHelperCheckCertUsage@8
......@@ -95,13 +109,27 @@ WTHelperGetKnownUsages@8
95109WTHelperGetProvCertFromChain@8
96110WTHelperGetProvPrivateDataFromChain@8
97111WTHelperGetProvSignerFromChain@16
112WTHelperIsChainedToMicrosoft@12
113WTHelperIsChainedToMicrosoftFromStateData@8
98114WTHelperIsInRootStore@8
99115WTHelperOpenKnownStores@4
100116WTHelperProvDataFromStateData@4
117WTIsFirstConfigCiResultPreferred@12
118WTLogConfigCiScriptEvent@20
119WTLogConfigCiSignerEvent@16
120WTValidateBioSignaturePolicy@8
121WVTAsn1CatMemberInfo2Decode@28
122WVTAsn1CatMemberInfo2Encode@20
101123WVTAsn1CatMemberInfoDecode@28
102124WVTAsn1CatMemberInfoEncode@20
103125WVTAsn1CatNameValueDecode@28
104126WVTAsn1CatNameValueEncode@20
127WVTAsn1IntentToSealAttributeDecode@28
128WVTAsn1IntentToSealAttributeEncode@20
129WVTAsn1SealingSignatureAttributeDecode@28
130WVTAsn1SealingSignatureAttributeEncode@20
131WVTAsn1SealingTimestampAttributeDecode@28
132WVTAsn1SealingTimestampAttributeEncode@20
105133WVTAsn1SpcFinancialCriteriaInfoDecode@28
106134WVTAsn1SpcFinancialCriteriaInfoEncode@20
107135WVTAsn1SpcIndirectDataContentDecode@28
......@@ -131,7 +159,8 @@ WintrustLoadFunctionPointers@8
131159WintrustRemoveActionID@4
132160WintrustSetDefaultIncludePEPageHashes@4
133161WintrustSetRegPolicyFlags@4
134mscat32DllRegisterServer
135mscat32DllUnregisterServer
136mssip32DllRegisterServer
137mssip32DllUnregisterServer
162WintrustUserWriteabilityCheck@4
163mscat32DllRegisterServer@0
164mscat32DllUnregisterServer@0
165mssip32DllRegisterServer@0
166mssip32DllUnregisterServer@0
lib/libc/mingw/lib32/wscapi.def created+48
......@@ -0,0 +1,48 @@
1;
2; Definition file of WSCAPI.dll
3; Automatic generated by gendef
4; written by Kai Tietz 2008-2014
5;
6LIBRARY "WSCAPI.dll"
7EXPORTS
8wscLaunchAdminMakeDefaultUI@4
9wscShowAMSCN@8
10CLSID_WSCDefaultProduct DATA
11CLSID_WSCProductList DATA
12; DllCanUnloadNow@0
13; DllGetClassObject@12
14IID_IWSCDefaultProduct DATA
15IID_IWSCProductList DATA
16IID_IWscProduct DATA
17LIBID_wscAPILib DATA
18WscGetAntiMalwareUri@4
19WscGetSecurityProviderHealth@8
20WscQueryAntiMalwareUri@0
21WscRegisterForChanges@16
22WscRegisterForUserNotifications@0
23WscUnRegisterChanges@4
24wscAntiSpywareGetStatus@8
25wscAntiVirusExpiredBeyondThreshold@12
26wscAntiVirusGetStatus@8
27wscAutoUpdatesEnableScheduledMode@0
28wscAutoUpdatesGetStatus@4
29wscFirewallGetStatus@8
30wscGeneralSecurityGetStatus@8
31wscGetAlertStatus@8
32wscIcfEnable@0
33wscIeSettingsFix@0
34wscInitiateOfflineCleaning@8
35wscIsDefenderAntivirusSupported@4
36wscLuaSettingsFix@4
37wscMakeDefaultProductRequest@4
38wscNotifyUserForNearExpiration@4
39wscOverrideComponentStatus@8
40wscPing@0
41wscProductInfoFree@8
42wscRegisterChangeNotification@8
43wscRegisterSecurityProduct@20
44wscSetDefaultProduct@8
45wscUnRegisterChangeNotification@4
46wscUnregisterSecurityProduct@4
47wscUpdateProductStatus@12
48wscUpdateProductSubStatus@8
lib/libc/mingw/lib32/x3daudio1_2.def+2-4
......@@ -5,7 +5,5 @@
55;
66LIBRARY "X3DAudio1_2.dll"
77EXPORTS
8;_X3DAudioCalculate@20@20
9;_X3DAudioInitialize@12@12
10_X3DAudioCalculate@20 == _X3DAudioCalculate@20
11_X3DAudioInitialize@12 == _X3DAudioInitialize@12
8X3DAudioCalculate@20 == _X3DAudioCalculate@20
9X3DAudioInitialize@12 == _X3DAudioInitialize@12
lib/libc/mingw/lib32/xaudio2_9.def+2-2
......@@ -9,8 +9,8 @@ XAudio2Create@12
99CreateAudioReverb@4
1010CreateAudioVolumeMeter@4
1111CreateFX@0
12X3DAudioCalculate@0
13X3DAudioInitialize@0
12X3DAudioCalculate
13X3DAudioInitialize
1414CreateAudioReverbV2_8@4
1515XAudio2CreateV2_9@12
1616XAudio2CreateWithVersionInfo@16
lib/libc/mingw/lib64/kernel32.def created+1740
......@@ -0,0 +1,1740 @@
1
2LIBRARY "KERNEL32.dll"
3EXPORTS
4AcquireSRWLockExclusive
5AcquireSRWLockShared
6ActivateActCtx
7ActivateActCtxWorker
8ActivatePackageVirtualizationContext
9AddAtomA
10AddAtomW
11AddConsoleAliasA
12AddConsoleAliasW
13AddDllDirectory
14AddIntegrityLabelToBoundaryDescriptor
15AddLocalAlternateComputerNameA
16AddLocalAlternateComputerNameW
17AddRefActCtx
18AddRefActCtxWorker
19AddResourceAttributeAce
20AddSIDToBoundaryDescriptor
21AddScopedPolicyIDAce
22AddSecureMemoryCacheCallback
23AddVectoredContinueHandler
24AddVectoredExceptionHandler
25AdjustCalendarDate
26AllocConsole
27AllocateUserPhysicalPages
28AllocateUserPhysicalPagesNuma
29AppPolicyGetClrCompat
30AppPolicyGetCreateFileAccess
31AppPolicyGetLifecycleManagement
32AppPolicyGetMediaFoundationCodecLoading
33AppPolicyGetProcessTerminationMethod
34AppPolicyGetShowDeveloperDiagnostic
35AppPolicyGetThreadInitializationType
36AppPolicyGetWindowingModel
37AppXGetOSMaxVersionTested
38ApplicationRecoveryFinished
39ApplicationRecoveryInProgress
40AreFileApisANSI
41AreShortNamesEnabled
42AssignProcessToJobObject
43AttachConsole
44BackupRead
45BackupSeek
46BackupWrite
47BaseCheckAppcompatCache
48BaseCheckAppcompatCacheEx
49BaseCheckAppcompatCacheExWorker
50BaseCheckAppcompatCacheWorker
51BaseCheckElevation
52BaseCheckRunApp
53BaseCleanupAppcompatCacheSupport
54BaseCleanupAppcompatCacheSupportWorker
55BaseDestroyVDMEnvironment
56BaseDllReadWriteIniFile
57BaseDumpAppcompatCache
58BaseDumpAppcompatCacheWorker
59BaseElevationPostProcessing
60BaseFlushAppcompatCache
61BaseFlushAppcompatCacheWorker
62BaseFormatObjectAttributes
63BaseFormatTimeOut
64BaseFreeAppCompatDataForProcessWorker
65BaseGenerateAppCompatData
66BaseGetNamedObjectDirectory
67BaseInitAppcompatCacheSupport
68BaseInitAppcompatCacheSupportWorker
69BaseIsAppcompatInfrastructureDisabled
70BaseIsAppcompatInfrastructureDisabledWorker
71BaseIsDosApplication
72BaseProcessInitPostImport
73BaseProcessStart
74BaseQueryModuleData
75BaseReadAppCompatDataForProcessWorker
76BaseThreadStart
77BaseSetLastNTError
78BaseThreadInitThunk
79BaseUpdateAppcompatCache
80BaseUpdateAppcompatCacheWorker
81BaseUpdateVDMEntry
82BaseVerifyUnicodeString
83BaseWriteErrorElevationRequiredEvent
84Basep8BitStringToDynamicUnicodeString
85BasepAllocateActivationContextActivationBlock
86BasepAnsiStringToDynamicUnicodeString
87BasepAppContainerEnvironmentExtension
88BasepAppXExtension
89BasepCheckAppCompat
90BasepCheckBadapp
91BasepCheckWebBladeHashes
92BasepCheckWinSaferRestrictions
93BasepConstructSxsCreateProcessMessage
94BasepCopyEncryption
95BasepFreeActivationContextActivationBlock
96BasepFreeAppCompatData
97BasepGetAppCompatData
98BasepGetComputerNameFromNtPath
99BasepGetExeArchType
100BasepInitAppCompatData
101BasepIsProcessAllowed
102BasepMapModuleHandle
103BasepNotifyLoadStringResource
104BasepPostSuccessAppXExtension
105BasepProcessInvalidImage
106BasepQueryAppCompat
107BasepQueryModuleChpeSettings
108BasepReleaseAppXContext
109BasepReleaseSxsCreateProcessUtilityStruct
110BasepReportFault
111BasepSetFileEncryptionCompression
112Beep
113BeginUpdateResourceA
114BeginUpdateResourceW
115BindIoCompletionCallback
116BuildCommDCBA
117BuildCommDCBAndTimeoutsA
118BuildCommDCBAndTimeoutsW
119BuildCommDCBW
120BuildIoRingCancelRequest
121BuildIoRingFlushFile
122BuildIoRingReadFile
123BuildIoRingReadFileScatter
124BuildIoRingRegisterBuffers
125BuildIoRingRegisterFileHandles
126BuildIoRingWriteFile
127BuildIoRingWriteFileGather
128CallNamedPipeA
129CallNamedPipeW
130CallbackMayRunLong
131CalloutOnFiberStack
132CancelDeviceWakeupRequest
133CancelIo
134CancelIoEx
135CancelSynchronousIo
136CancelThreadpoolIo
137CancelTimerQueueTimer
138CancelWaitableTimer
139CeipIsOptedIn
140ChangeTimerQueueTimer
141CheckAllowDecryptedRemoteDestinationPolicy
142CheckElevation
143CheckElevationEnabled
144CheckForReadOnlyResource
145CheckForReadOnlyResourceFilter
146CheckNameLegalDOS8Dot3A
147CheckNameLegalDOS8Dot3W
148CheckRemoteDebuggerPresent
149CheckTokenCapability
150CheckTokenMembershipEx
151ClearCommBreak
152ClearCommError
153CloseConsoleHandle
154CloseHandle
155CloseIoRing
156ClosePackageInfo
157ClosePrivateNamespace
158CloseProfileUserMapping
159ClosePseudoConsole
160CloseState
161CloseThreadpool
162CloseThreadpoolCleanupGroup
163CloseThreadpoolCleanupGroupMembers
164CloseThreadpoolIo
165CloseThreadpoolTimer
166CloseThreadpoolWait
167CloseThreadpoolWork
168CmdBatNotification
169CommConfigDialogA
170CommConfigDialogW
171CompareCalendarDates
172CompareFileTime
173CompareStringA
174CompareStringEx
175CompareStringOrdinal
176CompareStringW
177ConnectNamedPipe
178ConsoleIMERoutine
179ConsoleMenuControl
180ContinueDebugEvent
181ConvertCalDateTimeToSystemTime
182ConvertDefaultLocale
183ConvertFiberToThread
184ConvertNLSDayOfWeekToWin32DayOfWeek
185ConvertSystemTimeToCalDateTime
186ConvertThreadToFiber
187ConvertThreadToFiberEx
188CopyContext
189CopyExtendedContext
190CopyFile2
191CopyFileA
192CopyFileExA
193CopyFileExW
194CopyFileTransactedA
195CopyFileTransactedW
196CopyFileW
197CopyLZFile
198CreateActCtxA
199CreateActCtxW
200CreateActCtxWWorker
201CreateBoundaryDescriptorA
202CreateBoundaryDescriptorW
203CreateConsoleScreenBuffer
204CreateDirectoryA
205CreateDirectoryExA
206CreateDirectoryExW
207CreateDirectoryTransactedA
208CreateDirectoryTransactedW
209CreateDirectoryW
210CreateEnclave
211CreateEventA
212CreateEventExA
213CreateEventExW
214CreateEventW
215CreateFiber
216CreateFiberEx
217CreateFile2
218CreateFileA
219CreateFileMappingA
220CreateFileMappingFromApp
221CreateFileMappingNumaA
222CreateFileMappingNumaW
223CreateFileMappingW
224CreateFileTransactedA
225CreateFileTransactedW
226CreateFileW
227CreateHardLinkA
228CreateHardLinkTransactedA
229CreateHardLinkTransactedW
230CreateHardLinkW
231CreateIoCompletionPort
232CreateIoRing
233CreateJobObjectA
234CreateJobObjectW
235CreateJobSet
236CreateMailslotA
237CreateMailslotW
238CreateMemoryResourceNotification
239CreateMutexA
240CreateMutexExA
241CreateMutexExW
242CreateMutexW
243CreateNamedPipeA
244CreateNamedPipeW
245CreateNlsSecurityDescriptor
246CreatePackageVirtualizationContext
247CreatePipe
248CreatePrivateNamespaceA
249CreatePrivateNamespaceW
250CreateProcessA
251; MSDN says these are exported from ADVAPI32.DLL.
252; CreateProcessAsUserA
253; CreateProcessAsUserW
254CreateProcessInternalA
255CreateProcessInternalW
256CreateProcessW
257CreatePseudoConsole
258CreateRemoteThread
259CreateRemoteThreadEx
260CreateSemaphoreA
261CreateSemaphoreExA
262CreateSemaphoreExW
263CreateSemaphoreW
264CreateSymbolicLinkA
265CreateSymbolicLinkTransactedA
266CreateSymbolicLinkTransactedW
267CreateSymbolicLinkW
268CreateTapePartition
269CreateThread
270CreateThreadpool
271CreateThreadpoolCleanupGroup
272CreateThreadpoolIo
273CreateThreadpoolTimer
274CreateThreadpoolWait
275CreateThreadpoolWork
276CreateTimerQueue
277CreateTimerQueueTimer
278CreateToolhelp32Snapshot
279CreateUmsCompletionList
280CreateUmsThreadContext
281CreateWaitableTimerA
282CreateWaitableTimerExA
283CreateWaitableTimerExW
284CreateWaitableTimerW
285CtrlRoutine
286DeactivateActCtx
287DeactivateActCtxWorker
288DeactivatePackageVirtualizationContext
289DebugActiveProcess
290DebugActiveProcessStop
291DebugBreak
292DebugBreakProcess
293DebugSetProcessKillOnExit
294DecodePointer
295DecodeSystemPointer
296DefineDosDeviceA
297DefineDosDeviceW
298DelayLoadFailureHook
299DeleteAtom
300DeleteBoundaryDescriptor
301DeleteCriticalSection
302DeleteFiber
303DeleteFileA
304DeleteFileTransactedA
305DeleteFileTransactedW
306DeleteFileW
307DeleteProcThreadAttributeList
308DeleteSynchronizationBarrier
309DeleteTimerQueue
310DeleteTimerQueueEx
311DeleteTimerQueueTimer
312DeleteUmsCompletionList
313DeleteUmsThreadContext
314DeleteVolumeMountPointA
315DeleteVolumeMountPointW
316DequeueUmsCompletionListItems
317DeviceIoControl
318DisableThreadLibraryCalls
319DisableThreadProfiling
320DisassociateCurrentThreadFromCallback
321DiscardVirtualMemory
322DisconnectNamedPipe
323DnsHostnameToComputerNameA
324DnsHostnameToComputerNameExW
325DnsHostnameToComputerNameW
326DosDateTimeToFileTime
327DosPathToSessionPathA
328DosPathToSessionPathW
329DuplicateConsoleHandle
330DuplicateEncryptionInfoFileExt
331DuplicateHandle
332DuplicatePackageVirtualizationContext
333EnableProcessOptionalXStateFeatures
334EnableThreadProfiling
335EncodePointer
336EncodeSystemPointer
337EndUpdateResourceA
338EndUpdateResourceW
339EnterCriticalSection
340EnterUmsSchedulingMode
341EnterSynchronizationBarrier
342EnumCalendarInfoA
343EnumCalendarInfoExA
344EnumCalendarInfoExEx
345EnumCalendarInfoExW
346EnumCalendarInfoW
347EnumDateFormatsA
348EnumDateFormatsExA
349EnumDateFormatsExEx
350EnumDateFormatsExW
351EnumDateFormatsW
352EnumLanguageGroupLocalesA
353EnumLanguageGroupLocalesW
354EnumResourceLanguagesA
355EnumResourceLanguagesExA
356EnumResourceLanguagesExW
357EnumResourceLanguagesW
358EnumResourceNamesA
359EnumResourceNamesExA
360EnumResourceNamesExW
361EnumResourceNamesW
362EnumResourceTypesA
363EnumResourceTypesExA
364EnumResourceTypesExW
365EnumResourceTypesW
366EnumSystemCodePagesA
367EnumSystemCodePagesW
368EnumSystemFirmwareTables
369EnumSystemGeoID
370EnumSystemGeoNames
371EnumSystemLanguageGroupsA
372EnumSystemLanguageGroupsW
373EnumSystemLocalesA
374EnumSystemLocalesEx
375EnumSystemLocalesW
376EnumTimeFormatsA
377EnumTimeFormatsEx
378EnumTimeFormatsW
379EnumUILanguagesA
380EnumUILanguagesW
381EnumerateLocalComputerNamesA
382EnumerateLocalComputerNamesW
383EraseTape
384EscapeCommFunction
385ExecuteUmsThread
386ExitProcess
387ExitThread
388ExitVDM
389ExpandEnvironmentStringsA
390ExpandEnvironmentStringsW
391ExpungeConsoleCommandHistoryA
392ExpungeConsoleCommandHistoryW
393FatalAppExitA
394FatalAppExitW
395FatalExit
396FileTimeToDosDateTime
397FileTimeToLocalFileTime
398FileTimeToSystemTime
399FillConsoleOutputAttribute
400FillConsoleOutputCharacterA
401FillConsoleOutputCharacterW
402FindActCtxSectionGuid
403FindActCtxSectionGuidWorker
404FindActCtxSectionStringA
405FindActCtxSectionStringW
406FindActCtxSectionStringWWorker
407FindAtomA
408FindAtomW
409FindClose
410FindCloseChangeNotification
411FindFirstChangeNotificationA
412FindFirstChangeNotificationW
413FindFirstFileA
414FindFirstFileExA
415FindFirstFileExW
416FindFirstFileNameTransactedW
417FindFirstFileNameW
418FindFirstFileTransactedA
419FindFirstFileTransactedW
420FindFirstFileW
421FindFirstStreamTransactedW
422FindFirstStreamW
423FindFirstVolumeA
424FindFirstVolumeMountPointA
425FindFirstVolumeMountPointW
426FindFirstVolumeW
427FindNLSString
428FindNLSStringEx
429FindNextChangeNotification
430FindNextFileA
431FindNextFileNameW
432FindNextFileW
433FindNextStreamW
434FindNextVolumeA
435FindNextVolumeMountPointA
436FindNextVolumeMountPointW
437FindNextVolumeW
438FindPackagesByPackageFamily
439FindResourceA
440FindResourceExA
441FindResourceExW
442FindResourceW
443FindStringOrdinal
444FindVolumeClose
445FindVolumeMountPointClose
446FlsAlloc
447FlsFree
448FlsGetValue
449FlsSetValue
450FlushConsoleInputBuffer
451FlushFileBuffers
452FlushInstructionCache
453FlushProcessWriteBuffers
454FlushViewOfFile
455FoldStringA
456FoldStringW
457FormatApplicationUserModelId
458FormatMessageA
459FormatMessageW
460FreeConsole
461FreeEnvironmentStringsA
462FreeEnvironmentStringsW
463FreeLibrary
464FreeLibraryAndExitThread
465FreeLibraryWhenCallbackReturns
466FreeMemoryJobObject
467FreeResource
468FreeUserPhysicalPages
469GenerateConsoleCtrlEvent
470GetACP
471GetActiveProcessorCount
472GetActiveProcessorGroupCount
473GetAppContainerAce
474GetAppContainerNamedObjectPath
475GetApplicationRecoveryCallback
476GetApplicationRecoveryCallbackWorker
477GetApplicationRestartSettings
478GetApplicationRestartSettingsWorker
479GetApplicationUserModelId
480GetAtomNameA
481GetAtomNameW
482GetBinaryType
483GetBinaryTypeA
484GetBinaryTypeW
485GetCPFileNameFromRegistry
486GetCPInfo
487GetCPInfoExA
488GetCPInfoExW
489GetCachedSigningLevel
490GetCalendarDateFormat
491GetCalendarDateFormatEx
492GetCalendarDaysInMonth
493GetCalendarDifferenceInDays
494GetCalendarInfoA
495GetCalendarInfoEx
496GetCalendarInfoW
497GetCalendarMonthsInYear
498GetCalendarSupportedDateRange
499GetCalendarWeekNumber
500GetComPlusPackageInstallStatus
501GetCommConfig
502GetCommMask
503GetCommModemStatus
504GetCommProperties
505GetCommState
506GetCommTimeouts
507GetCommandLineA
508GetCommandLineW
509GetCompressedFileSizeA
510GetCompressedFileSizeTransactedA
511GetCompressedFileSizeTransactedW
512GetCompressedFileSizeW
513GetComputerNameA
514GetComputerNameExA
515GetComputerNameExW
516GetComputerNameW
517GetConsoleAliasA
518GetConsoleAliasExesA
519GetConsoleAliasExesLengthA
520GetConsoleAliasExesLengthW
521GetConsoleAliasExesW
522GetConsoleAliasW
523GetConsoleAliasesA
524GetConsoleAliasesLengthA
525GetConsoleAliasesLengthW
526GetConsoleAliasesW
527GetConsoleCP
528GetConsoleCharType
529GetConsoleCommandHistoryA
530GetConsoleCommandHistoryLengthA
531GetConsoleCommandHistoryLengthW
532GetConsoleCommandHistoryW
533GetConsoleCursorInfo
534GetConsoleCursorMode
535GetConsoleDisplayMode
536GetConsoleFontInfo
537GetConsoleFontSize
538GetConsoleHardwareState
539GetConsoleHistoryInfo
540GetConsoleInputExeNameA
541GetConsoleInputExeNameW
542GetConsoleInputWaitHandle
543GetConsoleKeyboardLayoutNameA
544GetConsoleKeyboardLayoutNameW
545GetConsoleMode
546GetConsoleNlsMode
547GetConsoleOriginalTitleA
548GetConsoleOriginalTitleW
549GetConsoleOutputCP
550GetConsoleProcessList
551GetConsoleScreenBufferInfo
552GetConsoleScreenBufferInfoEx
553GetConsoleSelectionInfo
554GetConsoleTitleA
555GetConsoleTitleW
556GetConsoleWindow
557GetCurrencyFormatA
558GetCurrencyFormatEx
559GetCurrencyFormatW
560GetCurrentActCtx
561GetCurrentActCtxWorker
562GetCurrentApplicationUserModelId
563GetCurrentConsoleFont
564GetCurrentConsoleFontEx
565GetCurrentDirectoryA
566GetCurrentDirectoryW
567GetCurrentPackageFamilyName
568GetCurrentPackageFullName
569GetCurrentPackageId
570GetCurrentPackageInfo
571GetCurrentPackagePath
572GetCurrentPackageVirtualizationContext
573GetCurrentProcess
574GetCurrentProcessId
575GetCurrentProcessorNumber
576GetCurrentProcessorNumberEx
577GetCurrentThread
578GetCurrentThreadId
579GetCurrentThreadStackLimits
580GetCurrentUmsThread
581GetDateFormatA
582GetDateFormatAWorker
583GetDateFormatEx
584GetDateFormatW
585GetDateFormatWWorker
586GetDefaultCommConfigA
587GetDefaultCommConfigW
588GetDefaultSortkeySize
589GetDevicePowerState
590GetDiskFreeSpaceA
591GetDiskFreeSpaceExA
592GetDiskFreeSpaceExW
593GetDiskFreeSpaceW
594GetDiskSpaceInformationA
595GetDiskSpaceInformationW
596GetDllDirectoryA
597GetDllDirectoryW
598GetDriveTypeA
599GetDriveTypeW
600GetDurationFormat
601GetDurationFormatEx
602GetDynamicTimeZoneInformation
603GetEnabledExtendedFeatures
604GetEnabledXStateFeatures
605GetEncryptedFileVersionExt
606GetEnvironmentStrings
607GetEnvironmentStringsA
608GetEnvironmentStringsW
609GetEnvironmentVariableA
610GetEnvironmentVariableW
611GetEraNameCountedString
612GetErrorMode
613GetExitCodeProcess
614GetExitCodeThread
615GetExpandedNameA
616GetExpandedNameW
617GetExtendedContextLength
618GetExtendedFeaturesMask
619GetFileAttributesA
620GetFileAttributesExA
621GetFileAttributesExW
622GetFileAttributesTransactedA
623GetFileAttributesTransactedW
624GetFileAttributesW
625GetFileBandwidthReservation
626GetFileInformationByHandle
627GetFileInformationByHandleEx
628GetFileMUIInfo
629GetFileMUIPath
630GetFileSize
631GetFileSizeEx
632GetFileTime
633GetFileType
634GetFinalPathNameByHandleA
635GetFinalPathNameByHandleW
636GetFirmwareEnvironmentVariableA
637GetFirmwareEnvironmentVariableExA
638GetFirmwareEnvironmentVariableExW
639GetFirmwareEnvironmentVariableW
640GetFirmwareType
641GetFullPathNameA
642GetFullPathNameTransactedA
643GetFullPathNameTransactedW
644GetFullPathNameW
645GetGeoInfoA
646GetGeoInfoW
647GetGeoInfoEx
648GetHandleInformation
649GetIoRingInfo
650GetLargePageMinimum
651GetLargestConsoleWindowSize
652GetLastError
653GetLinguistLangSize
654GetLocalTime
655GetLocaleInfoA
656GetLocaleInfoEx
657GetLocaleInfoW
658GetLogicalDriveStringsA
659GetLogicalDriveStringsW
660GetLogicalDrives
661GetLogicalProcessorInformation
662GetLogicalProcessorInformationEx
663GetLongPathNameA
664GetLongPathNameTransactedA
665GetLongPathNameTransactedW
666GetLongPathNameW
667GetMachineTypeAttributes
668GetMailslotInfo
669GetMaximumProcessorCount
670GetMaximumProcessorGroupCount
671GetMemoryErrorHandlingCapabilities
672GetModuleFileNameA
673GetModuleFileNameW
674GetModuleHandleA
675GetModuleHandleExA
676GetModuleHandleExW
677GetModuleHandleW
678GetNLSVersion
679GetNLSVersionEx
680GetNamedPipeAttribute
681GetNamedPipeClientComputerNameA
682GetNamedPipeClientComputerNameW
683GetNamedPipeClientProcessId
684GetNamedPipeClientSessionId
685GetNamedPipeHandleStateA
686GetNamedPipeHandleStateW
687GetNamedPipeInfo
688GetNamedPipeServerProcessId
689GetNamedPipeServerSessionId
690GetNativeSystemInfo
691GetNextUmsListItem
692GetNextVDMCommand
693GetNlsSectionName
694GetNumaAvailableMemoryNode
695GetNumaAvailableMemoryNodeEx
696GetNumaHighestNodeNumber
697GetNumaNodeNumberFromHandle
698GetNumaNodeProcessorMask
699GetNumaNodeProcessorMask2
700GetNumaNodeProcessorMaskEx
701GetNumaProcessorNode
702GetNumaProcessorNodeEx
703GetNumaProximityNode
704GetNumaProximityNodeEx
705GetNumberFormatA
706GetNumberFormatEx
707GetNumberFormatW
708GetNumberOfConsoleFonts
709GetNumberOfConsoleInputEvents
710GetNumberOfConsoleMouseButtons
711GetOEMCP
712GetOverlappedResult
713GetOverlappedResultEx
714GetPackageApplicationIds
715GetPackageFamilyName
716GetPackageFullName
717GetPackageId
718GetPackageInfo
719GetPackagePath
720GetPackagePathByFullName
721GetPackagesByPackageFamily
722GetPhysicallyInstalledSystemMemory
723GetPriorityClass
724GetPrivateProfileIntA
725GetPrivateProfileIntW
726GetPrivateProfileSectionA
727GetPrivateProfileSectionNamesA
728GetPrivateProfileSectionNamesW
729GetPrivateProfileSectionW
730GetPrivateProfileStringA
731GetPrivateProfileStringW
732GetPrivateProfileStructA
733GetPrivateProfileStructW
734GetProcAddress
735GetProcessAffinityMask
736GetProcessDefaultCpuSetMasks
737GetProcessDefaultCpuSets
738GetProcessDEPPolicy
739GetProcessGroupAffinity
740GetProcessHandleCount
741GetProcessHeap
742GetProcessHeaps
743GetProcessId
744GetProcessIdOfThread
745GetProcessInformation
746GetProcessIoCounters
747GetProcessMitigationPolicy
748GetProcessPreferredUILanguages
749GetProcessPriorityBoost
750GetProcessShutdownParameters
751GetProcessTimes
752GetProcessVersion
753GetProcessWorkingSetSize
754GetProcessWorkingSetSizeEx
755GetProcessesInVirtualizationContext
756GetProcessorSystemCycleTime
757GetProductInfo
758GetProfileIntA
759GetProfileIntW
760GetProfileSectionA
761GetProfileSectionW
762GetProfileStringA
763GetProfileStringW
764GetQueuedCompletionStatus
765GetQueuedCompletionStatusEx
766GetShortPathNameA
767GetShortPathNameW
768GetStagedPackagePathByFullName
769GetStartupInfoA
770GetStartupInfoW
771GetStateFolder
772GetStdHandle
773GetStringScripts
774GetStringTypeA
775GetStringTypeExA
776GetStringTypeExW
777GetStringTypeW
778GetSystemAppDataKey
779GetSystemCpuSetInformation
780GetSystemDEPPolicy
781GetSystemDefaultLCID
782GetSystemDefaultLangID
783GetSystemDefaultLocaleName
784GetSystemDefaultUILanguage
785GetSystemDirectoryA
786GetSystemDirectoryW
787GetSystemFileCacheSize
788GetSystemFirmwareTable
789GetSystemInfo
790GetSystemPowerStatus
791GetSystemPreferredUILanguages
792GetSystemRegistryQuota
793GetSystemTime
794GetSystemTimeAdjustment
795GetSystemTimeAsFileTime
796GetSystemTimePreciseAsFileTime
797GetSystemTimes
798GetSystemWindowsDirectoryA
799GetSystemWindowsDirectoryW
800GetSystemWow64DirectoryA
801GetSystemWow64DirectoryW
802GetTapeParameters
803GetTapePosition
804GetTapeStatus
805GetTempFileNameA
806GetTempFileNameW
807GetTempPathA
808GetTempPathW
809GetTempPath2A
810GetTempPath2W
811GetThreadContext
812GetThreadDescription
813GetThreadEnabledXStateFeatures
814GetThreadErrorMode
815GetThreadGroupAffinity
816GetThreadIOPendingFlag
817GetThreadId
818GetThreadIdealProcessorEx
819GetThreadInformation
820GetThreadLocale
821GetThreadPreferredUILanguages
822GetThreadPriority
823GetThreadPriorityBoost
824GetThreadSelectedCpuSetMasks
825GetThreadSelectedCpuSets
826GetThreadSelectorEntry
827GetThreadTimes
828GetThreadUILanguage
829GetTickCount
830GetTickCount64
831GetTimeFormatA
832GetTimeFormatAWorker
833GetTimeFormatEx
834GetTimeFormatW
835GetTimeFormatWWorker
836GetTimeZoneInformation
837GetTimeZoneInformationForYear
838GetUILanguageInfo
839GetUmsCompletionListEvent
840GetUmsSystemThreadInformation
841GetUserDefaultGeoName
842GetUserDefaultLCID
843GetUserDefaultLangID
844GetUserDefaultLocaleName
845GetUserDefaultUILanguage
846GetUserGeoID
847GetUserPreferredUILanguages
848GetVDMCurrentDirectories
849GetVersion
850GetVersionExA
851GetVersionExW
852GetVolumeInformationA
853GetVolumeInformationByHandleW
854GetVolumeInformationW
855GetVolumeNameForVolumeMountPointA
856GetVolumeNameForVolumeMountPointW
857GetVolumePathNameA
858GetVolumePathNameW
859GetVolumePathNamesForVolumeNameA
860GetVolumePathNamesForVolumeNameW
861GetWindowsDirectoryA
862GetWindowsDirectoryW
863GetWriteWatch
864GetXStateFeaturesMask
865GlobalAddAtomA
866GlobalAddAtomExA
867GlobalAddAtomExW
868GlobalAddAtomW
869GlobalAlloc
870GlobalCompact
871GlobalDeleteAtom
872GlobalFindAtomA
873GlobalFindAtomW
874GlobalFix
875GlobalFlags
876GlobalFree
877GlobalGetAtomNameA
878GlobalGetAtomNameW
879GlobalHandle
880GlobalLock
881GlobalMemoryStatus
882GlobalMemoryStatusEx
883GlobalReAlloc
884GlobalSize
885GlobalUnWire
886GlobalUnfix
887GlobalUnlock
888GlobalWire
889Heap32First
890Heap32ListFirst
891Heap32ListNext
892Heap32Next
893HeapAlloc
894HeapCompact
895HeapCreate
896HeapCreateTagsW
897HeapDestroy
898HeapExtend
899HeapFree
900HeapLock
901HeapQueryInformation
902HeapQueryTagW
903HeapReAlloc
904HeapSetInformation
905HeapSize
906HeapSummary
907HeapUnlock
908HeapUsage
909HeapValidate
910HeapWalk
911IdnToAscii
912IdnToNameprepUnicode
913IdnToUnicode
914InitAtomTable
915InitOnceBeginInitialize
916InitOnceComplete
917InitOnceExecuteOnce
918InitOnceInitialize
919InitializeConditionVariable
920InitializeContext
921InitializeContext2
922InitializeCriticalSection
923InitializeCriticalSectionAndSpinCount
924InitializeCriticalSectionEx
925InitializeEnclave
926InitializeExtendedContext
927InitializeProcThreadAttributeList
928InitializeSListHead
929InitializeSRWLock
930InitializeSynchronizationBarrier
931InstallELAMCertificateInfo
932InterlockedFlushSList
933InterlockedPopEntrySList
934InterlockedPushEntrySList
935InterlockedPushListSList
936InterlockedPushListSListEx
937InvalidateConsoleDIBits
938IsBadCodePtr
939IsBadHugeReadPtr
940IsBadHugeWritePtr
941IsBadReadPtr
942IsBadStringPtrA
943IsBadStringPtrW
944IsBadWritePtr
945IsCalendarLeapDay
946IsCalendarLeapMonth
947IsCalendarLeapYear
948IsDBCSLeadByte
949IsDBCSLeadByteEx
950IsDebuggerPresent
951IsEnclaveTypeSupported
952IsIoRingOpSupported
953IsNLSDefinedString
954IsNativeVhdBoot
955IsNormalizedString
956IsProcessCritical
957IsProcessInJob
958IsProcessorFeaturePresent
959IsSystemResumeAutomatic
960IsThreadAFiber
961IsThreadpoolTimerSet
962IsTimeZoneRedirectionEnabled
963IsUserCetAvailableInEnvironment
964IsValidCalDateTime
965IsValidCodePage
966IsValidLanguageGroup
967IsValidLocale
968IsValidUILanguage
969IsValidLocaleName
970IsValidNLSVersion
971IsWow64GuestMachineSupported
972IsWow64Process
973IsWow64Process2
974K32EmptyWorkingSet
975K32EnumDeviceDrivers
976K32EnumPageFilesA
977K32EnumPageFilesW
978K32EnumProcessModules
979K32EnumProcessModulesEx
980K32EnumProcesses
981K32GetDeviceDriverBaseNameA
982K32GetDeviceDriverBaseNameW
983K32GetDeviceDriverFileNameA
984K32GetDeviceDriverFileNameW
985K32GetMappedFileNameA
986K32GetMappedFileNameW
987K32GetModuleBaseNameA
988K32GetModuleBaseNameW
989K32GetModuleFileNameExA
990K32GetModuleFileNameExW
991K32GetModuleInformation
992K32GetPerformanceInfo
993K32GetProcessImageFileNameA
994K32GetProcessImageFileNameW
995K32GetProcessMemoryInfo
996K32GetWsChanges
997K32GetWsChangesEx
998K32InitializeProcessForWsWatch
999K32QueryWorkingSet
1000K32QueryWorkingSetEx
1001LCIDToLocaleName
1002LCMapStringA
1003LCMapStringEx
1004LCMapStringW
1005LZClose
1006LZCloseFile
1007LZCopy
1008LZCreateFileW
1009LZDone
1010LZInit
1011LZOpenFileA
1012LZOpenFileW
1013LZRead
1014LZSeek
1015LZStart
1016LeaveCriticalSection
1017LeaveCriticalSectionWhenCallbackReturns
1018LoadAppInitDlls
1019LoadEnclaveData
1020LoadLibraryA
1021LoadLibraryExA
1022LoadLibraryExW
1023LoadLibraryW
1024LoadModule
1025LoadPackagedLibrary
1026LoadResource
1027LoadStringBaseExW
1028LoadStringBaseW
1029LocalAlloc
1030LocalCompact
1031LocalFileTimeToFileTime
1032LocalFileTimeToLocalSystemTime
1033LocalFlags
1034LocalFree
1035LocalHandle
1036LocalLock
1037LocalReAlloc
1038LocalShrink
1039LocalSize
1040LocalSystemTimeToLocalFileTime
1041LocalUnlock
1042LocaleNameToLCID
1043LocateExtendedFeature
1044LocateLegacyContext
1045LocateXStateFeature
1046LockFile
1047LockFileEx
1048LockResource
1049MapUserPhysicalPages
1050MapUserPhysicalPagesScatter
1051MapViewOfFile
1052MapViewOfFileEx
1053MapViewOfFileExNuma
1054MapViewOfFileFromApp
1055Module32First
1056Module32FirstW
1057Module32Next
1058Module32NextW
1059MoveFileA
1060MoveFileExA
1061MoveFileExW
1062MoveFileTransactedA
1063MoveFileTransactedW
1064MoveFileW
1065MoveFileWithProgressA
1066MoveFileWithProgressW
1067MulDiv
1068MultiByteToWideChar
1069NeedCurrentDirectoryForExePathA
1070NeedCurrentDirectoryForExePathW
1071NlsConvertIntegerToString
1072NlsCheckPolicy
1073NlsEventDataDescCreate
1074NlsGetCacheUpdateCount
1075NlsUpdateLocale
1076NlsUpdateSystemLocale
1077NlsResetProcessLocale
1078NlsWriteEtwEvent
1079NormalizeString
1080NotifyMountMgr
1081NotifyUILanguageChange
1082NtVdm64CreateProcessInternalW
1083OOBEComplete
1084OfferVirtualMemory
1085OpenConsoleW
1086OpenConsoleWStub
1087OpenDataFile
1088OpenEventA
1089OpenEventW
1090OpenFile
1091OpenFileById
1092OpenFileMappingA
1093OpenFileMappingW
1094OpenJobObjectA
1095OpenJobObjectW
1096OpenMutexA
1097OpenMutexW
1098OpenPackageInfoByFullName
1099OpenPrivateNamespaceA
1100OpenPrivateNamespaceW
1101OpenProcess
1102; MSDN says OpenProcessToken is from Advapi32.dll, not Kernel32.dll
1103; OpenProcessToken
1104OpenProfileUserMapping
1105OpenSemaphoreA
1106OpenSemaphoreW
1107OpenState
1108OpenStateExplicit
1109OpenThread
1110; MSDN says this is exported from ADVAPI32.DLL.
1111; OpenThreadToken
1112OpenWaitableTimerA
1113OpenWaitableTimerW
1114OutputDebugStringA
1115OutputDebugStringW
1116PackageFamilyNameFromFullName
1117PackageFamilyNameFromId
1118PackageFullNameFromId
1119PackageIdFromFullName
1120PackageNameAndPublisherIdFromFamilyName
1121ParseApplicationUserModelId
1122PeekConsoleInputA
1123PeekConsoleInputW
1124PeekNamedPipe
1125PopIoRingCompletion
1126PostQueuedCompletionStatus
1127PowerClearRequest
1128PowerCreateRequest
1129PowerSetRequest
1130PrefetchVirtualMemory
1131PrepareTape
1132PrivCopyFileExW
1133PrivMoveFileIdentityW
1134Process32First
1135Process32FirstW
1136Process32Next
1137Process32NextW
1138ProcessIdToSessionId
1139PssCaptureSnapshot
1140PssDuplicateSnapshot
1141PssFreeSnapshot
1142PssQuerySnapshot
1143PssWalkMarkerCreate
1144PssWalkMarkerFree
1145PssWalkMarkerGetPosition
1146PssWalkMarkerRewind
1147PssWalkMarkerSeek
1148PssWalkMarkerSeekToBeginning
1149PssWalkMarkerSetPosition
1150PssWalkMarkerTell
1151PssWalkSnapshot
1152PulseEvent
1153PurgeComm
1154QueryActCtxSettingsW
1155QueryActCtxSettingsWWorker
1156QueryActCtxW
1157QueryActCtxWWorker
1158QueryDepthSList
1159QueryDosDeviceA
1160QueryDosDeviceW
1161QueryFullProcessImageNameA
1162QueryFullProcessImageNameW
1163QueryIdleProcessorCycleTime
1164QueryIdleProcessorCycleTimeEx
1165QueryInformationJobObject
1166QueryIoRateControlInformationJobObject
1167QueryIoRingCapabilities
1168QueryMemoryResourceNotification
1169QueryPerformanceCounter
1170QueryPerformanceFrequency
1171QueryProcessAffinityUpdateMode
1172QueryProcessCycleTime
1173QueryProtectedPolicy
1174QueryThreadCycleTime
1175QueryThreadProfiling
1176QueryThreadpoolStackInformation
1177QueryUmsThreadInformation
1178QueryUnbiasedInterruptTime
1179QueueUserAPC
1180QueueUserAPC2
1181QueueUserWorkItem
1182QuirkGetData2Worker
1183QuirkGetDataWorker
1184QuirkIsEnabled2Worker
1185QuirkIsEnabled3Worker
1186QuirkIsEnabledForPackage2Worker
1187QuirkIsEnabledForPackage3Worker
1188QuirkIsEnabledForPackage4Worker
1189QuirkIsEnabledForPackageWorker
1190QuirkIsEnabledForProcessWorker
1191QuirkIsEnabledWorker
1192RaiseException
1193RaiseFailFastException
1194RaiseInvalid16BitExeError
1195ReOpenFile
1196ReclaimVirtualMemory
1197ReadConsoleA
1198ReadConsoleInputA
1199ReadConsoleInputExA
1200ReadConsoleInputExW
1201ReadConsoleInputW
1202ReadConsoleOutputA
1203ReadConsoleOutputAttribute
1204ReadConsoleOutputCharacterA
1205ReadConsoleOutputCharacterW
1206ReadConsoleOutputW
1207ReadConsoleW
1208ReadDirectoryChangesExW
1209ReadDirectoryChangesW
1210ReadFile
1211ReadFileEx
1212ReadFileScatter
1213ReadProcessMemory
1214ReadThreadProfilingData
1215;
1216; MSDN says these functions are exported
1217; from advapi32.dll. Commented out for
1218; compatibility with older versions of
1219; Windows.
1220;
1221; RegKrnGetGlobalState and RegKrnInitialize
1222; are known exceptions.
1223;
1224;RegCloseKey
1225;RegCopyTreeW
1226;RegCreateKeyExA
1227;RegCreateKeyExW
1228;RegDeleteKeyExA
1229;RegDeleteKeyExW
1230;RegDeleteTreeA
1231;RegDeleteTreeW
1232;RegDeleteValueA
1233;RegDeleteValueW
1234;RegDisablePredefinedCacheEx
1235;RegEnumKeyExA
1236;RegEnumKeyExW
1237;RegEnumValueA
1238;RegEnumValueW
1239;RegFlushKey
1240;RegGetKeySecurity
1241;RegGetValueA
1242;RegGetValueW
1243RegKrnGetGlobalState
1244RegKrnInitialize
1245;RegLoadKeyA
1246;RegLoadKeyW
1247;RegLoadMUIStringA
1248;RegLoadMUIStringW
1249;RegNotifyChangeKeyValue
1250;RegOpenCurrentUser
1251;RegOpenKeyExA
1252;RegOpenKeyExW
1253;RegOpenUserClassesRoot
1254;RegQueryInfoKeyA
1255;RegQueryInfoKeyW
1256;RegQueryValueExA
1257;RegQueryValueExW
1258;RegRestoreKeyA
1259;RegRestoreKeyW
1260;RegSaveKeyExA
1261;RegSaveKeyExW
1262;RegSetKeySecurity
1263;RegSetValueExA
1264;RegSetValueExW
1265;RegUnLoadKeyA
1266;RegUnLoadKeyW
1267RegisterApplicationRecoveryCallback
1268RegisterApplicationRestart
1269RegisterBadMemoryNotification
1270RegisterConsoleIME
1271RegisterConsoleOS2
1272RegisterConsoleVDM
1273RegisterWaitForInputIdle
1274RegisterWaitForSingleObject
1275RegisterWaitForSingleObjectEx
1276RegisterWaitUntilOOBECompleted
1277RegisterWowBaseHandlers
1278RegisterWowExec
1279ReleaseActCtx
1280ReleaseActCtxWorker
1281ReleaseMutex
1282ReleaseMutexWhenCallbackReturns
1283ReleasePackageVirtualizationContext
1284ReleaseSRWLockExclusive
1285ReleaseSRWLockShared
1286ReleaseSemaphore
1287ReleaseSemaphoreWhenCallbackReturns
1288RemoveDirectoryA
1289RemoveDirectoryTransactedA
1290RemoveDirectoryTransactedW
1291RemoveDirectoryW
1292RemoveDllDirectory
1293RemoveLocalAlternateComputerNameA
1294RemoveLocalAlternateComputerNameW
1295RemoveSecureMemoryCacheCallback
1296RemoveVectoredContinueHandler
1297RemoveVectoredExceptionHandler
1298ReplaceFile
1299ReplaceFileA
1300ReplaceFileW
1301ReplacePartitionUnit
1302RequestDeviceWakeup
1303RequestWakeupLatency
1304ResetEvent
1305ResetWriteWatch
1306ResizePseudoConsole
1307ResolveDelayLoadedAPI
1308ResolveDelayLoadsFromDll
1309ResolveLocaleName
1310RestoreLastError
1311ResumeThread
1312RtlAddFunctionTable
1313RtlCaptureContext
1314RtlCaptureStackBackTrace
1315RtlCompareMemory
1316RtlCopyMemory
1317RtlDeleteFunctionTable
1318RtlFillMemory
1319RtlInstallFunctionTableCallback
1320RtlIsEcCode
1321RtlLookupFunctionEntry
1322RtlMoveMemory
1323RtlPcToFileHeader
1324RtlRaiseException
1325RtlRestoreContext
1326RtlUnwind
1327RtlUnwindEx
1328RtlVirtualUnwind
1329RtlVirtualUnwind2
1330RtlZeroMemory
1331ScrollConsoleScreenBufferA
1332ScrollConsoleScreenBufferW
1333SearchPathA
1334SearchPathW
1335SetCachedSigningLevel
1336SetCPGlobal
1337SetCalendarInfoA
1338SetCalendarInfoW
1339SetComPlusPackageInstallStatus
1340SetCommBreak
1341SetCommConfig
1342SetCommMask
1343SetCommState
1344SetCommTimeouts
1345SetComputerNameA
1346SetComputerNameEx2W
1347SetComputerNameExA
1348SetComputerNameExW
1349SetComputerNameW
1350SetConsoleActiveScreenBuffer
1351SetConsoleCP
1352SetConsoleCommandHistoryMode
1353SetConsoleCtrlHandler
1354SetConsoleCursor
1355SetConsoleCursorInfo
1356SetConsoleCursorMode
1357SetConsoleCursorPosition
1358SetConsoleDisplayMode
1359SetConsoleFont
1360SetConsoleHardwareState
1361SetConsoleHistoryInfo
1362SetConsoleIcon
1363SetConsoleInputExeNameA
1364SetConsoleInputExeNameW
1365SetConsoleKeyShortcuts
1366SetConsoleLocalEUDC
1367SetConsoleMaximumWindowSize
1368SetConsoleMenuClose
1369SetConsoleMode
1370SetConsoleNlsMode
1371SetConsoleNumberOfCommandsA
1372SetConsoleNumberOfCommandsW
1373SetConsoleOS2OemFormat
1374SetConsoleOutputCP
1375SetConsolePalette
1376SetConsoleScreenBufferInfoEx
1377SetConsoleScreenBufferSize
1378SetConsoleTextAttribute
1379SetConsoleTitleA
1380SetConsoleTitleW
1381SetConsoleWindowInfo
1382SetCriticalSectionSpinCount
1383SetCurrentConsoleFontEx
1384SetCurrentDirectoryA
1385SetCurrentDirectoryW
1386SetDefaultCommConfigA
1387SetDefaultCommConfigW
1388SetDefaultDllDirectories
1389SetDllDirectoryA
1390SetDllDirectoryW
1391SetDynamicTimeZoneInformation
1392SetEndOfFile
1393SetEnvironmentStringsA
1394SetEnvironmentStringsW
1395SetEnvironmentVariableA
1396SetEnvironmentVariableW
1397SetErrorMode
1398SetEvent
1399SetEventWhenCallbackReturns
1400SetExtendedFeaturesMask
1401SetFileApisToANSI
1402SetFileApisToOEM
1403SetFileAttributesA
1404SetFileAttributesTransactedA
1405SetFileAttributesTransactedW
1406SetFileAttributesW
1407SetFileBandwidthReservation
1408SetFileCompletionNotificationModes
1409SetFileInformationByHandle
1410SetFileIoOverlappedRange
1411SetFilePointer
1412SetFilePointerEx
1413SetFileShortNameA
1414SetFileShortNameW
1415SetFileTime
1416SetFileValidData
1417SetFirmwareEnvironmentVariableA
1418SetFirmwareEnvironmentVariableExA
1419SetFirmwareEnvironmentVariableExW
1420SetFirmwareEnvironmentVariableW
1421SetHandleCount
1422SetHandleInformation
1423SetInformationJobObject
1424SetIoRateControlInformationJobObject
1425SetIoRingCompletionEvent
1426SetLastConsoleEventActive
1427SetLastError
1428SetLocalPrimaryComputerNameA
1429SetLocalPrimaryComputerNameW
1430SetLocalTime
1431SetLocaleInfoA
1432SetLocaleInfoW
1433SetMailslotInfo
1434SetMessageWaitingIndicator
1435SetNamedPipeAttribute
1436SetNamedPipeHandleState
1437SetPriorityClass
1438SetProcessAffinityMask
1439SetProcessAffinityUpdateMode
1440SetProcessDEPPolicy
1441SetProcessDefaultCpuSetMasks
1442SetProcessDefaultCpuSets
1443SetProcessDynamicEHContinuationTargets
1444SetProcessDynamicEnforcedCetCompatibleRanges
1445SetProcessInformation
1446SetProcessMitigationPolicy
1447SetProcessPreferredUILanguages
1448SetProcessPriorityBoost
1449SetProcessShutdownParameters
1450SetProcessWorkingSetSize
1451SetProcessWorkingSetSizeEx
1452SetProtectedPolicy
1453SetSearchPathMode
1454SetStdHandle
1455SetStdHandleEx
1456SetSystemFileCacheSize
1457SetSystemPowerState
1458SetSystemTime
1459SetSystemTimeAdjustment
1460SetTapeParameters
1461SetTapePosition
1462SetTermsrvAppInstallMode
1463SetThreadAffinityMask
1464SetThreadContext
1465SetThreadDescription
1466SetThreadErrorMode
1467SetThreadExecutionState
1468SetThreadGroupAffinity
1469SetThreadIdealProcessor
1470SetThreadIdealProcessorEx
1471SetThreadInformation
1472SetThreadLocale
1473SetThreadPreferredUILanguages
1474SetThreadPriority
1475SetThreadPriorityBoost
1476SetThreadSelectedCpuSetMasks
1477SetThreadSelectedCpuSets
1478SetThreadStackGuarantee
1479; MSDN says this is exported from ADVAPI32.DLL.
1480; SetThreadToken
1481SetThreadUILanguage
1482SetThreadpoolStackInformation
1483SetThreadpoolThreadMaximum
1484SetThreadpoolThreadMinimum
1485SetThreadpoolTimer
1486SetThreadpoolTimerEx
1487SetThreadpoolWait
1488SetThreadpoolWaitEx
1489SetTimeZoneInformation
1490SetTimerQueueTimer
1491SetUmsThreadInformation
1492SetUnhandledExceptionFilter
1493SetUserGeoID
1494SetUserGeoName
1495SetVDMCurrentDirectories
1496SetVolumeLabelA
1497SetVolumeLabelW
1498SetVolumeMountPointA
1499SetVolumeMountPointW
1500SetVolumeMountPointWStub
1501SetWaitableTimer
1502SetWaitableTimerEx
1503SetXStateFeaturesMask
1504SetupComm
1505ShowConsoleCursor
1506SignalObjectAndWait
1507SizeofResource
1508Sleep
1509SleepConditionVariableCS
1510SleepConditionVariableSRW
1511SleepEx
1512SortCloseHandle
1513SortGetHandle
1514StartThreadpoolIo
1515SubmitIoRing
1516SubmitThreadpoolWork
1517SuspendThread
1518SwitchToFiber
1519SwitchToThread
1520SystemTimeToFileTime
1521SystemTimeToTzSpecificLocalTime
1522SystemTimeToTzSpecificLocalTimeEx
1523TerminateJobObject
1524TerminateProcess
1525TerminateThread
1526TermsrvAppInstallMode
1527TermsrvConvertSysRootToUserDir
1528TermsrvCreateRegEntry
1529TermsrvDeleteKey
1530TermsrvDeleteValue
1531TermsrvGetPreSetValue
1532TermsrvGetWindowsDirectoryA
1533TermsrvGetWindowsDirectoryW
1534TermsrvOpenRegEntry
1535TermsrvOpenUserClasses
1536TermsrvRestoreKey
1537TermsrvSetKeySecurity
1538TermsrvSetValueKey
1539TermsrvSyncUserIniFileExt
1540Thread32First
1541Thread32Next
1542TlsAlloc
1543TlsFree
1544TlsGetValue
1545TlsSetValue
1546Toolhelp32ReadProcessMemory
1547TransactNamedPipe
1548TransmitCommChar
1549TryAcquireSRWLockExclusive
1550TryAcquireSRWLockShared
1551TryEnterCriticalSection
1552TrySubmitThreadpoolCallback
1553TzSpecificLocalTimeToSystemTime
1554TzSpecificLocalTimeToSystemTimeEx
1555UTRegister
1556UTUnRegister
1557UmsThreadYield
1558UnhandledExceptionFilter
1559UnlockFile
1560UnlockFileEx
1561UnmapViewOfFile
1562UnmapViewOfFileEx
1563UnregisterApplicationRecoveryCallback
1564UnregisterApplicationRestart
1565UnregisterBadMemoryNotification
1566UnregisterConsoleIME
1567UnregisterWait
1568UnregisterWaitEx
1569UnregisterWaitUntilOOBECompleted
1570UpdateCalendarDayOfWeek
1571UpdateProcThreadAttribute
1572UpdateResourceA
1573UpdateResourceW
1574VDMConsoleOperation
1575VDMOperationStarted
1576ValidateLCType
1577ValidateLocale
1578VerLanguageNameA
1579VerLanguageNameW
1580VerSetConditionMask
1581VerifyConsoleIoHandle
1582VerifyScripts
1583VerifyVersionInfoA
1584VerifyVersionInfoW
1585VirtualAlloc
1586VirtualAllocEx
1587VirtualAllocExNuma
1588VirtualFree
1589VirtualFreeEx
1590VirtualLock
1591VirtualProtect
1592VirtualProtectEx
1593VirtualQuery
1594VirtualQueryEx
1595VirtualUnlock
1596WTSGetActiveConsoleSessionId
1597WaitCommEvent
1598WaitForDebugEvent
1599WaitForDebugEventEx
1600WaitForMultipleObjects
1601WaitForMultipleObjectsEx
1602WaitForSingleObject
1603WaitForSingleObjectEx
1604WaitForThreadpoolIoCallbacks
1605WaitForThreadpoolTimerCallbacks
1606WaitForThreadpoolWaitCallbacks
1607WaitForThreadpoolWorkCallbacks
1608WaitNamedPipeA
1609WaitNamedPipeW
1610WakeAllConditionVariable
1611; MSDN says it's in Kernel32.dll but it's not.
1612; Link with libsynchronization.a instead.
1613; Commented out for compatibility with older
1614; versions of Windows.
1615;WaitOnAddress
1616;WakeByAddressSingle
1617;WakeByAddressAll
1618WakeConditionVariable
1619WerGetFlags
1620WerGetFlagsWorker
1621WerRegisterAdditionalProcess
1622WerRegisterAppLocalDump
1623WerRegisterCustomMetadata
1624WerRegisterExcludedMemoryBlock
1625WerRegisterFile
1626WerRegisterFileWorker
1627WerRegisterMemoryBlock
1628WerRegisterMemoryBlockWorker
1629WerRegisterRuntimeExceptionModule
1630WerRegisterRuntimeExceptionModuleWorker
1631WerSetFlags
1632WerSetFlagsWorker
1633WerUnregisterAdditionalProcess
1634WerUnregisterAppLocalDump
1635WerUnregisterCustomMetadata
1636WerUnregisterExcludedMemoryBlock
1637WerUnregisterFile
1638WerUnregisterFileWorker
1639WerUnregisterMemoryBlock
1640WerUnregisterMemoryBlockWorker
1641WerUnregisterRuntimeExceptionModule
1642WerUnregisterRuntimeExceptionModuleWorker
1643WerpCleanupMessageMapping
1644WerpGetDebugger
1645WerpInitiateRemoteRecovery
1646WerpLaunchAeDebug
1647WerpNotifyLoadStringResource
1648WerpNotifyLoadStringResourceEx
1649WerpNotifyLoadStringResourceWorker
1650WerpNotifyUseStringResource
1651WerpNotifyUseStringResourceWorker
1652WerpStringLookup
1653WideCharToMultiByte
1654WinExec
1655Wow64DisableWow64FsRedirection
1656Wow64EnableWow64FsRedirection
1657Wow64GetThreadContext
1658Wow64GetThreadSelectorEntry
1659Wow64RevertWow64FsRedirection
1660Wow64SetThreadContext
1661Wow64SuspendThread
1662WriteConsoleA
1663WriteConsoleInputA
1664WriteConsoleInputVDMA
1665WriteConsoleInputVDMW
1666WriteConsoleInputW
1667WriteConsoleOutputA
1668WriteConsoleOutputAttribute
1669WriteConsoleOutputCharacterA
1670WriteConsoleOutputCharacterW
1671WriteConsoleOutputW
1672WriteConsoleW
1673WriteFile
1674WriteFileEx
1675WriteFileGather
1676WritePrivateProfileSectionA
1677WritePrivateProfileSectionW
1678WritePrivateProfileStringA
1679WritePrivateProfileStringW
1680WritePrivateProfileStructA
1681WritePrivateProfileStructW
1682WriteProcessMemory
1683WriteProfileSectionA
1684WriteProfileSectionW
1685WriteProfileStringA
1686WriteProfileStringW
1687WriteTapemark
1688ZombifyActCtx
1689ZombifyActCtxWorker
1690__C_specific_handler
1691; This isn't always available and shouldn't be linked from here, but should
1692; be statically linked from the compiler support library.
1693;
1694__misaligned_access
1695_hread
1696_hwrite
1697_lclose
1698_lcreat
1699_llseek
1700_local_unwind
1701_lopen
1702_lread
1703_lwrite
1704lstrcat
1705lstrcatA
1706lstrcatW
1707lstrcmp
1708lstrcmpA
1709lstrcmpW
1710lstrcmpi
1711lstrcmpiA
1712lstrcmpiW
1713lstrcpy
1714lstrcpyA
1715lstrcpyW
1716lstrcpyn
1717lstrcpynA
1718lstrcpynW
1719lstrlen
1720lstrlenA
1721lstrlenW
1722;
1723; MSDN says these functions are exported
1724; from winmm.dll. Commented out for
1725; compatibility with older versions of
1726; Windows.
1727;
1728;timeBeginPeriod
1729;timeEndPeriod
1730;timeGetDevCaps
1731;timeGetSystemTime
1732;timeGetTime
1733uaw_lstrcmpW
1734uaw_lstrcmpiW
1735uaw_lstrlenW
1736uaw_wcschr
1737uaw_wcscpy
1738uaw_wcsicmp
1739uaw_wcslen
1740uaw_wcsrchr
lib/libc/mingw/lib64/winhvplatform.def deleted-68
......@@ -1,68 +0,0 @@
1LIBRARY "winhvplatform.dll"
2EXPORTS
3WHvAcceptPartitionMigration
4WHvAdviseGpaRange
5WHvAllocateVpciResource
6WHvCancelPartitionMigration
7WHvCancelRunVirtualProcessor
8WHvCompletePartitionMigration
9WHvCreateNotificationPort
10WHvCreatePartition
11WHvCreateTrigger
12WHvCreateVirtualProcessor
13WHvCreateVirtualProcessor2
14WHvCreateVpciDevice
15WHvDeleteNotificationPort
16WHvDeletePartition
17WHvDeleteTrigger
18WHvDeleteVirtualProcessor
19WHvDeleteVpciDevice
20WHvGetCapability
21WHvGetInterruptTargetVpSet
22WHvGetPartitionCounters
23WHvGetPartitionProperty
24WHvGetVirtualProcessorCounters
25WHvGetVirtualProcessorCpuidOutput
26WHvGetVirtualProcessorInterruptControllerState
27WHvGetVirtualProcessorInterruptControllerState2
28WHvGetVirtualProcessorRegisters
29WHvGetVirtualProcessorState
30WHvGetVirtualProcessorXsaveState
31WHvGetVpciDeviceInterruptTarget
32WHvGetVpciDeviceNotification
33WHvGetVpciDeviceProperty
34WHvMapGpaRange
35WHvMapGpaRange2
36WHvMapVpciDeviceInterrupt
37WHvMapVpciDeviceMmioRanges
38WHvPostVirtualProcessorSynicMessage
39WHvQueryGpaRangeDirtyBitmap
40WHvReadGpaRange
41WHvReadVpciDeviceRegister
42WHvRegisterPartitionDoorbellEvent
43WHvRequestInterrupt
44WHvRequestVpciDeviceInterrupt
45WHvResetPartition
46WHvResumePartitionTime
47WHvRetargetVpciDeviceInterrupt
48WHvRunVirtualProcessor
49WHvSetNotificationPortProperty
50WHvSetPartitionProperty
51WHvSetVirtualProcessorInterruptControllerState
52WHvSetVirtualProcessorInterruptControllerState2
53WHvSetVirtualProcessorRegisters
54WHvSetVirtualProcessorState
55WHvSetVirtualProcessorXsaveState
56WHvSetVpciDevicePowerState
57WHvSetupPartition
58WHvSignalVirtualProcessorSynicEvent
59WHvStartPartitionMigration
60WHvSuspendPartitionTime
61WHvTranslateGva
62WHvUnmapGpaRange
63WHvUnmapVpciDeviceInterrupt
64WHvUnmapVpciDeviceMmioRanges
65WHvUnregisterPartitionDoorbellEvent
66WHvUpdateTriggerParameters
67WHvWriteGpaRange
68WHvWriteVpciDeviceRegister
lib/libc/mingw/lib64/wintrust.def deleted-136
......@@ -1,136 +0,0 @@
1;
2; Exports of file WINTRUST.dll
3;
4; Autogenerated by gen_exportdef
5; Written by Kai Tietz, 2007
6;
7LIBRARY WINTRUST.dll
8EXPORTS
9CryptCATVerifyMember
10CryptSIPGetInfo
11CryptSIPGetRegWorkingFlags
12GenericChainCertificateTrust
13GenericChainFinalProv
14HTTPSCertificateTrust
15SoftpubDefCertInit
16SoftpubFreeDefUsageCallData
17SoftpubLoadDefUsageCallData
18WTHelperCertFindIssuerCertificate
19AddPersonalTrustDBPages
20CatalogCompactHashDatabase
21CryptCATAdminAcquireContext
22CryptCATAdminAddCatalog
23CryptCATAdminCalcHashFromFileHandle
24CryptCATAdminEnumCatalogFromHash
25CryptCATAdminPauseServiceForBackup
26CryptCATAdminReleaseCatalogContext
27CryptCATAdminReleaseContext
28CryptCATAdminRemoveCatalog
29CryptCATAdminResolveCatalogPath
30CryptCATCDFClose
31CryptCATCDFEnumAttributes
32CryptCATCDFEnumAttributesWithCDFTag
33CryptCATCDFEnumCatAttributes
34CryptCATCDFEnumMembers
35CryptCATCDFEnumMembersByCDFTag
36CryptCATCDFEnumMembersByCDFTagEx
37CryptCATCDFOpen
38CryptCATCatalogInfoFromContext
39CryptCATClose
40CryptCATEnumerateAttr
41CryptCATEnumerateCatAttr
42CryptCATEnumerateMember
43CryptCATGetAttrInfo
44CryptCATGetCatAttrInfo
45CryptCATGetMemberInfo
46CryptCATHandleFromStore
47CryptCATOpen
48CryptCATPersistStore
49CryptCATPutAttrInfo
50CryptCATPutCatAttrInfo
51CryptCATPutMemberInfo
52CryptCATStoreFromHandle
53CryptSIPCreateIndirectData
54CryptSIPGetSignedDataMsg
55CryptSIPPutSignedDataMsg
56CryptSIPRemoveSignedDataMsg
57CryptSIPVerifyIndirectData
58DllRegisterServer
59DllUnregisterServer
60DriverCleanupPolicy
61DriverFinalPolicy
62DriverInitializePolicy
63FindCertsByIssuer
64HTTPSFinalProv
65I_CryptCatAdminMigrateToNewCatDB
66IsCatalogFile
67MsCatConstructHashTag
68MsCatFreeHashTag
69OfficeCleanupPolicy
70OfficeInitializePolicy
71OpenPersonalTrustDBDialog
72OpenPersonalTrustDBDialogEx
73SoftpubAuthenticode
74SoftpubCheckCert
75SoftpubCleanup
76SoftpubDllRegisterServer
77SoftpubDllUnregisterServer
78SoftpubDumpStructure
79SoftpubInitialize
80SoftpubLoadMessage
81SoftpubLoadSignature
82TrustDecode
83TrustFindIssuerCertificate
84TrustFreeDecode
85TrustIsCertificateSelfSigned
86TrustOpenStores
87WTHelperCertCheckValidSignature
88WTHelperCertIsSelfSigned
89WTHelperCheckCertUsage
90WTHelperGetAgencyInfo
91WTHelperGetFileHandle
92WTHelperGetFileHash
93WTHelperGetFileName
94WTHelperGetKnownUsages
95WTHelperGetProvCertFromChain
96WTHelperGetProvPrivateDataFromChain
97WTHelperGetProvSignerFromChain
98WTHelperIsInRootStore
99WTHelperOpenKnownStores
100WTHelperProvDataFromStateData
101WVTAsn1CatMemberInfoDecode
102WVTAsn1CatMemberInfoEncode
103WVTAsn1CatNameValueDecode
104WVTAsn1CatNameValueEncode
105WVTAsn1SpcFinancialCriteriaInfoDecode
106WVTAsn1SpcFinancialCriteriaInfoEncode
107WVTAsn1SpcIndirectDataContentDecode
108WVTAsn1SpcIndirectDataContentEncode
109WVTAsn1SpcLinkDecode
110WVTAsn1SpcLinkEncode
111WVTAsn1SpcMinimalCriteriaInfoDecode
112WVTAsn1SpcMinimalCriteriaInfoEncode
113WVTAsn1SpcPeImageDataDecode
114WVTAsn1SpcPeImageDataEncode
115WVTAsn1SpcSigInfoDecode
116WVTAsn1SpcSigInfoEncode
117WVTAsn1SpcSpAgencyInfoDecode
118WVTAsn1SpcSpAgencyInfoEncode
119WVTAsn1SpcSpOpusInfoDecode
120WVTAsn1SpcSpOpusInfoEncode
121WVTAsn1SpcStatementTypeDecode
122WVTAsn1SpcStatementTypeEncode
123WinVerifyTrust
124WinVerifyTrustEx
125WintrustAddActionID
126WintrustAddDefaultForUsage
127WintrustCertificateTrust
128WintrustGetDefaultForUsage
129WintrustGetRegPolicyFlags
130WintrustLoadFunctionPointers
131WintrustRemoveActionID
132WintrustSetRegPolicyFlags
133mscat32DllRegisterServer
134mscat32DllUnregisterServer
135mssip32DllRegisterServer
136mssip32DllUnregisterServer
lib/libc/mingw/lib64/ws2_32.def created+200
......@@ -0,0 +1,200 @@
1
2LIBRARY "WS2_32.dll"
3EXPORTS
4accept
5bind
6closesocket
7connect
8getpeername
9getsockname
10getsockopt
11htonl
12htons
13ioctlsocket
14inet_addr
15inet_ntoa
16listen
17ntohl
18ntohs
19recv
20recvfrom
21select
22send
23sendto
24setsockopt
25shutdown
26socket
27WSApSetPostRoutine
28FreeAddrInfoEx
29FreeAddrInfoExW
30FreeAddrInfoW
31GetAddrInfoExA
32GetAddrInfoExCancel
33GetAddrInfoExOverlappedResult
34GetAddrInfoExW
35GetAddrInfoW
36GetHostNameW
37GetNameInfoW
38InetNtopW
39InetPtonW
40ProcessSocketNotifications
41SetAddrInfoExA
42SetAddrInfoExW
43WPUCompleteOverlappedRequest
44WPUGetProviderPathEx
45WSAAccept
46WSAAddressToStringA
47WSAAddressToStringW
48WSAAdvertiseProvider
49WSACloseEvent
50WSAConnect
51WSAConnectByList
52WSAConnectByNameA
53WSAConnectByNameW
54WSACreateEvent
55gethostbyaddr
56gethostbyname
57getprotobyname
58getprotobynumber
59getservbyname
60getservbyport
61gethostname
62WSADuplicateSocketA
63WSADuplicateSocketW
64WSAEnumNameSpaceProvidersA
65WSAEnumNameSpaceProvidersExA
66WSAEnumNameSpaceProvidersExW
67WSAEnumNameSpaceProvidersW
68WSAEnumNetworkEvents
69WSAEnumProtocolsA
70WSAEnumProtocolsW
71WSAEventSelect
72WSAGetOverlappedResult
73WSAGetQOSByName
74WSAGetServiceClassInfoA
75WSAGetServiceClassInfoW
76WSAGetServiceClassNameByClassIdA
77WSAGetServiceClassNameByClassIdW
78WSAHtonl
79WSAHtons
80WSAInstallServiceClassA
81WSAInstallServiceClassW
82WSAIoctl
83WSAJoinLeaf
84WSALookupServiceBeginA
85WSALookupServiceBeginW
86WSALookupServiceEnd
87WSALookupServiceNextA
88WSALookupServiceNextW
89WSANSPIoctl
90WSANtohl
91WSANtohs
92WSAPoll
93WSAProviderCompleteAsyncCall
94WSAProviderConfigChange
95WSARecv
96WSARecvDisconnect
97WSARecvFrom
98WSARemoveServiceClass
99WSAResetEvent
100WSASend
101WSASendDisconnect
102WSASendMsg
103WSASendTo
104WSASetEvent
105WSAAsyncSelect
106WSAAsyncGetHostByAddr
107WSAAsyncGetHostByName
108WSAAsyncGetProtoByNumber
109WSAAsyncGetProtoByName
110WSAAsyncGetServByPort
111WSAAsyncGetServByName
112WSACancelAsyncRequest
113WSASetBlockingHook
114WSAUnhookBlockingHook
115WSAGetLastError
116WSASetLastError
117WSACancelBlockingCall
118WSAIsBlocking
119WSAStartup
120WSACleanup
121WSASetServiceA
122WSASetServiceW
123WSASocketA
124WSASocketW
125WSAStringToAddressA
126WSAStringToAddressW
127WSAUnadvertiseProvider
128WSAWaitForMultipleEvents
129WSCDeinstallProvider
130WSCDeinstallProvider32
131WSCDeinstallProviderEx
132WSCEnableNSProvider
133WSCEnableNSProvider32
134WSCEnumNameSpaceProviders32
135WSCEnumNameSpaceProvidersEx32
136WSCEnumProtocols
137WSCEnumProtocolsEx
138WSCEnumProtocols32
139WSCGetApplicationCategory
140WSCGetApplicationCategoryEx
141WSCGetProviderInfo
142WSCGetProviderInfo32
143WSCGetProviderPath
144WSCGetProviderPath32
145WSCInstallNameSpace
146WSCInstallNameSpace32
147WSCInstallNameSpaceEx
148WSCInstallNameSpaceEx2
149WSCInstallNameSpaceEx32
150WSCInstallProvider
151WSCInstallProvider64_32
152WSCInstallProviderAndChains
153WSCInstallProviderAndChains64_32
154WSCInstallProviderEx
155WSCSetApplicationCategory
156WSCSetApplicationCategoryEx
157WSCSetProviderInfo
158WSCSetProviderInfo32
159WSCUnInstallNameSpace
160WSCUnInstallNameSpace32
161WSCUnInstallNameSpaceEx2
162WSCUpdateProvider
163WSCUpdateProvider32
164WSCUpdateProviderEx
165WSCWriteNameSpaceOrder
166WSCWriteNameSpaceOrder32
167WSCWriteProviderOrder
168WSCWriteProviderOrder32
169WSCWriteProviderOrderEx
170WahCloseApcHelper
171__WSAFDIsSet
172WahCloseHandleHelper
173WahCloseNotificationHandleHelper
174WahCloseSocketHandle
175WahCloseThread
176WahCompleteRequest
177WahCreateHandleContextTable
178WahCreateNotificationHandle
179WahCreateSocketHandle
180WahDestroyHandleContextTable
181WahDisableNonIFSHandleSupport
182WahEnableNonIFSHandleSupport
183WahEnumerateHandleContexts
184WahInsertHandleContext
185WahNotifyAllProcesses
186WahOpenApcHelper
187WahOpenCurrentThread
188WahOpenHandleHelper
189WahOpenNotificationHandleHelper
190WahQueueUserApc
191WahReferenceContextByHandle
192WahRemoveHandleContext
193WahWaitForNotification
194WahWriteLSPEvent
195freeaddrinfo
196getaddrinfo
197getnameinfo
198inet_ntop
199inet_pton
200WEP
lib/libc/mingw/libarm32/bcryptprimitives.def deleted-15
......@@ -1,15 +0,0 @@
1;
2; Definition file of bcryptPrimitives.dll
3; Automatic generated by gendef
4; written by Kai Tietz 2008-2014
5;
6LIBRARY "bcryptPrimitives.dll"
7EXPORTS
8GetAsymmetricEncryptionInterface
9GetCipherInterface
10GetHashInterface
11GetKeyDerivationInterface
12GetRngInterface
13GetSecretAgreementInterface
14GetSignatureInterface
15ProcessPrng
lib/libc/mingw/libarm32/kernelbase.def+2-2
......@@ -1886,10 +1886,10 @@ _exit
18861886_initterm
18871887_initterm_e
18881888_invalid_parameter
1889_onexit
1889; _onexit ; disable _onexit for compatibility with DLL builds, real _onexit function provided by mingw-w64
18901890_purecall
18911891_time64
1892atexit
1892_crt_atexit == atexit ; rename atexit to _crt_atexit for compatibility with UCRT, real atexit function provided by mingw-w64
18931893exit
18941894hgets
18951895hwprintf
lib/libc/mingw/libarm32/ninput.def deleted-37
......@@ -1,37 +0,0 @@
1;
2; Definition file of NInput.dll
3; Automatic generated by gendef
4; written by Kai Tietz 2008-2014
5;
6LIBRARY "NInput.dll"
7EXPORTS
8DefaultInputHandler
9AddPointerInteractionContext
10BufferPointerPacketsInteractionContext
11CreateInteractionContext
12DestroyInteractionContext
13GetCrossSlideParameterInteractionContext
14GetInertiaParameterInteractionContext
15GetInteractionConfigurationInteractionContext
16GetMouseWheelParameterInteractionContext
17GetPropertyInteractionContext
18GetStateInteractionContext
19ProcessBufferedPacketsInteractionContext
20ProcessInertiaInteractionContext
21ProcessPointerFramesInteractionContext
22RegisterOutputCallbackInteractionContext
23RemovePointerInteractionContext
24ResetInteractionContext
25SetCrossSlideParametersInteractionContext
26SetInertiaParameterInteractionContext
27SetInteractionConfigurationInteractionContext
28SetMouseWheelParameterInteractionContext
29SetPivotInteractionContext
30SetPropertyInteractionContext
31StopInteractionContext
32ord_2500 @2500
33ord_2501 @2501
34ord_2502 @2502
35ord_2503 @2503
36ord_2504 @2504
37ord_2505 @2505
lib/libc/mingw/libarm32/winbrand.def deleted-19
......@@ -1,19 +0,0 @@
1;
2; Definition file of WINBRAND.dll
3; Automatic generated by gendef
4; written by Kai Tietz 2008-2014
5;
6LIBRARY "WINBRAND.dll"
7EXPORTS
8BrandingFormatString
9BrandingLoadBitmap
10BrandingLoadCursor
11BrandingLoadIcon
12BrandingLoadImage
13BrandingLoadString
14EulaFreeBuffer
15GetEULAFile
16GetEULAInCurrentUILanguage
17GetHinstanceByNameSpace
18GetInstalledEULAPath
19InstallEULA
lib/libc/mingw/libarm32/wintrust.def deleted-150
......@@ -1,150 +0,0 @@
1;
2; Definition file of WINTRUST.dll
3; Automatic generated by gendef
4; written by Kai Tietz 2008-2014
5;
6LIBRARY "WINTRUST.dll"
7EXPORTS
8CryptCATVerifyMember
9CryptSIPGetInfo
10CryptSIPGetRegWorkingFlags
11GenericChainCertificateTrust
12GenericChainFinalProv
13HTTPSCertificateTrust
14SoftpubDefCertInit
15SoftpubFreeDefUsageCallData
16SoftpubLoadDefUsageCallData
17WTHelperCertFindIssuerCertificate
18AddPersonalTrustDBPages
19CatalogCompactHashDatabase
20CryptCATAdminAcquireContext
21CryptCATAdminAcquireContext2
22CryptCATAdminAddCatalog
23CryptCATAdminCalcHashFromFileHandle
24CryptCATAdminCalcHashFromFileHandle2
25CryptCATAdminEnumCatalogFromHash
26CryptCATAdminPauseServiceForBackup
27CryptCATAdminReleaseCatalogContext
28CryptCATAdminReleaseContext
29CryptCATAdminRemoveCatalog
30CryptCATAdminResolveCatalogPath
31CryptCATAllocSortedMemberInfo
32CryptCATCDFClose
33CryptCATCDFEnumAttributes
34CryptCATCDFEnumAttributesWithCDFTag
35CryptCATCDFEnumCatAttributes
36CryptCATCDFEnumMembers
37CryptCATCDFEnumMembersByCDFTag
38CryptCATCDFEnumMembersByCDFTagEx
39CryptCATCDFOpen
40CryptCATCatalogInfoFromContext
41CryptCATClose
42CryptCATEnumerateAttr
43CryptCATEnumerateCatAttr
44CryptCATEnumerateMember
45CryptCATFreeSortedMemberInfo
46CryptCATGetAttrInfo
47CryptCATGetCatAttrInfo
48CryptCATGetMemberInfo
49CryptCATHandleFromStore
50CryptCATOpen
51CryptCATPersistStore
52CryptCATPutAttrInfo
53CryptCATPutCatAttrInfo
54CryptCATPutMemberInfo
55CryptCATStoreFromHandle
56CryptSIPCreateIndirectData
57CryptSIPGetCaps
58CryptSIPGetSealedDigest
59CryptSIPGetSignedDataMsg
60CryptSIPPutSignedDataMsg
61CryptSIPRemoveSignedDataMsg
62CryptSIPVerifyIndirectData
63DriverCleanupPolicy
64DriverFinalPolicy
65DriverInitializePolicy
66FindCertsByIssuer
67HTTPSFinalProv
68IsCatalogFile
69MsCatConstructHashTag
70MsCatFreeHashTag
71OfficeCleanupPolicy
72OfficeInitializePolicy
73OpenPersonalTrustDBDialog
74OpenPersonalTrustDBDialogEx
75SoftpubAuthenticode
76SoftpubCheckCert
77SoftpubCleanup
78SoftpubDllRegisterServer
79SoftpubDllUnregisterServer
80SoftpubDumpStructure
81SoftpubInitialize
82SoftpubLoadMessage
83SoftpubLoadSignature
84TrustDecode
85TrustFindIssuerCertificate
86TrustFreeDecode
87TrustIsCertificateSelfSigned
88TrustOpenStores
89WTGetSignatureInfo
90WTHelperCertCheckValidSignature
91WTHelperCertIsSelfSigned
92WTHelperCheckCertUsage
93WTHelperGetAgencyInfo
94WTHelperGetFileHandle
95WTHelperGetFileHash
96WTHelperGetFileName
97WTHelperGetKnownUsages
98WTHelperGetProvCertFromChain
99WTHelperGetProvPrivateDataFromChain
100WTHelperGetProvSignerFromChain
101WTHelperIsChainedToMicrosoft
102WTHelperIsChainedToMicrosoftFromStateData
103WTHelperIsInRootStore
104WTHelperOpenKnownStores
105WTHelperProvDataFromStateData
106WVTAsn1CatMemberInfo2Decode
107WVTAsn1CatMemberInfo2Encode
108WVTAsn1CatMemberInfoDecode
109WVTAsn1CatMemberInfoEncode
110WVTAsn1CatNameValueDecode
111WVTAsn1CatNameValueEncode
112WVTAsn1IntentToSealAttributeDecode
113WVTAsn1IntentToSealAttributeEncode
114WVTAsn1SealingSignatureAttributeDecode
115WVTAsn1SealingSignatureAttributeEncode
116WVTAsn1SealingTimestampAttributeDecode
117WVTAsn1SealingTimestampAttributeEncode
118WVTAsn1SpcFinancialCriteriaInfoDecode
119WVTAsn1SpcFinancialCriteriaInfoEncode
120WVTAsn1SpcIndirectDataContentDecode
121WVTAsn1SpcIndirectDataContentEncode
122WVTAsn1SpcLinkDecode
123WVTAsn1SpcLinkEncode
124WVTAsn1SpcMinimalCriteriaInfoDecode
125WVTAsn1SpcMinimalCriteriaInfoEncode
126WVTAsn1SpcPeImageDataDecode
127WVTAsn1SpcPeImageDataEncode
128WVTAsn1SpcSigInfoDecode
129WVTAsn1SpcSigInfoEncode
130WVTAsn1SpcSpAgencyInfoDecode
131WVTAsn1SpcSpAgencyInfoEncode
132WVTAsn1SpcSpOpusInfoDecode
133WVTAsn1SpcSpOpusInfoEncode
134WVTAsn1SpcStatementTypeDecode
135WVTAsn1SpcStatementTypeEncode
136WinVerifyTrust
137WinVerifyTrustEx
138WintrustAddActionID
139WintrustAddDefaultForUsage
140WintrustCertificateTrust
141WintrustGetDefaultForUsage
142WintrustGetRegPolicyFlags
143WintrustLoadFunctionPointers
144WintrustRemoveActionID
145WintrustSetDefaultIncludePEPageHashes
146WintrustSetRegPolicyFlags
147mscat32DllRegisterServer
148mscat32DllUnregisterServer
149mssip32DllRegisterServer
150mssip32DllUnregisterServer
lib/libc/mingw/libsrc/largeint.c created+121
......@@ -0,0 +1,121 @@
1#if 0
2/*
3 largeint.c
4
5 Large (64 bits) integer arithmetics library
6
7 Written by Anders Norlander <anorland@hem2.passagen.se>
8
9 This file is part of a free library for the Win32 API.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
15*/
16
17#define __COMPILING_LARGEINT
18
19#include <largeint.h>
20
21__int64 WINAPI
22LargeIntegerAdd (__int64 i1, __int64 i2)
23{
24 return i1 + i2;
25}
26
27__int64 WINAPI
28LargeIntegerSubtract (__int64 i1, __int64 i2)
29{
30 return i1 - i2;
31}
32
33__int64 WINAPI
34LargeIntegerArithmeticShift (__int64 i, int n)
35{
36 return i >> n;
37}
38
39__int64 WINAPI
40LargeIntegerShiftLeft (__int64 i, int n)
41{
42 return i << n;
43}
44
45__int64 WINAPI
46LargeIntegerShiftRight (__int64 i, int n)
47{
48 return i >> n;
49}
50
51__int64 WINAPI
52LargeIntegerNegate (__int64 i)
53{
54 return -i;
55}
56
57__int64 WINAPI
58ConvertLongToLargeInteger (LONG l)
59{
60 return (__int64) l;
61}
62
63__int64 WINAPI
64ConvertUlongToLargeInteger (ULONG ul)
65{
66 return _toi(_toui(ul));
67}
68
69__int64 WINAPI
70EnlargedIntegerMultiply (LONG l1, LONG l2)
71{
72 return _toi(l1) * _toi(l2);
73}
74
75__int64 WINAPI
76EnlargedUnsignedMultiply (ULONG ul1, ULONG ul2)
77{
78 return _toi(_toui(ul1) * _toui(ul2));
79}
80
81__int64 WINAPI
82ExtendedIntegerMultiply (__int64 i, LONG l)
83{
84 return i * _toi(l);
85}
86
87__int64 WINAPI
88LargeIntegerMultiply (__int64 i1, __int64 i2)
89{
90 return i1 * i2;
91}
92
93__int64 WINAPI LargeIntegerDivide (__int64 i1, __int64 i2, __int64 *remainder)
94{
95 if (remainder)
96 *remainder = i1 % i2;
97 return i1 / i2;
98}
99
100ULONG WINAPI
101EnlargedUnsignedDivide (unsigned __int64 i1, ULONG i2, PULONG remainder)
102{
103 if (remainder)
104 *remainder = i1 % _toi(i2);
105 return i1 / _toi(i2);
106}
107__int64 WINAPI
108ExtendedLargeIntegerDivide (__int64 i1, ULONG i2, PULONG remainder)
109{
110 if (remainder)
111 *remainder = i1 % _toi(i2);
112 return i1 / _toi(i2);
113}
114
115/* FIXME: what is this function supposed to do? */
116__int64 WINAPI ExtendedMagicDivide (__int64 i1, __int64 i2, int n)
117{
118 return 0;
119}
120#endif
121
lib/libc/mingw/libsrc/mfuuid.c+1-1
......@@ -1,4 +1,3 @@
1
21#include <windows.h>
32#include <propsys.h>
43#include <mediaobj.h>
......@@ -9,4 +8,5 @@
98#include <mfd3d12.h>
109#include <mfidl.h>
1110#include <mfmediacapture.h>
11#include <mfmediaengine.h>
1212#include <mfreadwrite.h>
lib/libc/mingw/libsrc/mingwthrd_mt.c created+5
......@@ -0,0 +1,5 @@
1/* As _CRT_MT is getting defined in libgcc when using shared version, or it is getting defined by startup code itself,
2 this library is a dummy version for supporting the link library for gcc's option -mthreads. As we support TLS-cleanup
3 even without specifying this library, this library is deprecated and just kept for compatibility. */
4int _CRT_MT_OLD = 1;
5
lib/libc/mingw/libsrc/scrnsave.c created+415
......@@ -0,0 +1,415 @@
1/*
2 Screen saver library by Anders Norlander <anorland@hem2.passagen.se>
3
4 This library is (hopefully) compatible with Microsoft's
5 screen saver library.
6
7 This is public domain software.
8
9 */
10#include <windows.h>
11#include <scrnsave.h>
12#include <regstr.h>
13
14/* screen saver window class */
15#define CLASS_SCRNSAVE TEXT("WindowsScreenSaverClass")
16
17/* globals */
18HWND hMainWindow = NULL;
19BOOL fChildPreview = FALSE;
20HINSTANCE hMainInstance;
21TCHAR szName[TITLEBARNAMELEN];
22TCHAR szAppName[APPNAMEBUFFERLEN];
23TCHAR szIniFile[MAXFILELEN];
24TCHAR szScreenSaver[22];
25TCHAR szHelpFile[MAXFILELEN];
26TCHAR szNoHelpMemory[BUFFLEN];
27UINT MyHelpMessage;
28
29/* local house keeping */
30static HINSTANCE hPwdLib = NULL;
31static POINT pt_orig;
32static BOOL checking_pwd = FALSE;
33static BOOL closing = FALSE;
34static BOOL w95 = FALSE;
35
36typedef void (*PVFV)(void);
37typedef BOOL (WINAPI *VERIFYPWDPROC)(HWND);
38typedef DWORD (WINAPI *CHPWDPROC)(LPCTSTR, HWND, DWORD, PVOID);
39static VERIFYPWDPROC VerifyScreenSavePwd = NULL;
40
41/* function names */
42#define szVerifyPassword "VerifyScreenSavePwd"
43
44#ifdef UNICODE
45#define szPwdChangePassword "PwdChangePasswordW"
46#else
47#define szPwdChangePassword "PwdChangePasswordA"
48#endif
49
50static void TerminateScreenSaver(HWND hWnd);
51static BOOL RegisterClasses(void);
52static LRESULT WINAPI SysScreenSaverProc(HWND,UINT,WPARAM,LPARAM);
53static int LaunchScreenSaver(HWND hParent);
54static void LaunchConfig(void);
55
56static int ISSPACE(char c)
57{
58 return (c == ' ' || c == '\t');
59}
60
61static ULONG_PTR parse_ulptr(const char *s)
62{
63 ULONG_PTR res, n;
64 const char *p;
65 for (p = s; *p; p++)
66 if (*p < '0' || *p > '9')
67 break;
68 p--;
69 res = 0;
70 for (n = 1; p >= s; p--, n *= 10)
71 res += (*p - '0') * n;
72 return res;
73}
74
75/* screen saver entry point */
76int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hPrevInst,
77 LPSTR CmdLine, int nCmdShow)
78{
79 LPSTR p;
80 OSVERSIONINFO vi;
81
82 UNREFERENCED_PARAMETER(hPrevInst);
83 UNREFERENCED_PARAMETER(nCmdShow);
84
85 /* initialize */
86 hMainInstance = hInst;
87
88 vi.dwOSVersionInfoSize = sizeof(vi);
89 GetVersionEx(&vi);
90 /* check if we are going to check for passwords */
91 if (vi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
92 {
93 HKEY hKey;
94 /* we are using windows 95 */
95 w95 = TRUE;
96 if (RegOpenKey(HKEY_CURRENT_USER, REGSTR_PATH_SCREENSAVE ,&hKey) ==
97 ERROR_SUCCESS)
98 {
99 DWORD check_pwd;
100 DWORD size = sizeof(DWORD);
101 DWORD type;
102 LONG res;
103 res = RegQueryValueEx(hKey, REGSTR_VALUE_USESCRPASSWORD,
104 NULL, &type, (PBYTE) &check_pwd, &size);
105 if (check_pwd && res == ERROR_SUCCESS)
106 {
107 hPwdLib = LoadLibrary(TEXT("PASSWORD.CPL"));
108 if (hPwdLib)
109 VerifyScreenSavePwd = (VERIFYPWDPROC)(PVFV) GetProcAddress(hPwdLib, szVerifyPassword);
110 }
111 RegCloseKey(hKey);
112 }
113 }
114
115 /* parse arguments */
116 for (p = CmdLine; *p; p++)
117 {
118 switch (*p)
119 {
120 case 'S':
121 case 's':
122 /* start screen saver */
123 return LaunchScreenSaver(NULL);
124
125 case 'P':
126 case 'p':
127 {
128 /* start screen saver in preview window */
129 HWND hParent;
130 fChildPreview = TRUE;
131 while (ISSPACE(*++p));
132 hParent = (HWND) parse_ulptr(p);
133 if (hParent && IsWindow(hParent))
134 return LaunchScreenSaver(hParent);
135 }
136 return 0;
137
138 case 'C':
139 case 'c':
140 /* display configure dialog */
141 LaunchConfig();
142 return 0;
143
144 case 'A':
145 case 'a':
146 {
147 /* change screen saver password */
148 HWND hParent;
149 while (ISSPACE(*++p));
150 hParent = (HWND) parse_ulptr(p);
151 if (!hParent || !IsWindow(hParent))
152 hParent = GetForegroundWindow();
153 ScreenSaverChangePassword(hParent);
154 }
155 return 0;
156
157 case '-':
158 case '/':
159 case ' ':
160 default:
161 break;
162 }
163 }
164 LaunchConfig();
165 return 0;
166}
167
168static void LaunchConfig(void)
169{
170 /* FIXME: should this be called */
171 RegisterDialogClasses(hMainInstance);
172 /* display configure dialog */
173 DialogBox(hMainInstance, MAKEINTRESOURCE(DLG_SCRNSAVECONFIGURE),
174 GetForegroundWindow(), (DLGPROC)(PVFV) ScreenSaverConfigureDialog);
175}
176
177
178static int LaunchScreenSaver(HWND hParent)
179{
180 BOOL foo;
181 UINT style;
182 RECT rc;
183 MSG msg;
184
185 /* don't allow other tasks to get into the foreground */
186 if (w95 && !fChildPreview)
187 SystemParametersInfo(SPI_SCREENSAVERRUNNING, TRUE, &foo, 0);
188
189 msg.wParam = 0;
190
191 /* register classes, both user defined and classes used by screen saver
192 library */
193 if (!RegisterClasses())
194 {
195 MessageBox(NULL, TEXT("RegisterClasses() failed"), NULL, MB_ICONHAND);
196 goto restore;
197 }
198
199 /* a slightly different approach needs to be used when displaying
200 in a preview window */
201 if (hParent)
202 {
203 style = WS_CHILD;
204 GetClientRect(hParent, &rc);
205 }
206 else
207 {
208 style = WS_POPUP;
209 rc.left = GetSystemMetrics(SM_XVIRTUALSCREEN);
210 rc.top = GetSystemMetrics(SM_YVIRTUALSCREEN);
211 rc.right = GetSystemMetrics(SM_CXVIRTUALSCREEN);
212 rc.bottom = GetSystemMetrics(SM_CYVIRTUALSCREEN);
213 style |= WS_VISIBLE;
214 }
215
216 /* create main screen saver window */
217 hMainWindow = CreateWindowEx(hParent ? 0 : WS_EX_TOPMOST, CLASS_SCRNSAVE,
218 TEXT("SCREENSAVER"), style,
219 rc.left, rc.top, rc.right, rc.bottom, hParent, NULL,
220 hMainInstance, NULL);
221
222 /* display window and start pumping messages */
223 if (hMainWindow)
224 {
225 UpdateWindow(hMainWindow);
226 ShowWindow(hMainWindow, SW_SHOW);
227
228 while (GetMessage(&msg, NULL, 0, 0) == TRUE)
229 {
230 TranslateMessage(&msg);
231 DispatchMessage(&msg);
232 }
233 }
234
235restore:
236 /* restore system */
237 if (w95 && !fChildPreview)
238 SystemParametersInfo(SPI_SCREENSAVERRUNNING, FALSE, &foo, 0);
239 FreeLibrary(hPwdLib);
240 return msg.wParam;
241}
242
243/* this function takes care of *must* do tasks, like terminating
244 screen saver */
245static LRESULT WINAPI SysScreenSaverProc(HWND hWnd, UINT msg,
246 WPARAM wParam, LPARAM lParam)
247{
248 switch (msg)
249 {
250 case WM_CREATE:
251 if (!fChildPreview)
252 SetCursor(NULL);
253 /* mouse is not supposed to move from this position */
254 GetCursorPos(&pt_orig);
255 break;
256 case WM_DESTROY:
257 PostQuitMessage(0);
258 break;
259 case WM_TIMER:
260 if (closing)
261 return 0;
262 break;
263 case WM_PAINT:
264 if (closing)
265 return DefWindowProc(hWnd, msg, wParam, lParam);
266 break;
267 case WM_SYSCOMMAND:
268 if (!fChildPreview)
269 switch (wParam)
270 {
271 case SC_CLOSE:
272 case SC_SCREENSAVE:
273 case SC_NEXTWINDOW:
274 case SC_PREVWINDOW:
275 return FALSE;
276 }
277 break;
278 case WM_MOUSEMOVE:
279 case WM_LBUTTONDOWN:
280 case WM_RBUTTONDOWN:
281 case WM_MBUTTONDOWN:
282 case WM_KEYDOWN:
283 case WM_SYSKEYDOWN:
284 case WM_NCACTIVATE:
285 case WM_ACTIVATE:
286 case WM_ACTIVATEAPP:
287 if (closing)
288 return DefWindowProc(hWnd, msg, wParam, lParam);
289 break;
290 }
291 return ScreenSaverProc(hWnd, msg, wParam, lParam);
292}
293
294LRESULT WINAPI DefScreenSaverProc(HWND hWnd, UINT msg,
295 WPARAM wParam, LPARAM lParam)
296{
297 /* don't do any special processing when in preview mode */
298 if (fChildPreview || closing)
299 return DefWindowProc(hWnd, msg, wParam, lParam);
300
301 switch (msg)
302 {
303 case WM_CLOSE:
304 TerminateScreenSaver(hWnd);
305 /* do NOT pass this to DefWindowProc; it will terminate even if
306 an invalid password was given.
307 */
308 return 0;
309 case SCRM_VERIFYPW:
310 /* verify password or return TRUE if password checking is turned off */
311 if (VerifyScreenSavePwd)
312 return VerifyScreenSavePwd(hWnd);
313 else
314 return TRUE;
315 case WM_SETCURSOR:
316 if (checking_pwd)
317 break;
318 SetCursor(NULL);
319 return TRUE;
320 case WM_NCACTIVATE:
321 case WM_ACTIVATE:
322 case WM_ACTIVATEAPP:
323 /* if wParam is FALSE then I am losing focus */
324 if (wParam == FALSE && !checking_pwd)
325 PostMessage(hWnd, WM_CLOSE, 0, 0);
326 break;
327 case WM_MOUSEMOVE:
328 {
329 POINT pt;
330 GetCursorPos(&pt);
331 if (pt.x == pt_orig.x && pt.y == pt_orig.y)
332 break;
333 /* mouse moved */
334 }
335 /* fallthrough */
336 case WM_LBUTTONDOWN:
337 case WM_RBUTTONDOWN:
338 case WM_MBUTTONDOWN:
339 case WM_KEYDOWN:
340 case WM_SYSKEYDOWN:
341 /* try to terminate screen saver */
342 if (!checking_pwd)
343 PostMessage(hWnd, WM_CLOSE, 0, 0);
344 break;
345 }
346 return DefWindowProc(hWnd, msg, wParam, lParam);
347}
348
349static void TerminateScreenSaver(HWND hWnd)
350{
351 /* don't allow recursion */
352 if (checking_pwd || closing)
353 return;
354
355 /* verify password */
356 if (VerifyScreenSavePwd)
357 {
358 checking_pwd = TRUE;
359 closing = SendMessage(hWnd, SCRM_VERIFYPW, 0, 0);
360 checking_pwd = FALSE;
361 }
362 else
363 closing = TRUE;
364
365 /* are we closing? */
366 if (closing)
367 {
368 DestroyWindow(hWnd);
369 }
370 else
371 GetCursorPos(&pt_orig); /* if not: get new mouse position */
372}
373
374/*
375 Register screen saver window class and call user
376 supplied hook.
377 */
378static BOOL RegisterClasses(void)
379{
380 WNDCLASS cls;
381
382 cls.hCursor = NULL;
383 cls.hIcon = LoadIcon(hMainInstance, MAKEINTATOM(ID_APP));
384 cls.lpszMenuName = NULL;
385 cls.lpszClassName = CLASS_SCRNSAVE;
386 cls.hbrBackground = GetStockObject(BLACK_BRUSH);
387 cls.hInstance = hMainInstance;
388 cls.style = CS_VREDRAW | CS_HREDRAW | CS_SAVEBITS | CS_PARENTDC;
389 cls.lpfnWndProc = SysScreenSaverProc;
390 cls.cbWndExtra = 0;
391 cls.cbClsExtra = 0;
392
393 if (!RegisterClass(&cls))
394 return FALSE;
395
396 return RegisterDialogClasses(hMainInstance);
397}
398
399void WINAPI ScreenSaverChangePassword(HWND hParent)
400{
401 /* load Master Password Router (MPR) */
402 HINSTANCE hMpr = LoadLibrary(TEXT("MPR.DLL"));
403
404 if (hMpr)
405 {
406 CHPWDPROC ChangePassword;
407 ChangePassword = (CHPWDPROC)(PVFV) GetProcAddress(hMpr, szPwdChangePassword);
408
409 /* change password for screen saver provider */
410 if (ChangePassword)
411 ChangePassword(TEXT("SCRSAVE"), hParent, 0, NULL);
412
413 FreeLibrary(hMpr);
414 }
415}
lib/libc/mingw/libsrc/uuid.c+1
......@@ -15,6 +15,7 @@
1515#include <basetyps.h>
1616
1717#include <credentialprovider.h>
18#include <functiondiscoverykeys.h>
1819#include <textstor.h>
1920#include <shobjidl.h>
2021#include <propkey.h>
lib/libc/mingw/libsrc/wspiapi/WspiapiFreeAddrInfo.c+1-1
......@@ -12,6 +12,6 @@ WspiapiFreeAddrInfo (struct addrinfo *ai)
1212 static WSPIAPI_PFREEADDRINFO pfFreeAddrInfo = NULL;
1313
1414 if (!pfFreeAddrInfo)
15 pfFreeAddrInfo = (WSPIAPI_PFREEADDRINFO) WspiapiLoad(2);
15 pfFreeAddrInfo = (WSPIAPI_PFREEADDRINFO)(void(*)(void)) WspiapiLoad(2);
1616 (*pfFreeAddrInfo) (ai);
1717}
lib/libc/mingw/libsrc/wspiapi/WspiapiGetAddrInfo.c+1-1
......@@ -14,7 +14,7 @@ WspiapiGetAddrInfo(const char *nodename, const char *servname,
1414 int err;
1515
1616 if (!pfGetAddrInfo)
17 pfGetAddrInfo = (WSPIAPI_PGETADDRINFO) WspiapiLoad (0);
17 pfGetAddrInfo = (void*) WspiapiLoad (0);
1818 err = (*pfGetAddrInfo) (nodename, servname, hints, res);
1919 WSASetLastError (err);
2020 return err;
lib/libc/mingw/libsrc/wspiapi/WspiapiGetNameInfo.c+1-1
......@@ -15,7 +15,7 @@ WspiapiGetNameInfo (const struct sockaddr *sa, socklen_t salen,
1515 int err;
1616
1717 if (!pfGetNameInfo)
18 pfGetNameInfo = (WSPIAPI_PGETNAMEINFO) WspiapiLoad(1);
18 pfGetNameInfo = (void*) WspiapiLoad(1);
1919 err = (*pfGetNameInfo) (sa, salen, host, hostlen, serv, servlen, flags);
2020 WSASetLastError (err);
2121 return err;
lib/libc/mingw/math/_huge.c+6-1
......@@ -1,2 +1,7 @@
11/* For UCRT, positive infinity */
2double const _HUGE = __builtin_huge_val();
2#include <_mingw.h>
3#undef _HUGE
4static double _HUGE = __builtin_huge_val();
5double * __MINGW_IMP_SYMBOL(_HUGE) = &_HUGE;
6#undef HUGE
7extern double * __attribute__ ((alias (__MINGW64_STRINGIFY(__MINGW_IMP_SYMBOL(_HUGE))))) __MINGW_IMP_SYMBOL(HUGE);
lib/libc/mingw/math/copysign.c created+21
......@@ -0,0 +1,21 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6#include <math.h>
7
8typedef union U
9{
10 unsigned int u[2];
11 double d;
12} U;
13
14double copysign(double x, double y)
15{
16 U h,j;
17 h.d = x;
18 j.d = y;
19 h.u[1] = (h.u[1] & 0x7fffffff) | (j.u[1] & 0x80000000);
20 return h.d;
21}
lib/libc/mingw/math/copysignf.c created+19
......@@ -0,0 +1,19 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6#include <math.h>
7
8typedef union ui_f {
9 float f;
10 unsigned int ui;
11} ui_f;
12
13float copysignf(float aX, float aY)
14{
15 ui_f x,y;
16 x.f=aX; y.f=aY;
17 x.ui= (x.ui & 0x7fffffff) | (y.ui & 0x80000000);
18 return x.f;
19}
lib/libc/mingw/misc/__initenv.c+1-3
......@@ -4,9 +4,7 @@
44 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
55 */
66
7#include <internal.h>
7#include <_mingw.h>
88
99static char ** local__initenv;
10static wchar_t ** local__winitenv;
1110char *** __MINGW_IMP_SYMBOL(__initenv) = &local__initenv;
12wchar_t *** __MINGW_IMP_SYMBOL(__winitenv) = &local__winitenv;
lib/libc/mingw/misc/__p___initenv.c created+16
......@@ -0,0 +1,16 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#include <_mingw.h>
8
9extern char*** __MINGW_IMP_SYMBOL(__initenv);
10
11char*** __cdecl __p___initenv(void);
12char*** __cdecl __p___initenv(void)
13{
14 return __MINGW_IMP_SYMBOL(__initenv);
15}
16char*** (__cdecl *__MINGW_IMP_SYMBOL(__p___initenv))(void) = __p___initenv;
lib/libc/mingw/misc/__p___winitenv.c created+17
......@@ -0,0 +1,17 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#include <_mingw.h>
8#include <stddef.h>
9
10extern wchar_t*** __MINGW_IMP_SYMBOL(__winitenv);
11
12wchar_t*** __cdecl __p___winitenv(void);
13wchar_t*** __cdecl __p___winitenv(void)
14{
15 return __MINGW_IMP_SYMBOL(__winitenv);
16}
17wchar_t*** (__cdecl *__MINGW_IMP_SYMBOL(__p___winitenv))(void) = __p___winitenv;
lib/libc/mingw/misc/__winitenv.c created+11
......@@ -0,0 +1,11 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#include <_mingw.h>
8#include <stddef.h>
9
10static wchar_t ** local__winitenv;
11wchar_t *** __MINGW_IMP_SYMBOL(__winitenv) = &local__winitenv;
lib/libc/mingw/misc/_onexit.c created+16
......@@ -0,0 +1,16 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#include <stdlib.h>
8
9_onexit_t __cdecl _onexit(_onexit_t func)
10{
11 return atexit((void (__cdecl *)(void))func) == 0 ? func : NULL;
12}
13_onexit_t __cdecl (*__MINGW_IMP_SYMBOL(_onexit))(_onexit_t func) = _onexit;
14
15_onexit_t __attribute__ ((alias ("_onexit"))) __cdecl onexit(_onexit_t);
16extern _onexit_t (__cdecl * __attribute__ ((alias (__MINGW64_STRINGIFY(__MINGW_IMP_SYMBOL(_onexit))))) __MINGW_IMP_SYMBOL(onexit))(_onexit_t);
lib/libc/mingw/misc/delayimp.c+1-1
......@@ -177,7 +177,7 @@ FARPROC WINAPI __delayLoadHelper2(PCImgDelayDescr pidd,FARPROC *ppfnIATEntry)
177177 if(hmod==0) {
178178 if(__pfnDliNotifyHook2)
179179 hmod = (HMODULE) (((*__pfnDliNotifyHook2)(dliNotePreLoadLibrary,&dli)));
180 if(hmod==0) hmod = LoadLibrary(dli.szDll);
180 if(hmod==0) hmod = LoadLibraryA(dli.szDll);
181181 if(hmod==0) {
182182 dli.dwLastError = GetLastError();
183183 if(__pfnDliFailureHook2)
lib/libc/mingw/misc/dllentrypoint.c created+18
......@@ -0,0 +1,18 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#include <oscalls.h>
8#define _DECL_DLLMAIN
9#include <process.h>
10
11BOOL WINAPI DllEntryPoint (HANDLE, DWORD, LPVOID);
12
13BOOL WINAPI DllEntryPoint (HANDLE __UNUSED_PARAM(hDllHandle),
14 DWORD __UNUSED_PARAM(dwReason),
15 LPVOID __UNUSED_PARAM(lpreserved))
16{
17 return TRUE;
18}
lib/libc/mingw/misc/dllmain.c created+10
......@@ -0,0 +1,10 @@
1#include <oscalls.h>
2#define _DECL_DLLMAIN
3#include <process.h>
4
5BOOL WINAPI DllMain (HANDLE __UNUSED_PARAM(hDllHandle),
6 DWORD __UNUSED_PARAM(dwReason),
7 LPVOID __UNUSED_PARAM(lpreserved))
8{
9 return TRUE;
10}
lib/libc/mingw/misc/feclearexcept.c+2-29
......@@ -3,36 +3,9 @@
33 * This file is part of the mingw-w64 runtime package.
44 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
55 */
6#include <fenv.h>
7
8#if !(defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__))
9int __mingw_has_sse (void);
106
11int __mingw_has_sse(void)
12{
13 int cpuInfo[4],infoType = 1;
14
15#ifndef _WIN64
16 int o_flag, n_flag;
17
18 __asm__ volatile ("pushfl\n\tpopl %0" : "=mr" (o_flag));
19 n_flag = o_flag ^ 0x200000;
20 __asm__ volatile ("pushl %0\n\tpopfl" : : "g" (n_flag));
21 __asm__ volatile ("pushfl\n\tpopl %0" : "=mr" (n_flag));
22 if (n_flag == o_flag)
23 return 0;
24#endif
25
26 __asm__ __volatile__ (
27 "cpuid"
28 : "=a" (cpuInfo[0]), "=b" (cpuInfo[1]), "=c" (cpuInfo[2]),
29 "=d" (cpuInfo[3])
30 : "a" (infoType));
31 if (cpuInfo[3] & 0x2000000)
32 return 1;
33 return 0;
34}
35#endif /* !(defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__)) */
7#include <fenv.h>
8#include <internal.h>
369
3710/* 7.6.2.1
3811 The feclearexcept function clears the supported exceptions
lib/libc/mingw/misc/fegetenv.c+2-4
......@@ -3,11 +3,9 @@
33 * This file is part of the mingw-w64 runtime package.
44 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
55 */
6#include <fenv.h>
76
8#if !(defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__))
9int __mingw_has_sse (void);
10#endif /* !(defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__)) */
7#include <fenv.h>
8#include <internal.h>
119
1210/* 7.6.4.1
1311 The fegetenv function stores the current floating-point environment
lib/libc/mingw/misc/fegetexceptflag.c+4-6
......@@ -3,13 +3,11 @@
33 * This file is part of the mingw-w64 runtime package.
44 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
55 */
6#include <fenv.h>
76
8#if !(defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__))
9extern int __mingw_has_sse (void);
10#endif /* !(defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__)) */
7#include <fenv.h>
8#include <internal.h>
119
12/* 7.6.2.2
10/* 7.6.2.2
1311 The fegetexceptflag function stores an implementation-defined
1412 representation of the exception flags indicated by the argument
1513 excepts in the object pointed to by the argument flagp. */
......@@ -32,7 +30,7 @@ int fegetexceptflag (fexcept_t * flagp, int excepts)
3230 _mxcsr = 0;
3331 if (__mingw_has_sse ())
3432 __asm__ volatile ("stmxcsr %0" : "=m" (_mxcsr));
35
33
3634 *flagp = (_mxcsr | _status) & excepts & FE_ALL_EXCEPT;
3735#endif /* defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__) */
3836 return 0;
lib/libc/mingw/misc/fesetenv.c+4-6
......@@ -3,13 +3,11 @@
33 * This file is part of the mingw-w64 runtime package.
44 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
55 */
6
67#include <_mingw.h>
78#include <fenv.h>
89#include <float.h>
9
10#if !(defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__))
11extern int __mingw_has_sse (void);
12#endif /* !(defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__)) */
10#include <internal.h>
1311
1412/* 7.6.4.3
1513 The fesetenv function establishes the floating-point environment
......@@ -28,7 +26,7 @@ int fesetenv (const fenv_t * envp)
2826{
2927#if defined(_ARM_) || defined(__arm__)
3028 if (envp == FE_DFL_ENV)
31 /* Use the choice made at app startup */
29 /* Use the choice made at app startup */
3230 _fpreset();
3331 else
3432 __asm__ volatile ("fmxr FPSCR, %0" : : "r" (*envp));
......@@ -59,7 +57,7 @@ int fesetenv (const fenv_t * envp)
5957 (* __MINGW_IMP_SYMBOL(_fpreset))();
6058
6159 else if (envp == FE_DFL_ENV)
62 /* Use the choice made at app startup */
60 /* Use the choice made at app startup */
6361 _fpreset();
6462
6563 else
lib/libc/mingw/misc/fesetexceptflag.c+4-6
......@@ -3,11 +3,9 @@
33 * This file is part of the mingw-w64 runtime package.
44 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
55 */
6#include <fenv.h>
76
8#if !(defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__))
9extern int __mingw_has_sse (void);
10#endif /* !(defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__)) */
7#include <fenv.h>
8#include <internal.h>
119
1210/* 7.6.2.4
1311 The fesetexceptflag function sets the complete status for those
......@@ -16,9 +14,9 @@ extern int __mingw_has_sse (void);
1614 *flagp shall have been set by a previous call to fegetexceptflag
1715 whose second argument represented at least those exceptions
1816 represented by the argument excepts. This function does not raise
19 exceptions, but only sets the state of the flags. */
17 exceptions, but only sets the state of the flags. */
2018
21int fesetexceptflag (const fexcept_t * flagp, int excepts)
19int fesetexceptflag (const fexcept_t * flagp, int excepts)
2220{
2321 fenv_t _env;
2422
lib/libc/mingw/misc/fesetround.c+3-5
......@@ -3,11 +3,9 @@
33 * This file is part of the mingw-w64 runtime package.
44 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
55 */
6#include <fenv.h>
76
8#if !(defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__))
9int __mingw_has_sse (void);
10#endif /* !(defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__)) */
7#include <fenv.h>
8#include <internal.h>
119
1210 /* 7.6.3.2
1311 The fesetround function establishes the rounding direction
......@@ -42,7 +40,7 @@ int fesetround (int mode)
4240 _cw &= ~0xc00;
4341 _cw |= mode;
4442 __asm__ volatile ("fldcw %0;" : : "m" (*&_cw));
45
43
4644 if (__mingw_has_sse ())
4745 {
4846 int mxcsr;
lib/libc/mingw/misc/fetestexcept.c+3-6
......@@ -4,13 +4,10 @@
44 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
55 */
66
7#include <fenv.h>
7#include <fenv.h>
8#include <internal.h>
89
9#if !(defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__))
10extern int __mingw_has_sse (void);
11#endif /* !(defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__)) */
12
13/* 7.6.2.5
10/* 7.6.2.5
1411 The fetestexcept function determines which of a specified subset of
1512 the exception flags are currently set. The excepts argument
1613 specifies the exception flags to be queried.
lib/libc/mingw/misc/getopt.c+11-17
......@@ -80,12 +80,6 @@ char *optarg; /* argument associated with option */
8080#define BADARG ((*options == ':') ? (int)':' : (int)'?')
8181#define INORDER (int)1
8282
83#ifndef __CYGWIN__
84#define __progname __argv[0]
85#else
86extern char __declspec(dllimport) *__progname;
87#endif
88
8983#ifdef __CYGWIN__
9084static char EMSG[] = "";
9185#else
......@@ -114,20 +108,20 @@ static const char illoptchar[] = "unknown option -- %c";
114108static const char illoptstring[] = "unknown option -- %s";
115109
116110static void
117_vwarnx(const char *fmt,va_list ap)
111_vwarnx(const char *argv0,const char *fmt,va_list ap)
118112{
119 (void)fprintf(stderr,"%s: ",__progname);
113 (void)fprintf(stderr,"%s: ",argv0);
120114 if (fmt != NULL)
121115 (void)vfprintf(stderr,fmt,ap);
122116 (void)fprintf(stderr,"\n");
123117}
124118
125119static void
126warnx(const char *fmt,...)
120warnx(const char *argv0,const char *fmt,...)
127121{
128122 va_list ap;
129123 va_start(ap,fmt);
130 _vwarnx(fmt,ap);
124 _vwarnx(argv0,fmt,ap);
131125 va_end(ap);
132126}
133127
......@@ -244,7 +238,7 @@ parse_long_options(char * const *nargv, const char *options,
244238 if (ambiguous) {
245239 /* ambiguous abbreviation */
246240 if (PRINT_ERROR)
247 warnx(ambig, (int)current_argv_len,
241 warnx(nargv[0], ambig, (int)current_argv_len,
248242 current_argv);
249243 optopt = 0;
250244 return (BADCH);
......@@ -253,7 +247,7 @@ parse_long_options(char * const *nargv, const char *options,
253247 if (long_options[match].has_arg == no_argument
254248 && has_equal) {
255249 if (PRINT_ERROR)
256 warnx(noarg, (int)current_argv_len,
250 warnx(nargv[0], noarg, (int)current_argv_len,
257251 current_argv);
258252 /*
259253 * XXX: GNU sets optopt to val regardless of flag
......@@ -283,7 +277,7 @@ parse_long_options(char * const *nargv, const char *options,
283277 * should be generated.
284278 */
285279 if (PRINT_ERROR)
286 warnx(recargstring,
280 warnx(nargv[0], recargstring,
287281 current_argv);
288282 /*
289283 * XXX: GNU sets optopt to val regardless of flag
......@@ -301,7 +295,7 @@ parse_long_options(char * const *nargv, const char *options,
301295 return (-1);
302296 }
303297 if (PRINT_ERROR)
304 warnx(illoptstring, current_argv);
298 warnx(nargv[0], illoptstring, current_argv);
305299 optopt = 0;
306300 return (BADCH);
307301 }
......@@ -467,7 +461,7 @@ start:
467461 if (!*place)
468462 ++optind;
469463 if (PRINT_ERROR)
470 warnx(illoptchar, optchar);
464 warnx(nargv[0], illoptchar, optchar);
471465 optopt = optchar;
472466 return (BADCH);
473467 }
......@@ -478,7 +472,7 @@ start:
478472 else if (++optind >= nargc) { /* no arg */
479473 place = EMSG;
480474 if (PRINT_ERROR)
481 warnx(recargchar, optchar);
475 warnx(nargv[0], recargchar, optchar);
482476 optopt = optchar;
483477 return (BADARG);
484478 } else /* white space */
......@@ -499,7 +493,7 @@ start:
499493 if (++optind >= nargc) { /* no arg */
500494 place = EMSG;
501495 if (PRINT_ERROR)
502 warnx(recargchar, optchar);
496 warnx(nargv[0], recargchar, optchar);
503497 optopt = optchar;
504498 return (BADARG);
505499 } else
lib/libc/mingw/misc/initenv.c deleted-12
......@@ -1,12 +0,0 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#include <wchar.h>
8
9static char ** local__initenv;
10static wchar_t ** local__winitenv;
11char *** __MINGW_IMP_SYMBOL(__initenv) = &local__initenv;
12wchar_t *** __MINGW_IMP_SYMBOL(__winitenv) = &local__winitenv;
lib/libc/mingw/misc/mkstemp.c+5-7
......@@ -7,6 +7,7 @@
77#include <share.h>
88#include <fcntl.h>
99#include <sys/stat.h>
10#include <limits.h>
1011
1112/*
1213 The mkstemp() function generates a unique temporary filename from template,
......@@ -25,8 +26,8 @@
2526 */
2627int __cdecl mkstemp (char *template_name)
2728{
28 int i, j, fd, len, index;
29 unsigned int r;
29 int j, fd, len, index;
30 unsigned int i, r;
3031
3132 /* These are the (62) characters used in temporary filenames. */
3233 static const char letters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
......@@ -41,11 +42,8 @@ int __cdecl mkstemp (char *template_name)
4142 /* User may supply more than six trailing Xs */
4243 for (index = len - 6; index > 0 && template_name[index - 1] == 'X'; index--);
4344
44 /*
45 Like OpenBSD, mkstemp() will try at least 2 ** 31 combinations before
46 giving up.
47 */
48 for (i = 0; i >= 0; i++) {
45 /* Like OpenBSD, mkstemp() will try 2 ** 31 combinations before giving up. */
46 for (i = 0; i <= INT_MAX; i++) {
4947 for(j = index; j < len; j++) {
5048 if (rand_s(&r))
5149 r = rand();
lib/libc/mingw/misc/ucrt__getmainargs.c created+25
......@@ -0,0 +1,25 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#undef __MSVCRT_VERSION__
8#define _UCRT
9
10#include <corecrt_startup.h>
11#include <internal.h>
12#include <stdlib.h>
13#include <new.h>
14
15int __cdecl __getmainargs(int *argc, char ***argv, char ***env, int DoWildCard, _startupinfo *StartInfo)
16{
17 _initialize_narrow_environment();
18 _configure_narrow_argv(DoWildCard ? _crt_argv_expanded_arguments : _crt_argv_unexpanded_arguments);
19 *argc = *__p___argc();
20 *argv = *__p___argv();
21 *env = *__p__environ();
22 _set_new_mode(StartInfo->newmode);
23 return 0;
24}
25int __cdecl (*__MINGW_IMP_SYMBOL(__getmainargs))(int *, char ***, char ***, int, _startupinfo *) = __getmainargs;
lib/libc/mingw/misc/ucrt__wgetmainargs.c created+25
......@@ -0,0 +1,25 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#undef __MSVCRT_VERSION__
8#define _UCRT
9
10#include <corecrt_startup.h>
11#include <internal.h>
12#include <stdlib.h>
13#include <new.h>
14
15int __cdecl __wgetmainargs(int *argc, wchar_t ***argv, wchar_t ***env, int DoWildCard, _startupinfo *StartInfo)
16{
17 _initialize_wide_environment();
18 _configure_wide_argv(DoWildCard ? _crt_argv_expanded_arguments : _crt_argv_unexpanded_arguments);
19 *argc = *__p___argc();
20 *argv = *__p___wargv();
21 *env = *__p__wenviron();
22 _set_new_mode(StartInfo->newmode);
23 return 0;
24}
25int __cdecl (*__MINGW_IMP_SYMBOL(__wgetmainargs))(int *, wchar_t ***, wchar_t ***, int, _startupinfo *) = __wgetmainargs;
lib/libc/mingw/misc/ucrt_amsg_exit.c created+19
......@@ -0,0 +1,19 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#undef __MSVCRT_VERSION__
8#define _UCRT
9
10#include <stdio.h>
11#include <stdlib.h>
12#include <internal.h>
13
14void __cdecl __MINGW_ATTRIB_NORETURN _amsg_exit(int ret)
15{
16 fprintf(stderr, "runtime error %d\n", ret);
17 _exit(255);
18}
19void __cdecl (*__MINGW_IMP_SYMBOL(_amsg_exit))(int) = _amsg_exit;
lib/libc/mingw/misc/ucrt_at_quick_exit.c created+24
......@@ -0,0 +1,24 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#undef __MSVCRT_VERSION__
8#define _UCRT
9
10#include <stdlib.h>
11#include <corecrt_startup.h>
12
13extern char __mingw_module_is_dll;
14
15int __cdecl at_quick_exit(void (__cdecl *func)(void))
16{
17 // In a DLL, we can't register a function with _crt_at_quick_exit, because
18 // we can't unregister it when the DLL is unloaded. This matches how
19 // at_quick_exit/quick_exit work with MSVC with a dynamically linked CRT.
20 if (__mingw_module_is_dll)
21 return 0;
22 return _crt_at_quick_exit(func);
23}
24int __cdecl (*__MINGW_IMP_SYMBOL(at_quick_exit))(void (__cdecl *)(void)) = at_quick_exit;
lib/libc/mingw/misc/ucrt_tzset.c created+45
......@@ -0,0 +1,45 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#undef __MSVCRT_VERSION__
8#define _UCRT
9
10#include <time.h>
11
12// These are required to provide the unrepfixed data symbols "timezone"
13// and "tzname"; we can't remap "timezone" via a define due to clashes
14// with e.g. "struct timezone".
15typedef void __cdecl (*_tzset_func)(void);
16extern _tzset_func __MINGW_IMP_SYMBOL(_tzset);
17
18// Default initial values until _tzset has been called; these are the same
19// as the initial values in msvcrt/ucrtbase.
20static char initial_tzname0[] = "PST";
21static char initial_tzname1[] = "PDT";
22static char *initial_tznames[] = { initial_tzname0, initial_tzname1 };
23static long initial_timezone = 28800;
24static int initial_daylight = 1;
25char** __MINGW_IMP_SYMBOL(tzname) = initial_tznames;
26long * __MINGW_IMP_SYMBOL(timezone) = &initial_timezone;
27int * __MINGW_IMP_SYMBOL(daylight) = &initial_daylight;
28
29void __cdecl _tzset(void)
30{
31 __MINGW_IMP_SYMBOL(_tzset)();
32 // Redirect the __imp_ pointers to the actual data provided by the UCRT.
33 // From this point, the exposed values should stay in sync.
34 __MINGW_IMP_SYMBOL(tzname) = _tzname;
35 __MINGW_IMP_SYMBOL(timezone) = __timezone();
36 __MINGW_IMP_SYMBOL(daylight) = __daylight();
37}
38
39void __cdecl tzset(void)
40{
41 _tzset();
42}
43
44// Dummy/unused __imp_ wrappers, to make GNU ld not autoexport these symbols.
45void __cdecl (*__MINGW_IMP_SYMBOL(tzset))(void) = tzset;
lib/libc/mingw/misc/wcstoimax.c+11
......@@ -33,6 +33,7 @@
3333#define valid(n, b) ((n) >= 0 && (n) < (b))
3434
3535intmax_t
36__cdecl
3637wcstoimax(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr, int base)
3738 {
3839 register uintmax_t accum; /* accumulates converted value */
......@@ -116,6 +117,16 @@ wcstoimax(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr, int
116117 else
117118 return (intmax_t)(minus ? -accum : accum);
118119 }
120intmax_t (__cdecl *__MINGW_IMP_SYMBOL(wcstoimax))(const wchar_t * __restrict__, wchar_t ** __restrict__, int) = wcstoimax;
119121
120122long long __attribute__ ((alias ("wcstoimax")))
123__cdecl
121124wcstoll (const wchar_t* __restrict__ nptr, wchar_t ** __restrict__ endptr, int base);
125extern long long __attribute__ ((alias (__MINGW64_STRINGIFY(__MINGW_IMP_SYMBOL(wcstoimax)))))
126(__cdecl *__MINGW_IMP_SYMBOL(wcstoll))(const wchar_t * __restrict__, wchar_t ** __restrict__, int);
127
128long long __attribute__ ((alias ("wcstoimax")))
129__cdecl
130_wcstoi64 (const wchar_t* __restrict__ nptr, wchar_t ** __restrict__ endptr, int base);
131extern long long __attribute__ ((alias (__MINGW64_STRINGIFY(__MINGW_IMP_SYMBOL(wcstoimax)))))
132(__cdecl *__MINGW_IMP_SYMBOL(_wcstoi64))(const wchar_t * __restrict__, wchar_t ** __restrict__, int);
lib/libc/mingw/misc/wcstoumax.c+11
......@@ -33,6 +33,7 @@
3333#define valid(n, b) ((n) >= 0 && (n) < (b))
3434
3535uintmax_t
36__cdecl
3637wcstoumax(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr, int base)
3738 {
3839 register uintmax_t accum; /* accumulates converted value */
......@@ -110,6 +111,16 @@ wcstoumax(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr, int
110111 else
111112 return minus ? -accum : accum; /* (yes!) */
112113 }
114uintmax_t (__cdecl *__MINGW_IMP_SYMBOL(wcstoumax))(const wchar_t * __restrict__, wchar_t ** __restrict__, int) = wcstoumax;
113115
114116unsigned long long __attribute__ ((alias ("wcstoumax")))
117__cdecl
115118wcstoull (const wchar_t* __restrict__ nptr, wchar_t ** __restrict__ endptr, int base);
119extern unsigned long long __attribute__ ((alias (__MINGW64_STRINGIFY(__MINGW_IMP_SYMBOL(wcstoumax)))))
120(__cdecl *__MINGW_IMP_SYMBOL(wcstoull))(const wchar_t * __restrict__, wchar_t ** __restrict__, int);
121
122unsigned long long __attribute__ ((alias ("wcstoumax")))
123__cdecl
124_wcstoui64 (const wchar_t* __restrict__ nptr, wchar_t ** __restrict__ endptr, int base);
125extern unsigned long long __attribute__ ((alias (__MINGW64_STRINGIFY(__MINGW_IMP_SYMBOL(wcstoumax)))))
126(__cdecl *__MINGW_IMP_SYMBOL(_wcstoui64))(const wchar_t * __restrict__, wchar_t ** __restrict__, int);
lib/libc/mingw/stdio/_fstat.c deleted-52
......@@ -1,52 +0,0 @@
1#define __CRT__NO_INLINE
2#include <sys/stat.h>
3
4/* FIXME: Relying on _USE_32BIT_TIME_T, which is a user-macro,
5during CRT compilation is plainly broken. Need an appropriate
6implementation to provide users the ability of compiling the
7CRT only with 32-bit time_t behavior. */
8#if defined(_USE_32BIT_TIME_T)
9int __cdecl
10fstat(int _Desc,struct stat *_Stat)
11{
12 struct _stat32 st;
13 int ret=_fstat32(_Desc,&st);
14 if (ret == -1) {
15 memset(_Stat,0,sizeof(struct stat));
16 return -1;
17 }
18 /* struct stat and struct _stat32
19 are the same for this case. */
20 memcpy(_Stat, &st, sizeof(struct _stat32));
21 return ret;
22}
23#else
24int __cdecl
25fstat(int _Desc,struct stat *_Stat)
26{
27 struct _stat64 st;
28 int ret=_fstat64(_Desc,&st);
29 if (ret == -1) {
30 memset(_Stat,0,sizeof(struct stat));
31 return -1;
32 }
33 /* struct stat and struct _stat64i32
34 are the same for this case. */
35 _Stat->st_dev=st.st_dev;
36 _Stat->st_ino=st.st_ino;
37 _Stat->st_mode=st.st_mode;
38 _Stat->st_nlink=st.st_nlink;
39 _Stat->st_uid=st.st_uid;
40 _Stat->st_gid=st.st_gid;
41 _Stat->st_rdev=st.st_rdev;
42 _Stat->st_size=(_off_t) st.st_size;
43 _Stat->st_atime=st.st_atime;
44 _Stat->st_mtime=st.st_mtime;
45 _Stat->st_ctime=st.st_ctime;
46 return ret;
47}
48#endif
49
50/* Add __imp__fstat and __imp__stat symbols. */
51int (*__MINGW_IMP_SYMBOL(fstat))(int, struct stat *) = &fstat;
52
lib/libc/mingw/stdio/_ftime.c deleted-19
......@@ -1,19 +0,0 @@
1#define __CRT__NO_INLINE
2#include <sys/stat.h>
3#include <sys/timeb.h>
4
5/* FIXME: Relying on _USE_32BIT_TIME_T, which is a user-macro,
6during CRT compilation is plainly broken. Need an appropriate
7implementation to provide users the ability of compiling the
8CRT only with 32-bit time_t behavior. */
9#if defined(_USE_32BIT_TIME_T)
10void __cdecl ftime (struct timeb *b)
11{
12 return _ftime ((struct __timeb32 *)b);
13}
14#else
15void __cdecl ftime (struct timeb *b)
16{
17 _ftime64((struct __timeb64 *)b);
18}
19#endif
lib/libc/mingw/stdio/fgetpos64.c deleted-5
......@@ -1,5 +0,0 @@
1#include <stdio.h>
2
3int __cdecl fgetpos64(FILE * __restrict__ _File ,fpos_t * __restrict__ _Pos){
4 return fgetpos(_File, _Pos);
5}
lib/libc/mingw/stdio/fsetpos64.c deleted-5
......@@ -1,5 +0,0 @@
1#include <stdio.h>
2
3int __cdecl fsetpos64(FILE *_File,const fpos_t *_Pos){ /* fsetpos already 64bit */
4 return fsetpos(_File,_Pos);
5}
lib/libc/mingw/stdio/ftruncate64.c+15-15
......@@ -123,7 +123,7 @@ static LPWSTR xp_getfilepath(const HANDLE f, const LARGE_INTEGER fsize){
123123 if (temp) free(temp);
124124 if (pMem) UnmapViewOfFile(pMem);
125125 if (hFileMap) CloseHandle(hFileMap);
126 _set_errno(EBADF);
126 errno = EBADF;
127127 return NULL;
128128}
129129#endif /* _CHECK_SPACE_BY_PSAPI_METHOD_ */
......@@ -142,7 +142,7 @@ checkfreespace (const HANDLE f, const ULONGLONG requiredspace)
142142 check = GetFileSizeEx (f, &currentsize);
143143 if (!check)
144144 {
145 _set_errno(EBADF);
145 errno = EBADF;
146146 return -1; /* Error checking file size */
147147 }
148148
......@@ -159,19 +159,19 @@ checkfreespace (const HANDLE f, const ULONGLONG requiredspace)
159159 check = GetFinalPathNameByHandleW(f,filepath,0,FILE_NAME_NORMALIZED|VOLUME_NAME_GUID);
160160 err = GetLastError();
161161 if (err == ERROR_PATH_NOT_FOUND || err == ERROR_INVALID_PARAMETER) {
162 _set_errno(EINVAL);
162 errno = EINVAL;
163163 return -1; /* IO error */
164164 }
165165 filepath = calloc(check + 1,sizeof(wchar_t));
166166 if (!filepath) {
167 _set_errno(EBADF);
167 errno = EBADF;
168168 return -1; /* Out of memory */
169169 }
170170 check = GetFinalPathNameByHandleW(f,filepath,check,FILE_NAME_NORMALIZED|VOLUME_NAME_GUID);
171171 /* FIXME: last error was set to error 87 (0x57)
172172 "The parameter is incorrect." for some reason but works out */
173173 if (!check) {
174 _set_errno(EBADF);
174 errno = EBADF;
175175 return -1; /* Error resolving filename */
176176 }
177177#endif /* _CHECK_SPACE_BY_VISTA_METHOD_ */
......@@ -185,21 +185,21 @@ checkfreespace (const HANDLE f, const ULONGLONG requiredspace)
185185 free(filepath);
186186 filepath = NULL;
187187 if (!dirpath) {
188 _set_errno(EBADF);
188 errno = EBADF;
189189 return -1; /* Out of memory */
190190 }
191191#endif /* _CHECK_SPACE_BY_PSAPI_METHOD_ */
192192
193193#if _CHECK_SPACE_BY_VOLUME_METHOD_
194194 if(!GetFileInformationByHandle(f,&fileinfo)) {
195 _set_errno(EINVAL);
195 errno = EINVAL;
196196 return -1; /* Resolution failure */
197197 }
198198
199199 volumeid = calloc(51,sizeof(wchar_t));
200200 volumepath = calloc(MAX_PATH+2,sizeof(wchar_t));
201201 if(!volumeid || !volumepath) {
202 _set_errno(EBADF);
202 errno = EBADF;
203203 return -1; /* Out of memory */
204204 }
205205
......@@ -226,14 +226,14 @@ checkfreespace (const HANDLE f, const ULONGLONG requiredspace)
226226 //wprintf(L"freespace %I64u\n",freespace);
227227 free(dirpath);
228228 if(!check) {
229 _set_errno(EFBIG);
229 errno = EFBIG;
230230 return -1; /* Error getting free space */
231231 }
232232
233233 /* Check space requirements */
234234 if ((requiredspace - currentsize.QuadPart) > freespace.QuadPart)
235235 {
236 _set_errno(EFBIG); /* File too big for disk */
236 errno = EFBIG; /* File too big for disk */
237237 return -1;
238238 } /* We have enough space to truncate/expand */
239239 return 0;
......@@ -258,7 +258,7 @@ int ftruncate64(int __fd, _off64_t __length) {
258258
259259 f = (HANDLE)_get_osfhandle(__fd);
260260 if (f == INVALID_HANDLE_VALUE || (GetFileType(f) != FILE_TYPE_DISK)) {
261 _set_errno(EBADF);
261 errno = EBADF;
262262 return -1;
263263 }
264264
......@@ -279,13 +279,13 @@ int ftruncate64(int __fd, _off64_t __length) {
279279 if (check == INVALID_SET_FILE_POINTER && quad.LowPart != INVALID_SET_FILE_POINTER) {
280280 switch (GetLastError()) {
281281 case ERROR_NEGATIVE_SEEK:
282 _set_errno(EFBIG); /* file too big? */
282 errno = EFBIG; /* file too big? */
283283 return -1;
284284 case INVALID_SET_FILE_POINTER:
285 _set_errno(EINVAL); /* shouldn't happen */
285 errno = EINVAL; /* shouldn't happen */
286286 return -1;
287287 default:
288 _set_errno(EINVAL); /* shouldn't happen */
288 errno = EINVAL; /* shouldn't happen */
289289 return -1;
290290 }
291291 }
......@@ -302,7 +302,7 @@ int ftruncate64(int __fd, _off64_t __length) {
302302 return ret;
303303
304304 errorout:
305 _set_errno(EINVAL);
305 errno = EINVAL;
306306 return -1;
307307}
308308
lib/libc/mingw/stdio/truncate.c+4-4
......@@ -7,9 +7,9 @@ int truncate(const char *pathname, _off_t len){
77 int fd = _open(pathname,_O_BINARY|_O_RDWR);
88 if (fd == -1) return fd;
99 ret = ftruncate(fd,len);
10 _get_errno(&err);
10 err = errno;
1111 _close(fd);
12 _set_errno(err);
12 errno = err;
1313 return ret;
1414}
1515
......@@ -18,8 +18,8 @@ int truncate64(const char *pathname, _off64_t len){
1818 int fd = _open(pathname,_O_BINARY|_O_RDWR);
1919 if (fd == -1) return fd;
2020 ret = ftruncate64(fd,len);
21 _get_errno(&err);
21 err = errno;
2222 _close(fd);
23 _set_errno(err);
23 errno = err;
2424 return ret;
2525}
lib/libc/mingw/stdio/ucrt__scprintf.c created+21
......@@ -0,0 +1,21 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#undef __MSVCRT_VERSION__
8#define _UCRT
9#include <stdio.h>
10#include <stdarg.h>
11
12int __cdecl _scprintf(const char * __restrict__ _Format, ...)
13{
14 int ret;
15 va_list _ArgList;
16 va_start(_ArgList, _Format);
17 ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, NULL, 0, _Format, NULL, _ArgList);
18 va_end(_ArgList);
19 return ret;
20}
21int __cdecl (*__MINGW_IMP_SYMBOL(_scprintf))(const char *__restrict__, ...) = _scprintf;
lib/libc/mingw/stdio/ucrt__snprintf.c created+21
......@@ -0,0 +1,21 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#undef __MSVCRT_VERSION__
8#define _UCRT
9#include <stdio.h>
10#include <stdarg.h>
11
12int __cdecl _snprintf(char * __restrict__ _Dest, size_t _Count, const char * __restrict__ _Format, ...)
13{
14 int ret;
15 va_list _Args;
16 va_start(_Args, _Format);
17 ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, _Dest, _Count, _Format, NULL, _Args);
18 va_end(_Args);
19 return ret;
20}
21int __cdecl (*__MINGW_IMP_SYMBOL(_snprintf))(char *__restrict__, size_t, const char *__restrict__, ...) = _snprintf;
lib/libc/mingw/stdio/ucrt__snscanf.c created+21
......@@ -0,0 +1,21 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#undef __MSVCRT_VERSION__
8#define _UCRT
9#include <stdio.h>
10#include <stdarg.h>
11
12int __cdecl _snscanf(const char * __restrict__ _Src, size_t _MaxCount, const char * __restrict__ _Format, ...)
13{
14 int ret;
15 va_list _ArgList;
16 va_start(_ArgList, _Format);
17 ret = __stdio_common_vsscanf(0, _Src, _MaxCount, _Format, NULL, _ArgList);
18 va_end(_ArgList);
19 return ret;
20}
21int __cdecl (*__MINGW_IMP_SYMBOL(_snscanf))(const char *__restrict__, size_t, const char * __restrict__, ...) = _snscanf;
lib/libc/mingw/stdio/ucrt__snwprintf.c+1-1
......@@ -30,7 +30,7 @@ int __cdecl _snwprintf(wchar_t * restrict _Dest, size_t _Count, const wchar_t *
3030 va_list ap;
3131 int ret;
3232 va_start(ap, _Format);
33 ret = vsnwprintf(_Dest, _Count, _Format, ap);
33 ret = __stdio_common_vswprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, _Dest, _Count, _Format, NULL, ap);
3434 va_end(ap);
3535 return ret;
3636}
lib/libc/mingw/stdio/ucrt__vscprintf.c+1-1
......@@ -10,6 +10,6 @@
1010
1111int __cdecl _vscprintf(const char * __restrict__ _Format, va_list _ArgList)
1212{
13 return __stdio_common_vsprintf(_CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, NULL, 0, _Format, NULL, _ArgList);
13 return __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, NULL, 0, _Format, NULL, _ArgList);
1414}
1515int __cdecl (*__MINGW_IMP_SYMBOL(_vscprintf))(const char *__restrict__, va_list) = _vscprintf;
lib/libc/mingw/stdio/ucrt__vsnprintf.c+1-1
......@@ -10,6 +10,6 @@
1010
1111int __cdecl _vsnprintf(char * __restrict__ _Dest,size_t _Count,const char * __restrict__ _Format,va_list _Args) __MINGW_ATTRIB_DEPRECATED_SEC_WARN
1212{
13 return __stdio_common_vsprintf(_CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, _Dest, _Count, _Format, NULL, _Args);
13 return __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, _Dest, _Count, _Format, NULL, _Args);
1414}
1515int __cdecl (*__MINGW_IMP_SYMBOL(_vsnprintf))(char *__restrict__, size_t, const char *__restrict__, va_list) = _vsnprintf;
lib/libc/mingw/stdio/ucrt_fprintf.c+1-1
......@@ -13,7 +13,7 @@ int __cdecl fprintf(FILE * __restrict__ _File,const char * __restrict__ _Format,
1313 __builtin_va_list ap;
1414 int ret;
1515 __builtin_va_start(ap, _Format);
16 ret = __stdio_common_vfprintf(0, _File, _Format, NULL, ap);
16 ret = __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _File, _Format, NULL, ap);
1717 __builtin_va_end(ap);
1818 return ret;
1919}
lib/libc/mingw/stdio/ucrt_ms_fwprintf.c created+24
......@@ -0,0 +1,24 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#undef __MSVCRT_VERSION__
8#define _UCRT
9
10#include <stdio.h>
11#include <stdarg.h>
12
13// This is called for wchar cases with __USE_MINGW_ANSI_STDIO enabled (where the
14// char case just uses fputc).
15int __cdecl __ms_fwprintf(FILE *file, const wchar_t *fmt, ...)
16{
17 va_list ap;
18 int ret;
19 va_start(ap, fmt);
20 ret = __stdio_common_vfwprintf(_CRT_INTERNAL_PRINTF_LEGACY_WIDE_SPECIFIERS, file, fmt, NULL, ap);
21 va_end(ap);
22 return ret;
23}
24int __cdecl (*__MINGW_IMP_SYMBOL(__ms_fwprintf))(FILE *, const wchar_t *, ...) = __ms_fwprintf;
lib/libc/mingw/stdio/ucrt_printf.c+1-1
......@@ -13,7 +13,7 @@ int __cdecl printf(const char * __restrict__ _Format,...)
1313 __builtin_va_list ap;
1414 int ret;
1515 __builtin_va_start(ap, _Format);
16 ret = __stdio_common_vfprintf(0, stdout, _Format, NULL, ap);
16 ret = __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, stdout, _Format, NULL, ap);
1717 __builtin_va_end(ap);
1818 return ret;
1919}
lib/libc/mingw/stdio/ucrt_snprintf.c+1-1
......@@ -13,7 +13,7 @@ int __cdecl snprintf (char * __restrict__ __stream, size_t __n, const char * __r
1313 __builtin_va_list ap;
1414 int ret;
1515 __builtin_va_start(ap, __format);
16 ret = __stdio_common_vsprintf(_CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, __stream, __n, __format, NULL, ap);
16 ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, __stream, __n, __format, NULL, ap);
1717 __builtin_va_end(ap);
1818 return ret;
1919}
lib/libc/mingw/stdio/ucrt_sprintf.c+1-1
......@@ -13,7 +13,7 @@ int __cdecl sprintf(char * __restrict__ _Dest,const char * __restrict__ _Format,
1313 __builtin_va_list ap;
1414 int ret;
1515 __builtin_va_start(ap, _Format);
16 ret = __stdio_common_vsprintf(_CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, _Dest, (size_t)-1, _Format, NULL, ap);
16 ret = __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, _Dest, (size_t)-1, _Format, NULL, ap);
1717 __builtin_va_end(ap);
1818 return ret;
1919}
lib/libc/mingw/stdio/ucrt_vfprintf.c+1-1
......@@ -10,6 +10,6 @@
1010
1111int __cdecl vfprintf(FILE * __restrict__ _File,const char * __restrict__ _Format,va_list _ArgList)
1212{
13 return __stdio_common_vfprintf(0, _File, _Format, NULL, _ArgList);
13 return __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, _File, _Format, NULL, _ArgList);
1414}
1515int __cdecl (*__MINGW_IMP_SYMBOL(vfprintf))(FILE *__restrict__, const char *__restrict__, va_list) = vfprintf;
lib/libc/mingw/stdio/ucrt_vprintf.c+1-1
......@@ -10,6 +10,6 @@
1010
1111int __cdecl vprintf(const char * __restrict__ _Format,va_list _ArgList)
1212{
13 return __stdio_common_vfprintf(0, stdout, _Format, NULL, _ArgList);
13 return __stdio_common_vfprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS, stdout, _Format, NULL, _ArgList);
1414}
1515int __cdecl (*__MINGW_IMP_SYMBOL(vprintf))(const char *__restrict__, va_list) = vprintf;
lib/libc/mingw/stdio/ucrt_vsnprintf.c+1-1
......@@ -10,6 +10,6 @@
1010
1111int __cdecl vsnprintf (char * __restrict__ __stream, size_t __n, const char * __restrict__ __format, va_list __local_argv)
1212{
13 return __stdio_common_vsprintf(_CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, __stream, __n, __format, NULL, __local_argv);
13 return __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, __stream, __n, __format, NULL, __local_argv);
1414}
1515int __cdecl (*__MINGW_IMP_SYMBOL(vsnprintf))(char *__restrict__, size_t, const char *__restrict__, va_list) = vsnprintf;
lib/libc/mingw/stdio/ucrt_vsprintf.c+1-1
......@@ -10,6 +10,6 @@
1010
1111int __cdecl vsprintf(char * __restrict__ _Dest,const char * __restrict__ _Format,va_list _Args) __MINGW_ATTRIB_DEPRECATED_SEC_WARN
1212{
13 return __stdio_common_vsprintf(_CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, _Dest, (size_t)-1, _Format, NULL, _Args);
13 return __stdio_common_vsprintf(_CRT_INTERNAL_LOCAL_PRINTF_OPTIONS | _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, _Dest, (size_t)-1, _Format, NULL, _Args);
1414}
1515int __cdecl (*__MINGW_IMP_SYMBOL(vsprintf))(char *__restrict__, const char *__restrict__, va_list) = vsprintf;
lib/libc/mingw/string/ucrt__wcstok.c created+14
......@@ -0,0 +1,14 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#include <wchar.h>
8
9wchar_t *__cdecl _wcstok(wchar_t *restrict str, const wchar_t *restrict delim)
10{
11 /* NULL as a third param can be specified only for UCRT version of wcstok() */
12 return wcstok(str, delim, NULL);
13}
14wchar_t *(__cdecl *__MINGW_IMP_SYMBOL(_wcstok))(wchar_t *restrict, const wchar_t *restrict) = _wcstok;
lib/libc/mingw/winpthreads/barrier.c created+246
......@@ -0,0 +1,246 @@
1/*
2 Copyright (c) 2011-2016 mingw-w64 project
3
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the "Software"),
6 to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 DEALINGS IN THE SOFTWARE.
21*/
22
23#include <windows.h>
24#include <stdio.h>
25#include <malloc.h>
26#include "pthread.h"
27#include "barrier.h"
28#include "ref.h"
29#include "misc.h"
30
31static pthread_spinlock_t barrier_global = PTHREAD_SPINLOCK_INITIALIZER;
32
33static WINPTHREADS_ATTRIBUTE((noinline)) int
34barrier_unref(volatile pthread_barrier_t *barrier, int res)
35{
36 pthread_spin_lock(&barrier_global);
37#ifdef WINPTHREAD_DBG
38 assert((((barrier_t *)*barrier)->valid == LIFE_BARRIER) && (((barrier_t *)*barrier)->busy > 0));
39#endif
40 ((barrier_t *)*barrier)->busy -= 1;
41 pthread_spin_unlock(&barrier_global);
42 return res;
43}
44
45static WINPTHREADS_ATTRIBUTE((noinline)) int barrier_ref(volatile pthread_barrier_t *barrier)
46{
47 int r = 0;
48 pthread_spin_lock(&barrier_global);
49
50 if (!barrier || !*barrier || ((barrier_t *)*barrier)->valid != LIFE_BARRIER) r = EINVAL;
51 else {
52 ((barrier_t *)*barrier)->busy += 1;
53 }
54
55 pthread_spin_unlock(&barrier_global);
56
57 return r;
58}
59
60static WINPTHREADS_ATTRIBUTE((noinline)) int
61barrier_ref_destroy(volatile pthread_barrier_t *barrier, pthread_barrier_t *bDestroy)
62{
63 int r = 0;
64
65 *bDestroy = NULL;
66 pthread_spin_lock(&barrier_global);
67
68 if (!barrier || !*barrier || ((barrier_t *)*barrier)->valid != LIFE_BARRIER) r = EINVAL;
69 else {
70 barrier_t *b_ = (barrier_t *)*barrier;
71 if (b_->busy) r = EBUSY;
72 else {
73 *bDestroy = *barrier;
74 *barrier = NULL;
75 }
76 }
77
78 pthread_spin_unlock(&barrier_global);
79 return r;
80}
81
82static WINPTHREADS_ATTRIBUTE((noinline)) void
83barrier_ref_set (volatile pthread_barrier_t *barrier, void *v)
84{
85 pthread_spin_lock(&barrier_global);
86 *barrier = v;
87 pthread_spin_unlock(&barrier_global);
88}
89
90int pthread_barrier_destroy(pthread_barrier_t *b_)
91{
92 pthread_barrier_t bDestroy;
93 barrier_t *b;
94 int r;
95
96 while ((r = barrier_ref_destroy(b_,&bDestroy)) == EBUSY)
97 Sleep(0);
98
99 if (r)
100 return r;
101
102 b = (barrier_t *)bDestroy;
103
104 pthread_mutex_lock(&b->m);
105
106 if (sem_destroy(&b->sems[0]) != 0)
107 {
108 /* Could this happen? */
109 *b_ = bDestroy;
110 pthread_mutex_unlock (&b->m);
111 return EBUSY;
112 }
113 if (sem_destroy(&b->sems[1]) != 0)
114 {
115 sem_init (&b->sems[0], b->share, 0);
116 *b_ = bDestroy;
117 pthread_mutex_unlock (&b->m);
118 return -1;
119 }
120 pthread_mutex_unlock(&b->m);
121 if(pthread_mutex_destroy(&b->m) != 0) {
122 sem_init (&b->sems[0], b->share, 0);
123 sem_init (&b->sems[1], b->share, 0);
124 *b_ = bDestroy;
125 return -1;
126 }
127 b->valid = DEAD_BARRIER;
128 free(bDestroy);
129 return 0;
130
131}
132
133int
134pthread_barrier_init (pthread_barrier_t *b_, const void *attr,
135 unsigned int count)
136{
137 barrier_t *b;
138
139 if (!count || !b_)
140 return EINVAL;
141
142 if ((b = (pthread_barrier_t)calloc(1,sizeof(*b))) == NULL)
143 return ENOMEM;
144 if (!attr || *((int **)attr) == NULL)
145 b->share = PTHREAD_PROCESS_PRIVATE;
146 else
147 memcpy (&b->share, *((void **) attr), sizeof (int));
148 b->total = count;
149 b->count = count;
150 b->valid = LIFE_BARRIER;
151 b->sel = 0;
152
153 if (pthread_mutex_init(&b->m, NULL) != 0)
154 {
155 free (b);
156 return ENOMEM;
157 }
158
159 if (sem_init(&b->sems[0], b->share, 0) != 0)
160 {
161 pthread_mutex_destroy(&b->m);
162 free (b);
163 return ENOMEM;
164 }
165 if (sem_init(&b->sems[1], b->share, 0) != 0)
166 {
167 pthread_mutex_destroy(&b->m);
168 sem_destroy(&b->sems[0]);
169 free (b);
170 return ENOMEM;
171 }
172 barrier_ref_set (b_,b);
173
174 return 0;
175}
176
177int pthread_barrier_wait(pthread_barrier_t *b_)
178{
179 long sel;
180 int r, e, rslt;
181 barrier_t *b;
182
183 r = barrier_ref(b_);
184 if(r) return r;
185
186 b = (barrier_t *)*b_;
187
188 if ((r = pthread_mutex_lock(&b->m)) != 0) return barrier_unref(b_,EINVAL);
189 sel = b->sel;
190 InterlockedDecrement((long*)&b->total);
191 if (b->total == 0)
192 {
193 b->total = b->count;
194 b->sel = (sel != 0 ? 0 : 1);
195 e = 1;
196 rslt = PTHREAD_BARRIER_SERIAL_THREAD;
197 r = (b->count > 1 ? sem_post_multiple (&b->sems[sel], b->count - 1) : 0);
198 }
199 else { e = 0; rslt= 0; }
200 pthread_mutex_unlock(&b->m);
201 if (!e)
202 r = sem_wait(&b->sems[sel]);
203
204 if (!r) r = rslt;
205 return barrier_unref(b_,r);
206}
207
208int pthread_barrierattr_init(void **attr)
209{
210 int *p;
211
212 if ((p = (int *) calloc (1, sizeof (int))) == NULL)
213 return ENOMEM;
214
215 *p = PTHREAD_PROCESS_PRIVATE;
216 *attr = p;
217
218 return 0;
219}
220
221int pthread_barrierattr_destroy(void **attr)
222{
223 void *p;
224 if (!attr || (p = *attr) == NULL)
225 return EINVAL;
226 *attr = NULL;
227 free (p);
228 return 0;
229}
230
231int pthread_barrierattr_setpshared(void **attr, int s)
232{
233 if (!attr || *attr == NULL
234 || (s != PTHREAD_PROCESS_SHARED && s != PTHREAD_PROCESS_PRIVATE))
235 return EINVAL;
236 memcpy (*attr, &s, sizeof (int));
237 return 0;
238}
239
240int pthread_barrierattr_getpshared(void **attr, int *s)
241{
242 if (!attr || !s || *attr == NULL)
243 return EINVAL;
244 memcpy (s, *attr, sizeof (int));
245 return 0;
246}
lib/libc/mingw/winpthreads/barrier.h created+52
......@@ -0,0 +1,52 @@
1/*
2 Copyright (c) 2011-2016 mingw-w64 project
3
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the "Software"),
6 to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 DEALINGS IN THE SOFTWARE.
21*/
22
23#ifndef WIN_PTHREADS_BARRIER_H
24#define WIN_PTHREADS_BARRIER_H
25
26#define LIFE_BARRIER 0xBAB1FEED
27#define DEAD_BARRIER 0xDEADB00F
28
29#define _PTHREAD_BARRIER_FLAG (1<<30)
30
31#define CHECK_BARRIER(b) \
32 do { \
33 if (!(b) || ( ((barrier_t *)(*b))->valid != (unsigned int)LIFE_BARRIER ) ) \
34 return EINVAL; \
35 } while (0)
36
37#include "semaphore.h"
38
39typedef struct barrier_t barrier_t;
40struct barrier_t
41{
42 int valid;
43 int busy;
44 int count;
45 int total;
46 int share;
47 long sel;
48 pthread_mutex_t m;
49 sem_t sems[2];
50};
51
52#endif
lib/libc/mingw/winpthreads/clock.c created+257
......@@ -0,0 +1,257 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#include <errno.h>
8#include <stdint.h>
9#include <time.h>
10#include <windows.h>
11#ifndef IN_WINPTHREAD
12#define IN_WINPTHREAD 1
13#endif
14#include "pthread.h"
15#include "pthread_time.h"
16#include "misc.h"
17
18#define POW10_7 10000000
19#define POW10_9 1000000000
20
21/* Number of 100ns-seconds between the beginning of the Windows epoch
22 * (Jan. 1, 1601) and the Unix epoch (Jan. 1, 1970)
23 */
24#define DELTA_EPOCH_IN_100NS INT64_C(116444736000000000)
25
26static WINPTHREADS_INLINE int lc_set_errno(int result)
27{
28 if (result != 0) {
29 errno = result;
30 return -1;
31 }
32 return 0;
33}
34
35/**
36 * Get the resolution of the specified clock clock_id and
37 * stores it in the struct timespec pointed to by res.
38 * @param clock_id The clock_id argument is the identifier of the particular
39 * clock on which to act. The following clocks are supported:
40 * <pre>
41 * CLOCK_REALTIME System-wide real-time clock. Setting this clock
42 * requires appropriate privileges.
43 * CLOCK_MONOTONIC Clock that cannot be set and represents monotonic
44 * time since some unspecified starting point.
45 * CLOCK_PROCESS_CPUTIME_ID High-resolution per-process timer from the CPU.
46 * CLOCK_THREAD_CPUTIME_ID Thread-specific CPU-time clock.
47 * </pre>
48 * @param res The pointer to a timespec structure to receive the time
49 * resolution.
50 * @return If the function succeeds, the return value is 0.
51 * If the function fails, the return value is -1,
52 * with errno set to indicate the error.
53 */
54int clock_getres(clockid_t clock_id, struct timespec *res)
55{
56 clockid_t id = clock_id;
57
58 if (id == CLOCK_REALTIME && _pthread_get_system_time_best_as_file_time == GetSystemTimeAsFileTime)
59 id = CLOCK_REALTIME_COARSE; /* GetSystemTimePreciseAsFileTime() not available */
60
61 switch(id) {
62 case CLOCK_REALTIME:
63 case CLOCK_MONOTONIC:
64 {
65 LARGE_INTEGER pf;
66
67 if (QueryPerformanceFrequency(&pf) == 0)
68 return lc_set_errno(EINVAL);
69
70 res->tv_sec = 0;
71 res->tv_nsec = (int) ((POW10_9 + (pf.QuadPart >> 1)) / pf.QuadPart);
72 if (res->tv_nsec < 1)
73 res->tv_nsec = 1;
74
75 return 0;
76 }
77
78 case CLOCK_REALTIME_COARSE:
79 case CLOCK_PROCESS_CPUTIME_ID:
80 case CLOCK_THREAD_CPUTIME_ID:
81 {
82 DWORD timeAdjustment, timeIncrement;
83 BOOL isTimeAdjustmentDisabled;
84
85 (void) GetSystemTimeAdjustment(&timeAdjustment, &timeIncrement, &isTimeAdjustmentDisabled);
86 res->tv_sec = 0;
87 res->tv_nsec = timeIncrement * 100;
88
89 return 0;
90 }
91 default:
92 break;
93 }
94
95 return lc_set_errno(EINVAL);
96}
97
98/**
99 * Get the time of the specified clock clock_id and stores it in the struct
100 * timespec pointed to by tp.
101 * @param clock_id The clock_id argument is the identifier of the particular
102 * clock on which to act. The following clocks are supported:
103 * <pre>
104 * CLOCK_REALTIME System-wide real-time clock. Setting this clock
105 * requires appropriate privileges.
106 * CLOCK_MONOTONIC Clock that cannot be set and represents monotonic
107 * time since some unspecified starting point.
108 * CLOCK_PROCESS_CPUTIME_ID High-resolution per-process timer from the CPU.
109 * CLOCK_THREAD_CPUTIME_ID Thread-specific CPU-time clock.
110 * </pre>
111 * @param tp The pointer to a timespec structure to receive the time.
112 * @return If the function succeeds, the return value is 0.
113 * If the function fails, the return value is -1,
114 * with errno set to indicate the error.
115 */
116int clock_gettime(clockid_t clock_id, struct timespec *tp)
117{
118 unsigned __int64 t;
119 LARGE_INTEGER pf, pc;
120 union {
121 unsigned __int64 u64;
122 FILETIME ft;
123 } ct, et, kt, ut;
124
125 switch(clock_id) {
126 case CLOCK_REALTIME:
127 {
128 _pthread_get_system_time_best_as_file_time(&ct.ft);
129 t = ct.u64 - DELTA_EPOCH_IN_100NS;
130 tp->tv_sec = t / POW10_7;
131 tp->tv_nsec = ((int) (t % POW10_7)) * 100;
132
133 return 0;
134 }
135
136 case CLOCK_REALTIME_COARSE:
137 {
138 GetSystemTimeAsFileTime(&ct.ft);
139 t = ct.u64 - DELTA_EPOCH_IN_100NS;
140 tp->tv_sec = t / POW10_7;
141 tp->tv_nsec = ((int) (t % POW10_7)) * 100;
142
143 return 0;
144 }
145
146 case CLOCK_MONOTONIC:
147 {
148 if (QueryPerformanceFrequency(&pf) == 0)
149 return lc_set_errno(EINVAL);
150
151 if (QueryPerformanceCounter(&pc) == 0)
152 return lc_set_errno(EINVAL);
153
154 tp->tv_sec = pc.QuadPart / pf.QuadPart;
155 tp->tv_nsec = (int) (((pc.QuadPart % pf.QuadPart) * POW10_9 + (pf.QuadPart >> 1)) / pf.QuadPart);
156 if (tp->tv_nsec >= POW10_9) {
157 tp->tv_sec ++;
158 tp->tv_nsec -= POW10_9;
159 }
160
161 return 0;
162 }
163
164 case CLOCK_PROCESS_CPUTIME_ID:
165 {
166 if(0 == GetProcessTimes(GetCurrentProcess(), &ct.ft, &et.ft, &kt.ft, &ut.ft))
167 return lc_set_errno(EINVAL);
168 t = kt.u64 + ut.u64;
169 tp->tv_sec = t / POW10_7;
170 tp->tv_nsec = ((int) (t % POW10_7)) * 100;
171
172 return 0;
173 }
174
175 case CLOCK_THREAD_CPUTIME_ID:
176 {
177 if(0 == GetThreadTimes(GetCurrentThread(), &ct.ft, &et.ft, &kt.ft, &ut.ft))
178 return lc_set_errno(EINVAL);
179 t = kt.u64 + ut.u64;
180 tp->tv_sec = t / POW10_7;
181 tp->tv_nsec = ((int) (t % POW10_7)) * 100;
182
183 return 0;
184 }
185
186 default:
187 break;
188 }
189
190 return lc_set_errno(EINVAL);
191}
192
193/**
194 * Sleep for the specified time.
195 * @param clock_id This argument should always be CLOCK_REALTIME (0).
196 * @param flags 0 for relative sleep interval, others for absolute waking up.
197 * @param request The desired sleep interval or absolute waking up time.
198 * @param remain The remain amount of time to sleep.
199 * The current implemention just ignore it.
200 * @return If the function succeeds, the return value is 0.
201 * If the function fails, the return value is -1,
202 * with errno set to indicate the error.
203 */
204int clock_nanosleep(clockid_t clock_id, int flags,
205 const struct timespec *request,
206 struct timespec *remain)
207{
208 struct timespec tp;
209
210 if (clock_id != CLOCK_REALTIME)
211 return lc_set_errno(EINVAL);
212
213 if (flags == 0)
214 return nanosleep(request, remain);
215
216 /* TIMER_ABSTIME = 1 */
217 clock_gettime(CLOCK_REALTIME, &tp);
218
219 tp.tv_sec = request->tv_sec - tp.tv_sec;
220 tp.tv_nsec = request->tv_nsec - tp.tv_nsec;
221 if (tp.tv_nsec < 0) {
222 tp.tv_nsec += POW10_9;
223 tp.tv_sec --;
224 }
225
226 return nanosleep(&tp, remain);
227}
228
229/**
230 * Set the time of the specified clock clock_id.
231 * @param clock_id This argument should always be CLOCK_REALTIME (0).
232 * @param tp The requested time.
233 * @return If the function succeeds, the return value is 0.
234 * If the function fails, the return value is -1,
235 * with errno set to indicate the error.
236 */
237int clock_settime(clockid_t clock_id, const struct timespec *tp)
238{
239 SYSTEMTIME st;
240
241 union {
242 unsigned __int64 u64;
243 FILETIME ft;
244 } t;
245
246 if (clock_id != CLOCK_REALTIME)
247 return lc_set_errno(EINVAL);
248
249 t.u64 = tp->tv_sec * (__int64) POW10_7 + tp->tv_nsec / 100 + DELTA_EPOCH_IN_100NS;
250 if (FileTimeToSystemTime(&t.ft, &st) == 0)
251 return lc_set_errno(EINVAL);
252
253 if (SetSystemTime(&st) == 0)
254 return lc_set_errno(EPERM);
255
256 return 0;
257}
lib/libc/mingw/winpthreads/cond.c created+755
......@@ -0,0 +1,755 @@
1/*
2 Copyright (c) 2011-2016 mingw-w64 project
3
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the "Software"),
6 to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 DEALINGS IN THE SOFTWARE.
21*/
22
23/*
24 * Posix Condition Variables for Microsoft Windows.
25 * 22-9-2010 Partly based on the ACE framework implementation.
26 */
27#include <windows.h>
28#include <stdio.h>
29#include <malloc.h>
30#include <time.h>
31#include "pthread.h"
32#include "pthread_time.h"
33#include "ref.h"
34#include "cond.h"
35#include "thread.h"
36#include "misc.h"
37#include "winpthread_internal.h"
38
39#include "pthread_compat.h"
40
41int __pthread_shallcancel (void);
42
43static int do_sema_b_wait (HANDLE sema, int nointerrupt, DWORD timeout,CRITICAL_SECTION *cs, LONG *val);
44static int do_sema_b_release(HANDLE sema, LONG count,CRITICAL_SECTION *cs, LONG *val);
45static void cleanup_wait(void *arg);
46
47typedef struct sCondWaitHelper {
48 cond_t *c;
49 pthread_mutex_t *external_mutex;
50 int *r;
51} sCondWaitHelper;
52
53int do_sema_b_wait_intern (HANDLE sema, int nointerrupt, DWORD timeout);
54
55#ifdef WINPTHREAD_DBG
56static int print_state = 0;
57static FILE *fo;
58void cond_print_set(int state, FILE *f)
59{
60 if (f) fo = f;
61 if (!fo) fo = stdout;
62 print_state = state;
63}
64
65void cond_print(volatile pthread_cond_t *c, char *txt)
66{
67 if (!print_state) return;
68 cond_t *c_ = (cond_t *)*c;
69 if (c_ == NULL) {
70 fprintf(fo,"C%p %lu %s\n",(void *)*c,GetCurrentThreadId(),txt);
71 } else {
72 fprintf(fo,"C%p %lu V=%0X w=%ld %s\n",
73 (void *)*c,
74 GetCurrentThreadId(),
75 (int)c_->valid,
76 c_->waiters_count_,
77 txt
78 );
79 }
80}
81#endif
82
83static pthread_spinlock_t cond_locked = PTHREAD_SPINLOCK_INITIALIZER;
84
85static int
86cond_static_init (pthread_cond_t *c)
87{
88 int r = 0;
89
90 pthread_spin_lock (&cond_locked);
91 if (c == NULL)
92 r = EINVAL;
93 else if (*c == PTHREAD_COND_INITIALIZER)
94 r = pthread_cond_init (c, NULL);
95 else
96 /* We assume someone was faster ... */
97 r = 0;
98 pthread_spin_unlock (&cond_locked);
99 return r;
100}
101
102int
103pthread_condattr_destroy (pthread_condattr_t *a)
104{
105 if (!a)
106 return EINVAL;
107 *a = 0;
108 return 0;
109}
110
111int
112pthread_condattr_init (pthread_condattr_t *a)
113{
114 if (!a)
115 return EINVAL;
116 *a = 0;
117 return 0;
118}
119
120int
121pthread_condattr_getpshared (const pthread_condattr_t *a, int *s)
122{
123 if (!a || !s)
124 return EINVAL;
125 *s = *a;
126 return 0;
127}
128
129int
130pthread_condattr_getclock (const pthread_condattr_t *a, clockid_t *clock_id)
131{
132 if (!a || !clock_id)
133 return EINVAL;
134 *clock_id = 0;
135 return 0;
136}
137
138int
139pthread_condattr_setclock(pthread_condattr_t *a, clockid_t clock_id)
140{
141 if (!a || clock_id != 0)
142 return EINVAL;
143 return 0;
144}
145
146int
147__pthread_clock_nanosleep (clockid_t clock_id, int flags, const struct timespec *rqtp,
148 struct timespec *rmtp)
149{
150 unsigned long long tick, tick2;
151 unsigned long long delay;
152 DWORD dw;
153
154 if (clock_id != CLOCK_REALTIME
155 && clock_id != CLOCK_MONOTONIC
156 && clock_id != CLOCK_PROCESS_CPUTIME_ID)
157 return EINVAL;
158 if ((flags & TIMER_ABSTIME) != 0)
159 delay = _pthread_rel_time_in_ms (rqtp);
160 else
161 delay = _pthread_time_in_ms_from_timespec (rqtp);
162 do
163 {
164 dw = (DWORD) (delay >= 99999ULL ? 99999ULL : delay);
165 tick = _pthread_time_in_ms ();
166 pthread_delay_np_ms (dw);
167 tick2 = _pthread_time_in_ms ();
168 tick2 -= tick;
169 if (tick2 >= delay)
170 delay = 0;
171 else
172 delay -= tick2;
173 }
174 while (delay != 0ULL);
175 if (rmtp)
176 memset (rmtp, 0, sizeof (*rmtp));
177 return 0;
178}
179
180int
181pthread_condattr_setpshared (pthread_condattr_t *a, int s)
182{
183 if (!a || (s != PTHREAD_PROCESS_SHARED && s != PTHREAD_PROCESS_PRIVATE))
184 return EINVAL;
185 if (s == PTHREAD_PROCESS_SHARED)
186 {
187 *a = PTHREAD_PROCESS_PRIVATE;
188 return ENOSYS;
189 }
190 *a = s;
191 return 0;
192}
193
194int
195pthread_cond_init (pthread_cond_t *c, const pthread_condattr_t *a)
196{
197 cond_t *_c;
198 int r = 0;
199
200 if (!c)
201 return EINVAL;
202 if (a && *a == PTHREAD_PROCESS_SHARED)
203 return ENOSYS;
204
205 if ((_c = calloc(1, sizeof(*_c))) == NULL)
206 return ENOMEM;
207
208 _c->valid = DEAD_COND;
209 _c->busy = 0;
210 _c->waiters_count_ = 0;
211 _c->waiters_count_gone_ = 0;
212 _c->waiters_count_unblock_ = 0;
213
214 _c->sema_q = CreateSemaphore (NULL, /* no security */
215 0, /* initially 0 */
216 0x7fffffff, /* max count */
217 NULL); /* unnamed */
218 _c->sema_b = CreateSemaphore (NULL, /* no security */
219 0, /* initially 0 */
220 0x7fffffff, /* max count */
221 NULL);
222 if (_c->sema_q == NULL || _c->sema_b == NULL) {
223 if (_c->sema_q != NULL)
224 CloseHandle (_c->sema_q);
225 if (_c->sema_b != NULL)
226 CloseHandle (_c->sema_b);
227 free (_c);
228 r = EAGAIN;
229 } else {
230 InitializeCriticalSection(&_c->waiters_count_lock_);
231 InitializeCriticalSection(&_c->waiters_b_lock_);
232 InitializeCriticalSection(&_c->waiters_q_lock_);
233 _c->value_q = 0;
234 _c->value_b = 1;
235 }
236 if (!r)
237 {
238 _c->valid = LIFE_COND;
239 *c = (pthread_cond_t)_c;
240 }
241 else
242 *c = (pthread_cond_t)NULL;
243 return r;
244}
245
246int
247pthread_cond_destroy (pthread_cond_t *c)
248{
249 cond_t *_c;
250 int r;
251 if (!c || !*c)
252 return EINVAL;
253 if (*c == PTHREAD_COND_INITIALIZER)
254 {
255 pthread_spin_lock (&cond_locked);
256 if (*c == PTHREAD_COND_INITIALIZER)
257 {
258 *c = (pthread_cond_t)NULL;
259 r = 0;
260 }
261 else
262 r = EBUSY;
263 pthread_spin_unlock (&cond_locked);
264 return r;
265 }
266 _c = (cond_t *) *c;
267 r = do_sema_b_wait(_c->sema_b, 0, INFINITE,&_c->waiters_b_lock_,&_c->value_b);
268 if (r != 0)
269 return r;
270 if (!TryEnterCriticalSection (&_c->waiters_count_lock_))
271 {
272 do_sema_b_release (_c->sema_b, 1,&_c->waiters_b_lock_,&_c->value_b);
273 return EBUSY;
274 }
275 if (_c->waiters_count_ > _c->waiters_count_gone_)
276 {
277 r = do_sema_b_release (_c->sema_b, 1,&_c->waiters_b_lock_,&_c->value_b);
278 if (!r) r = EBUSY;
279 LeaveCriticalSection(&_c->waiters_count_lock_);
280 return r;
281 }
282 *c = (pthread_cond_t)NULL;
283 do_sema_b_release (_c->sema_b, 1,&_c->waiters_b_lock_,&_c->value_b);
284
285 if (!CloseHandle (_c->sema_q) && !r)
286 r = EINVAL;
287 if (!CloseHandle (_c->sema_b) && !r)
288 r = EINVAL;
289 LeaveCriticalSection (&_c->waiters_count_lock_);
290 DeleteCriticalSection(&_c->waiters_count_lock_);
291 DeleteCriticalSection(&_c->waiters_b_lock_);
292 DeleteCriticalSection(&_c->waiters_q_lock_);
293 _c->valid = DEAD_COND;
294 free(_c);
295 return 0;
296}
297
298int
299pthread_cond_signal (pthread_cond_t *c)
300{
301 cond_t *_c;
302 int r;
303
304 if (!c || !*c)
305 return EINVAL;
306 _c = (cond_t *)*c;
307 if (_c == (cond_t *)PTHREAD_COND_INITIALIZER)
308 return 0;
309 else if (_c->valid != (unsigned int)LIFE_COND)
310 return EINVAL;
311
312 EnterCriticalSection (&_c->waiters_count_lock_);
313 /* If there aren't any waiters, then this is a no-op. */
314 if (_c->waiters_count_unblock_ != 0)
315 {
316 if (_c->waiters_count_ == 0)
317 {
318 LeaveCriticalSection (&_c->waiters_count_lock_);
319 /* pthread_testcancel(); */
320 return 0;
321 }
322 _c->waiters_count_ -= 1;
323 _c->waiters_count_unblock_ += 1;
324 }
325 else if (_c->waiters_count_ > _c->waiters_count_gone_)
326 {
327 r = do_sema_b_wait (_c->sema_b, 1, INFINITE,&_c->waiters_b_lock_,&_c->value_b);
328 if (r != 0)
329 {
330 LeaveCriticalSection (&_c->waiters_count_lock_);
331 /* pthread_testcancel(); */
332 return r;
333 }
334 if (_c->waiters_count_gone_ != 0)
335 {
336 _c->waiters_count_ -= _c->waiters_count_gone_;
337 _c->waiters_count_gone_ = 0;
338 }
339 _c->waiters_count_ -= 1;
340 _c->waiters_count_unblock_ = 1;
341 }
342 else
343 {
344 LeaveCriticalSection (&_c->waiters_count_lock_);
345 /* pthread_testcancel(); */
346 return 0;
347 }
348 LeaveCriticalSection (&_c->waiters_count_lock_);
349 r = do_sema_b_release(_c->sema_q, 1,&_c->waiters_q_lock_,&_c->value_q);
350 /* pthread_testcancel(); */
351 return r;
352}
353
354int
355pthread_cond_broadcast (pthread_cond_t *c)
356{
357 cond_t *_c;
358 int r;
359 int relCnt = 0;
360
361 if (!c || !*c)
362 return EINVAL;
363 _c = (cond_t *)*c;
364 if (_c == (cond_t*)PTHREAD_COND_INITIALIZER)
365 return 0;
366 else if (_c->valid != (unsigned int)LIFE_COND)
367 return EINVAL;
368
369 EnterCriticalSection (&_c->waiters_count_lock_);
370 /* If there aren't any waiters, then this is a no-op. */
371 if (_c->waiters_count_unblock_ != 0)
372 {
373 if (_c->waiters_count_ == 0)
374 {
375 LeaveCriticalSection (&_c->waiters_count_lock_);
376 /* pthread_testcancel(); */
377 return 0;
378 }
379 relCnt = _c->waiters_count_;
380 _c->waiters_count_ = 0;
381 _c->waiters_count_unblock_ += relCnt;
382 }
383 else if (_c->waiters_count_ > _c->waiters_count_gone_)
384 {
385 r = do_sema_b_wait (_c->sema_b, 1, INFINITE,&_c->waiters_b_lock_,&_c->value_b);
386 if (r != 0)
387 {
388 LeaveCriticalSection (&_c->waiters_count_lock_);
389 /* pthread_testcancel(); */
390 return r;
391 }
392 if (_c->waiters_count_gone_ != 0)
393 {
394 _c->waiters_count_ -= _c->waiters_count_gone_;
395 _c->waiters_count_gone_ = 0;
396 }
397 relCnt = _c->waiters_count_;
398 _c->waiters_count_ = 0;
399 _c->waiters_count_unblock_ = relCnt;
400 }
401 else
402 {
403 LeaveCriticalSection (&_c->waiters_count_lock_);
404 /* pthread_testcancel(); */
405 return 0;
406 }
407 LeaveCriticalSection (&_c->waiters_count_lock_);
408 r = do_sema_b_release(_c->sema_q, relCnt,&_c->waiters_q_lock_,&_c->value_q);
409 /* pthread_testcancel(); */
410 return r;
411}
412
413int
414pthread_cond_wait (pthread_cond_t *c, pthread_mutex_t *external_mutex)
415{
416 sCondWaitHelper ch;
417 cond_t *_c;
418 int r;
419
420 /* pthread_testcancel(); */
421
422 if (!c || *c == (pthread_cond_t)NULL)
423 return EINVAL;
424 _c = (cond_t *)*c;
425 if (*c == PTHREAD_COND_INITIALIZER)
426 {
427 r = cond_static_init(c);
428 if (r != 0 && r != EBUSY)
429 return r;
430 _c = (cond_t *) *c;
431 } else if (_c->valid != (unsigned int)LIFE_COND)
432 return EINVAL;
433
434tryagain:
435 r = do_sema_b_wait (_c->sema_b, 0, INFINITE,&_c->waiters_b_lock_,&_c->value_b);
436 if (r != 0)
437 return r;
438
439 if (!TryEnterCriticalSection (&_c->waiters_count_lock_))
440 {
441 r = do_sema_b_release (_c->sema_b, 1,&_c->waiters_b_lock_,&_c->value_b);
442 if (r != 0)
443 return r;
444 sched_yield();
445 goto tryagain;
446 }
447
448 _c->waiters_count_++;
449 LeaveCriticalSection(&_c->waiters_count_lock_);
450 r = do_sema_b_release (_c->sema_b, 1,&_c->waiters_b_lock_,&_c->value_b);
451 if (r != 0)
452 return r;
453
454 ch.c = _c;
455 ch.r = &r;
456 ch.external_mutex = external_mutex;
457
458 pthread_cleanup_push(cleanup_wait, (void *) &ch);
459 r = pthread_mutex_unlock(external_mutex);
460 if (!r)
461 r = do_sema_b_wait (_c->sema_q, 0, INFINITE,&_c->waiters_q_lock_,&_c->value_q);
462
463 pthread_cleanup_pop(1);
464 return r;
465}
466
467static int
468pthread_cond_timedwait_impl (pthread_cond_t *c, pthread_mutex_t *external_mutex, const struct timespec *t, int rel)
469{
470 sCondWaitHelper ch;
471 DWORD dwr;
472 int r;
473 cond_t *_c;
474
475 /* pthread_testcancel(); */
476
477 if (!c || !*c)
478 return EINVAL;
479 _c = (cond_t *)*c;
480 if (_c == (cond_t *)PTHREAD_COND_INITIALIZER)
481 {
482 r = cond_static_init(c);
483 if (r && r != EBUSY)
484 return r;
485 _c = (cond_t *) *c;
486 } else if ((_c)->valid != (unsigned int)LIFE_COND)
487 return EINVAL;
488
489 if (rel == 0)
490 {
491 dwr = dwMilliSecs(_pthread_rel_time_in_ms(t));
492 }
493 else
494 {
495 dwr = dwMilliSecs(_pthread_time_in_ms_from_timespec(t));
496 }
497
498tryagain:
499 r = do_sema_b_wait (_c->sema_b, 0, INFINITE,&_c->waiters_b_lock_,&_c->value_b);
500 if (r != 0)
501 return r;
502
503 if (!TryEnterCriticalSection (&_c->waiters_count_lock_))
504 {
505 r = do_sema_b_release (_c->sema_b, 1,&_c->waiters_b_lock_,&_c->value_b);
506 if (r != 0)
507 return r;
508 sched_yield();
509 goto tryagain;
510 }
511
512 _c->waiters_count_++;
513 LeaveCriticalSection(&_c->waiters_count_lock_);
514 r = do_sema_b_release (_c->sema_b, 1,&_c->waiters_b_lock_,&_c->value_b);
515 if (r != 0)
516 return r;
517
518 ch.c = _c;
519 ch.r = &r;
520 ch.external_mutex = external_mutex;
521 {
522 pthread_cleanup_push(cleanup_wait, (void *) &ch);
523
524 r = pthread_mutex_unlock(external_mutex);
525 if (!r)
526 r = do_sema_b_wait (_c->sema_q, 0, dwr,&_c->waiters_q_lock_,&_c->value_q);
527
528 pthread_cleanup_pop(1);
529 }
530 return r;
531}
532
533int
534pthread_cond_timedwait(pthread_cond_t *c, pthread_mutex_t *m, const struct timespec *t)
535{
536 return pthread_cond_timedwait_impl(c, m, t, 0);
537}
538
539int
540pthread_cond_timedwait_relative_np(pthread_cond_t *c, pthread_mutex_t *m, const struct timespec *t)
541{
542 return pthread_cond_timedwait_impl(c, m, t, 1);
543}
544
545static void
546cleanup_wait (void *arg)
547{
548 int n, r;
549 sCondWaitHelper *ch = (sCondWaitHelper *) arg;
550 cond_t *_c;
551
552 _c = ch->c;
553 EnterCriticalSection (&_c->waiters_count_lock_);
554 n = _c->waiters_count_unblock_;
555 if (n != 0)
556 _c->waiters_count_unblock_ -= 1;
557 else if ((INT_MAX/2) - 1 == _c->waiters_count_gone_)
558 {
559 _c->waiters_count_gone_ += 1;
560 r = do_sema_b_wait (_c->sema_b, 1, INFINITE,&_c->waiters_b_lock_,&_c->value_b);
561 if (r != 0)
562 {
563 LeaveCriticalSection(&_c->waiters_count_lock_);
564 ch->r[0] = r;
565 return;
566 }
567 _c->waiters_count_ -= _c->waiters_count_gone_;
568 r = do_sema_b_release (_c->sema_b, 1,&_c->waiters_b_lock_,&_c->value_b);
569 if (r != 0)
570 {
571 LeaveCriticalSection(&_c->waiters_count_lock_);
572 ch->r[0] = r;
573 return;
574 }
575 _c->waiters_count_gone_ = 0;
576 }
577 else
578 _c->waiters_count_gone_ += 1;
579 LeaveCriticalSection (&_c->waiters_count_lock_);
580
581 if (n == 1)
582 {
583 r = do_sema_b_release (_c->sema_b, 1,&_c->waiters_b_lock_,&_c->value_b);
584 if (r != 0)
585 {
586 ch->r[0] = r;
587 return;
588 }
589 }
590 r = pthread_mutex_lock(ch->external_mutex);
591 if (r != 0)
592 ch->r[0] = r;
593}
594
595static int
596do_sema_b_wait (HANDLE sema, int nointerrupt, DWORD timeout,CRITICAL_SECTION *cs, LONG *val)
597{
598 int r;
599 LONG v;
600 EnterCriticalSection(cs);
601 InterlockedDecrement(val);
602 v = val[0];
603 LeaveCriticalSection(cs);
604 if (v >= 0)
605 return 0;
606 r = do_sema_b_wait_intern (sema, nointerrupt, timeout);
607 EnterCriticalSection(cs);
608 if (r != 0)
609 InterlockedIncrement(val);
610 LeaveCriticalSection(cs);
611 return r;
612}
613
614int
615do_sema_b_wait_intern (HANDLE sema, int nointerrupt, DWORD timeout)
616{
617 HANDLE arr[2];
618 DWORD maxH = 1;
619 int r = 0;
620 DWORD res, dt;
621 if (nointerrupt == 1)
622 {
623 res = _pthread_wait_for_single_object(sema, timeout);
624 switch (res) {
625 case WAIT_TIMEOUT:
626 r = ETIMEDOUT;
627 break;
628 case WAIT_ABANDONED:
629 r = EPERM;
630 break;
631 case WAIT_OBJECT_0:
632 break;
633 default:
634 /*We can only return EINVAL though it might not be posix compliant */
635 r = EINVAL;
636 }
637 if (r != 0 && r != EINVAL && WaitForSingleObject(sema, 0) == WAIT_OBJECT_0)
638 r = 0;
639 return r;
640 }
641 arr[0] = sema;
642 arr[1] = (HANDLE) pthread_getevent ();
643 if (arr[1] != NULL) maxH += 1;
644 if (maxH == 2)
645 {
646redo:
647 res = _pthread_wait_for_multiple_objects(maxH, arr, 0, timeout);
648 switch (res) {
649 case WAIT_TIMEOUT:
650 r = ETIMEDOUT;
651 break;
652 case (WAIT_OBJECT_0 + 1):
653 ResetEvent(arr[1]);
654 if (nointerrupt != 2)
655 {
656 pthread_testcancel();
657 return EINVAL;
658 }
659 pthread_testcancel ();
660 goto redo;
661 case WAIT_ABANDONED:
662 r = EPERM;
663 break;
664 case WAIT_OBJECT_0:
665 r = 0;
666 break;
667 default:
668 /*We can only return EINVAL though it might not be posix compliant */
669 r = EINVAL;
670 }
671 if (r != 0 && r != EINVAL && WaitForSingleObject(arr[0], 0) == WAIT_OBJECT_0)
672 r = 0;
673 if (r != 0 && nointerrupt != 2 && __pthread_shallcancel ())
674 return EINVAL;
675 return r;
676 }
677 if (timeout == INFINITE)
678 {
679 do {
680 res = _pthread_wait_for_single_object(sema, 40);
681 switch (res) {
682 case WAIT_TIMEOUT:
683 r = ETIMEDOUT;
684 break;
685 case WAIT_ABANDONED:
686 r = EPERM;
687 break;
688 case WAIT_OBJECT_0:
689 r = 0;
690 break;
691 default:
692 /*We can only return EINVAL though it might not be posix compliant */
693 r = EINVAL;
694 }
695 if (r != 0 && __pthread_shallcancel ())
696 {
697 if (nointerrupt != 2)
698 pthread_testcancel();
699 return EINVAL;
700 }
701 } while (r == ETIMEDOUT);
702 if (r != 0 && r != EINVAL && WaitForSingleObject(sema, 0) == WAIT_OBJECT_0)
703 r = 0;
704 return r;
705 }
706 dt = 20;
707 do {
708 if (dt > timeout) dt = timeout;
709 res = _pthread_wait_for_single_object(sema, dt);
710 switch (res) {
711 case WAIT_TIMEOUT:
712 r = ETIMEDOUT;
713 break;
714 case WAIT_ABANDONED:
715 r = EPERM;
716 break;
717 case WAIT_OBJECT_0:
718 r = 0;
719 break;
720 default:
721 /*We can only return EINVAL though it might not be posix compliant */
722 r = EINVAL;
723 }
724 timeout -= dt;
725 if (timeout != 0 && r != 0 && __pthread_shallcancel ())
726 return EINVAL;
727 } while (r == ETIMEDOUT && timeout != 0);
728 if (r != 0 && r == ETIMEDOUT && WaitForSingleObject(sema, 0) == WAIT_OBJECT_0)
729 r = 0;
730 if (r != 0 && nointerrupt != 2)
731 pthread_testcancel();
732 return r;
733}
734
735static int
736do_sema_b_release(HANDLE sema, LONG count,CRITICAL_SECTION *cs, LONG *val)
737{
738 int wc;
739 EnterCriticalSection(cs);
740 if (((long long) val[0] + (long long) count) > (long long) 0x7fffffffLL)
741 {
742 LeaveCriticalSection(cs);
743 return ERANGE;
744 }
745 wc = -val[0];
746 InterlockedExchangeAdd(val, count);
747 if (wc <= 0 || ReleaseSemaphore(sema, (wc < count ? wc : count), NULL))
748 {
749 LeaveCriticalSection(cs);
750 return 0;
751 }
752 InterlockedExchangeAdd(val, -count);
753 LeaveCriticalSection(cs);
754 return EINVAL;
755}
lib/libc/mingw/winpthreads/cond.h created+63
......@@ -0,0 +1,63 @@
1/*
2 Copyright (c) 2011-2016 mingw-w64 project
3
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the "Software"),
6 to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 DEALINGS IN THE SOFTWARE.
21*/
22
23#ifndef WIN_PTHREADS_COND_H
24#define WIN_PTHREADS_COND_H
25
26#include <windows.h>
27
28#define CHECK_COND(c) \
29 do { \
30 if (!(c) || !*c || (*c == PTHREAD_COND_INITIALIZER) \
31 || ( ((cond_t *)(*c))->valid != (unsigned int)LIFE_COND ) ) \
32 return EINVAL; \
33 } while (0)
34
35#define LIFE_COND 0xC0BAB1FD
36#define DEAD_COND 0xC0DEADBF
37
38#define STATIC_COND_INITIALIZER(x) ((pthread_cond_t)(x) == ((pthread_cond_t)PTHREAD_COND_INITIALIZER))
39
40typedef struct cond_t cond_t;
41struct cond_t
42{
43 unsigned int valid;
44 int busy;
45 LONG waiters_count_; /* Number of waiting threads. */
46 LONG waiters_count_unblock_; /* Number of waiting threads whitch can be unblocked. */
47 LONG waiters_count_gone_; /* Number of waiters which are gone. */
48 CRITICAL_SECTION waiters_count_lock_; /* Serialize access to <waiters_count_>. */
49 CRITICAL_SECTION waiters_q_lock_; /* Serialize access to sema_q. */
50 LONG value_q;
51 CRITICAL_SECTION waiters_b_lock_; /* Serialize access to sema_b. */
52 LONG value_b;
53 HANDLE sema_q; /* Semaphore used to queue up threads waiting for the condition to
54 become signaled. */
55 HANDLE sema_b; /* Semaphore used to queue up threads waiting for the condition which
56 became signaled. */
57};
58
59void cond_print_set(int state, FILE *f);
60
61void cond_print(volatile pthread_cond_t *c, char *txt);
62
63#endif
lib/libc/mingw/winpthreads/misc.c created+205
......@@ -0,0 +1,205 @@
1/*
2 Copyright (c) 2011-2016 mingw-w64 project
3
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the "Software"),
6 to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 DEALINGS IN THE SOFTWARE.
21*/
22
23#include <windows.h>
24#include "pthread.h"
25#include "misc.h"
26
27void (WINAPI *_pthread_get_system_time_best_as_file_time) (LPFILETIME) = NULL;
28static ULONGLONG (WINAPI *_pthread_get_tick_count_64) (VOID);
29HRESULT (WINAPI *_pthread_set_thread_description) (HANDLE, PCWSTR) = NULL;
30
31#if defined(__GNUC__) || defined(__clang__)
32__attribute__((constructor(0)))
33#endif
34static void winpthreads_init(void)
35{
36 HMODULE mod = GetModuleHandleA("kernel32.dll");
37 if (mod)
38 {
39 _pthread_get_tick_count_64 =
40 (ULONGLONG (WINAPI *)(VOID))(void*) GetProcAddress(mod, "GetTickCount64");
41
42 /* <1us precision on Windows 10 */
43 _pthread_get_system_time_best_as_file_time =
44 (void (WINAPI *)(LPFILETIME))(void*) GetProcAddress(mod, "GetSystemTimePreciseAsFileTime");
45 }
46
47 if (!_pthread_get_system_time_best_as_file_time)
48 /* >15ms precision on Windows 10 */
49 _pthread_get_system_time_best_as_file_time = GetSystemTimeAsFileTime;
50
51 mod = GetModuleHandleA("kernelbase.dll");
52 if (mod)
53 {
54 _pthread_set_thread_description =
55 (HRESULT (WINAPI *)(HANDLE, PCWSTR))(void*) GetProcAddress(mod, "SetThreadDescription");
56 }
57}
58
59#if defined(_MSC_VER) && !defined(__clang__)
60/* Force a reference to __xc_t to prevent whole program optimization
61 * from discarding the variable. */
62
63/* On x86, symbols are prefixed with an underscore. */
64# if defined(_M_IX86)
65# pragma comment(linker, "/include:___xc_t")
66# else
67# pragma comment(linker, "/include:__xc_t")
68# endif
69
70#pragma section(".CRT$XCT", long, read)
71__declspec(allocate(".CRT$XCT"))
72extern const _PVFV __xc_t;
73const _PVFV __xc_t = winpthreads_init;
74#endif
75
76unsigned long long _pthread_time_in_ms(void)
77{
78 FILETIME ft;
79
80 GetSystemTimeAsFileTime(&ft);
81 return (((unsigned long long)ft.dwHighDateTime << 32) + ft.dwLowDateTime
82 - 0x19DB1DED53E8000ULL) / 10000ULL;
83}
84
85unsigned long long _pthread_time_in_ms_from_timespec(const struct timespec *ts)
86{
87 unsigned long long t = (unsigned long long) ts->tv_sec * 1000LL;
88 /* The +999999 is here to ensure that the division always rounds up */
89 t += (unsigned long long) (ts->tv_nsec + 999999) / 1000000;
90
91 return t;
92}
93
94unsigned long long _pthread_rel_time_in_ms(const struct timespec *ts)
95{
96 unsigned long long t1 = _pthread_time_in_ms_from_timespec(ts);
97 unsigned long long t2 = _pthread_time_in_ms();
98
99 /* Prevent underflow */
100 if (t1 < t2) return 0;
101 return t1 - t2;
102}
103
104static unsigned long long
105_pthread_get_tick_count (long long *frequency)
106{
107 if (_pthread_get_tick_count_64 != NULL)
108 return _pthread_get_tick_count_64 ();
109
110 LARGE_INTEGER freq, timestamp;
111
112 if (*frequency == 0)
113 {
114 if (QueryPerformanceFrequency (&freq))
115 *frequency = freq.QuadPart;
116 else
117 *frequency = -1;
118 }
119
120 if (*frequency > 0 && QueryPerformanceCounter (&timestamp))
121 return timestamp.QuadPart / (*frequency / 1000);
122
123 /* Fallback */
124 return GetTickCount ();
125}
126
127/* A wrapper around WaitForSingleObject() that ensures that
128 * the wait function does not time out before the time
129 * actually runs out. This is needed because WaitForSingleObject()
130 * might have poor accuracy, returning earlier than expected.
131 * On the other hand, returning a bit *later* than expected
132 * is acceptable in a preemptive multitasking environment.
133 */
134unsigned long
135_pthread_wait_for_single_object (void *handle, unsigned long timeout)
136{
137 DWORD result;
138 unsigned long long start_time, end_time;
139 unsigned long wait_time;
140 long long frequency = 0;
141
142 if (timeout == INFINITE || timeout == 0)
143 return WaitForSingleObject ((HANDLE) handle, (DWORD) timeout);
144
145 start_time = _pthread_get_tick_count (&frequency);
146 end_time = start_time + timeout;
147 wait_time = timeout;
148
149 do
150 {
151 unsigned long long current_time;
152
153 result = WaitForSingleObject ((HANDLE) handle, (DWORD) wait_time);
154 if (result != WAIT_TIMEOUT)
155 break;
156
157 current_time = _pthread_get_tick_count (&frequency);
158 if (current_time >= end_time)
159 break;
160
161 wait_time = (DWORD) (end_time - current_time);
162 } while (TRUE);
163
164 return result;
165}
166
167/* A wrapper around WaitForMultipleObjects() that ensures that
168 * the wait function does not time out before the time
169 * actually runs out. This is needed because WaitForMultipleObjects()
170 * might have poor accuracy, returning earlier than expected.
171 * On the other hand, returning a bit *later* than expected
172 * is acceptable in a preemptive multitasking environment.
173 */
174unsigned long
175_pthread_wait_for_multiple_objects (unsigned long count, void **handles, unsigned int all, unsigned long timeout)
176{
177 DWORD result;
178 unsigned long long start_time, end_time;
179 unsigned long wait_time;
180 long long frequency = 0;
181
182 if (timeout == INFINITE || timeout == 0)
183 return WaitForMultipleObjects ((DWORD) count, (HANDLE *) handles, all, (DWORD) timeout);
184
185 start_time = _pthread_get_tick_count (&frequency);
186 end_time = start_time + timeout;
187 wait_time = timeout;
188
189 do
190 {
191 unsigned long long current_time;
192
193 result = WaitForMultipleObjects ((DWORD) count, (HANDLE *) handles, all, (DWORD) wait_time);
194 if (result != WAIT_TIMEOUT)
195 break;
196
197 current_time = _pthread_get_tick_count (&frequency);
198 if (current_time >= end_time)
199 break;
200
201 wait_time = (DWORD) (end_time - current_time);
202 } while (TRUE);
203
204 return result;
205}
lib/libc/mingw/winpthreads/misc.h created+127
......@@ -0,0 +1,127 @@
1/*
2 Copyright (c) 2011-2016 mingw-w64 project
3
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the "Software"),
6 to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 DEALINGS IN THE SOFTWARE.
21*/
22
23#ifndef WIN_PTHREADS_MISC_H
24#define WIN_PTHREADS_MISC_H
25
26#include "pthread_compat.h"
27
28#ifndef assert
29
30#ifndef ASSERT_TRACE
31# define ASSERT_TRACE 0
32#else
33# undef ASSERT_TRACE
34# define ASSERT_TRACE 0
35#endif
36
37# define assert(e) \
38 ((e) ? ((ASSERT_TRACE) ? fprintf(stderr, \
39 "Assertion succeeded: (%s), file %s, line %d\n", \
40 #e, __FILE__, (int) __LINE__), \
41 fflush(stderr) : \
42 0) : \
43 (fprintf(stderr, "Assertion failed: (%s), file %s, line %d\n", \
44 #e, __FILE__, (int) __LINE__), exit(1), 0))
45
46# define fixme(e) \
47 ((e) ? ((ASSERT_TRACE) ? fprintf(stderr, \
48 "Assertion succeeded: (%s), file %s, line %d\n", \
49 #e, __FILE__, (int) __LINE__), \
50 fflush(stderr) : \
51 0) : \
52 (fprintf(stderr, "FIXME: (%s), file %s, line %d\n", \
53 #e, __FILE__, (int) __LINE__), 0, 0))
54
55#endif
56
57#define PTR2INT(x) ((int)(uintptr_t)(x))
58
59#if SIZE_MAX>UINT_MAX
60typedef long long LONGBAG;
61#else
62typedef long LONGBAG;
63#endif
64
65#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
66#undef GetHandleInformation
67#define GetHandleInformation(h,f) (1)
68#endif
69
70#define CHECK_HANDLE(h) \
71 do { \
72 DWORD dwFlags; \
73 if (!(h) || ((h) == INVALID_HANDLE_VALUE) || !GetHandleInformation((h), &dwFlags)) \
74 return EINVAL; \
75 } while (0)
76
77#define CHECK_PTR(p) do { if (!(p)) return EINVAL; } while (0)
78
79#define UPD_RESULT(x,r) do { int _r = (x); (r) = (r) ? (r) : _r; } while (0)
80
81#define CHECK_THREAD(t) \
82 do { \
83 CHECK_PTR(t); \
84 CHECK_HANDLE((t)->h); \
85 } while (0)
86
87#define CHECK_OBJECT(o, e) \
88 do { \
89 DWORD dwFlags; \
90 if (!(o)) return e; \
91 if (!((o)->h) || (((o)->h) == INVALID_HANDLE_VALUE) || !GetHandleInformation(((o)->h), &dwFlags)) \
92 return e; \
93 } while (0)
94
95#define VALID(x) if (!(p)) return EINVAL;
96
97/* ms can be 64 bit, solve wrap-around issues: */
98static WINPTHREADS_INLINE unsigned long dwMilliSecs(unsigned long long ms)
99{
100 if (ms >= 0xffffffffULL) return 0xfffffffful;
101 return (unsigned long) ms;
102}
103
104unsigned long long _pthread_time_in_ms(void);
105unsigned long long _pthread_time_in_ms_from_timespec(const struct timespec *ts);
106unsigned long long _pthread_rel_time_in_ms(const struct timespec *ts);
107unsigned long _pthread_wait_for_single_object (void *handle, unsigned long timeout);
108unsigned long _pthread_wait_for_multiple_objects (unsigned long count, void **handles, unsigned int all, unsigned long timeout);
109
110extern void (WINAPI *_pthread_get_system_time_best_as_file_time) (LPFILETIME);
111extern HRESULT (WINAPI *_pthread_set_thread_description) (HANDLE, PCWSTR);
112
113#if defined(__GNUC__) || defined(__clang__)
114#define likely(cond) __builtin_expect((cond) != 0, 1)
115#define unlikely(cond) __builtin_expect((cond) != 0, 0)
116#else
117#define likely(cond) (cond)
118#define unlikely(cond) (cond)
119#endif
120
121#if defined(__GNUC__) || defined(__clang__)
122#define UNREACHABLE() __builtin_unreachable()
123#elif defined(_MSC_VER)
124#define UNREACHABLE() __assume(0)
125#endif
126
127#endif
lib/libc/mingw/winpthreads/mutex.c created+381
......@@ -0,0 +1,381 @@
1/*
2 Copyright (c) 2011, 2014 mingw-w64 project
3 Copyright (c) 2015 Intel Corporation
4
5 Permission is hereby granted, free of charge, to any person obtaining a
6 copy of this software and associated documentation files (the "Software"),
7 to deal in the Software without restriction, including without limitation
8 the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 and/or sell copies of the Software, and to permit persons to whom the
10 Software is furnished to do so, subject to the following conditions:
11
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
14
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 DEALINGS IN THE SOFTWARE.
22*/
23
24#include <windows.h>
25#include <stdio.h>
26#include <malloc.h>
27#include <stdbool.h>
28#include "pthread.h"
29#include "misc.h"
30
31typedef enum {
32 Unlocked, /* Not locked. */
33 Locked, /* Locked but without waiters. */
34 Waiting, /* Locked, may have waiters. */
35} mutex_state_t;
36
37typedef enum {
38 Normal,
39 Errorcheck,
40 Recursive,
41} mutex_type_t;
42
43/* The heap-allocated part of a mutex. */
44typedef struct {
45 mutex_state_t state;
46 mutex_type_t type;
47 HANDLE event; /* Auto-reset event, or NULL if not yet allocated. */
48 unsigned rec_lock; /* For recursive mutexes, the number of times the
49 mutex has been locked in excess by the same thread. */
50 volatile DWORD owner; /* For recursive and error-checking mutexes, the
51 ID of the owning thread if the mutex is locked. */
52} mutex_impl_t;
53
54/* Whether a mutex is still a static initializer (not a pointer to
55 a mutex_impl_t). */
56static bool
57is_static_initializer(pthread_mutex_t m)
58{
59 /* Treat 0 as a static initializer as well (for normal mutexes),
60 to tolerate sloppy code in libgomp. (We should rather fix that code!) */
61 intptr_t v = (intptr_t)m;
62 return v >= -3 && v <= 0;
63/* Should be simple:
64 return (uintptr_t)m >= (uintptr_t)-3; */
65}
66
67/* Create and return the implementation part of a mutex from a static
68 initialiser. Return NULL on out-of-memory error. */
69static WINPTHREADS_ATTRIBUTE((noinline)) mutex_impl_t *
70mutex_impl_init(pthread_mutex_t *m, mutex_impl_t *mi)
71{
72 mutex_impl_t *new_mi = malloc(sizeof(mutex_impl_t));
73 if (new_mi == NULL)
74 return NULL;
75 new_mi->state = Unlocked;
76 new_mi->type = (mi == (void *)PTHREAD_RECURSIVE_MUTEX_INITIALIZER ? Recursive
77 : mi == (void *)PTHREAD_ERRORCHECK_MUTEX_INITIALIZER ? Errorcheck
78 : Normal);
79 new_mi->event = NULL;
80 new_mi->rec_lock = 0;
81 new_mi->owner = (DWORD)-1;
82 if (InterlockedCompareExchangePointer((PVOID volatile *)m, new_mi, mi) == mi) {
83 return new_mi;
84 } else {
85 /* Someone created the struct before us. */
86 free(new_mi);
87 return (mutex_impl_t *)*m;
88 }
89}
90
91/* Return the implementation part of a mutex, creating it if necessary.
92 Return NULL on out-of-memory error. */
93static inline mutex_impl_t *
94mutex_impl(pthread_mutex_t *m)
95{
96 mutex_impl_t *mi = (mutex_impl_t *)*m;
97 if (is_static_initializer((pthread_mutex_t)mi)) {
98 return mutex_impl_init(m, mi);
99 } else {
100 /* mi cannot be null here; avoid a test in the fast path. */
101 if (mi == NULL)
102 UNREACHABLE();
103 return mi;
104 }
105}
106
107/* Lock a mutex. Give up after 'timeout' ms (with ETIMEDOUT),
108 or never if timeout=INFINITE. */
109static inline int
110pthread_mutex_lock_intern (pthread_mutex_t *m, DWORD timeout)
111{
112 mutex_impl_t *mi = mutex_impl(m);
113 if (mi == NULL)
114 return ENOMEM;
115 mutex_state_t old_state = InterlockedExchange((long *)&mi->state, Locked);
116 if (unlikely(old_state != Unlocked)) {
117 /* The mutex is already locked. */
118
119 if (mi->type != Normal) {
120 /* Recursive or Errorcheck */
121 if (mi->owner == GetCurrentThreadId()) {
122 /* FIXME: A recursive mutex should not need two atomic ops when locking
123 recursively. We could rewrite by doing compare-and-swap instead of
124 test-and-set the first time, but it would lead to more code
125 duplication and add a conditional branch to the critical path. */
126 InterlockedCompareExchange((long *)&mi->state, old_state, Locked);
127 if (mi->type == Recursive) {
128 mi->rec_lock++;
129 return 0;
130 } else {
131 /* type == Errorcheck */
132 return EDEADLK;
133 }
134 }
135 }
136
137 /* Make sure there is an event object on which to wait. */
138 if (mi->event == NULL) {
139 /* Make an auto-reset event object. */
140 HANDLE ev = CreateEvent(NULL, false, false, NULL);
141 if (ev == NULL) {
142 switch (GetLastError()) {
143 case ERROR_ACCESS_DENIED:
144 return EPERM;
145 default:
146 return ENOMEM; /* Probably accurate enough. */
147 }
148 }
149 if (InterlockedCompareExchangePointer(&mi->event, ev, NULL) != NULL) {
150 /* Someone created the event before us. */
151 CloseHandle(ev);
152 }
153 }
154
155 /* At this point, mi->event is non-NULL. */
156
157 while (InterlockedExchange((long *)&mi->state, Waiting) != Unlocked) {
158 /* For timed locking attempts, it is possible (although unlikely)
159 that we are woken up but someone else grabs the lock before us,
160 and we have to go back to sleep again. In that case, the total
161 wait may be longer than expected. */
162
163 unsigned r = _pthread_wait_for_single_object(mi->event, timeout);
164 switch (r) {
165 case WAIT_TIMEOUT:
166 return ETIMEDOUT;
167 case WAIT_OBJECT_0:
168 break;
169 default:
170 return EINVAL;
171 }
172 }
173 }
174
175 if (mi->type != Normal)
176 mi->owner = GetCurrentThreadId();
177
178 return 0;
179}
180
181int
182pthread_mutex_lock (pthread_mutex_t *m)
183{
184 return pthread_mutex_lock_intern (m, INFINITE);
185}
186
187int pthread_mutex_timedlock(pthread_mutex_t *m, const struct timespec *ts)
188{
189 unsigned long long patience;
190 if (ts != NULL) {
191 unsigned long long end = _pthread_time_in_ms_from_timespec(ts);
192 unsigned long long now = _pthread_time_in_ms();
193 patience = end > now ? end - now : 0;
194 if (patience > 0xffffffff)
195 patience = INFINITE;
196 } else {
197 patience = INFINITE;
198 }
199 return pthread_mutex_lock_intern(m, patience);
200}
201
202int pthread_mutex_unlock(pthread_mutex_t *m)
203{
204 /* Here m might an initialiser of an error-checking or recursive mutex, in
205 which case the behaviour is well-defined, so we can't skip this check. */
206 mutex_impl_t *mi = mutex_impl(m);
207 if (mi == NULL)
208 return ENOMEM;
209
210 if (unlikely(mi->type != Normal)) {
211 if (mi->state == Unlocked)
212 return EINVAL;
213 if (mi->owner != GetCurrentThreadId())
214 return EPERM;
215 if (mi->rec_lock > 0) {
216 mi->rec_lock--;
217 return 0;
218 }
219 mi->owner = (DWORD)-1;
220 }
221 if (unlikely(InterlockedExchange((long *)&mi->state, Unlocked) == Waiting)) {
222 if (!SetEvent(mi->event))
223 return EPERM;
224 }
225 return 0;
226}
227
228int pthread_mutex_trylock(pthread_mutex_t *m)
229{
230 mutex_impl_t *mi = mutex_impl(m);
231 if (mi == NULL)
232 return ENOMEM;
233
234 if (InterlockedCompareExchange((long *)&mi->state, Locked, Unlocked) == Unlocked) {
235 if (mi->type != Normal)
236 mi->owner = GetCurrentThreadId();
237 return 0;
238 } else {
239 if (mi->type == Recursive && mi->owner == GetCurrentThreadId()) {
240 mi->rec_lock++;
241 return 0;
242 }
243 return EBUSY;
244 }
245}
246
247int
248pthread_mutex_init (pthread_mutex_t *m, const pthread_mutexattr_t *a)
249{
250 pthread_mutex_t init = PTHREAD_MUTEX_INITIALIZER;
251 if (a != NULL) {
252 int pshared;
253 if (pthread_mutexattr_getpshared(a, &pshared) == 0
254 && pshared == PTHREAD_PROCESS_SHARED)
255 return ENOSYS;
256
257 int type;
258 if (pthread_mutexattr_gettype(a, &type) == 0) {
259 switch (type) {
260 case PTHREAD_MUTEX_ERRORCHECK:
261 init = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER;
262 break;
263 case PTHREAD_MUTEX_RECURSIVE:
264 init = PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
265 break;
266 default:
267 init = PTHREAD_MUTEX_INITIALIZER;
268 break;
269 }
270 }
271 }
272 *m = init;
273 return 0;
274}
275
276int pthread_mutex_destroy (pthread_mutex_t *m)
277{
278 mutex_impl_t *mi = (mutex_impl_t *)*m;
279 if (!is_static_initializer((pthread_mutex_t)mi)) {
280 if (mi->event != NULL)
281 CloseHandle(mi->event);
282 free(mi);
283 /* Sabotage attempts to re-use the mutex before initialising it again. */
284 *m = (pthread_mutex_t)NULL;
285 }
286
287 return 0;
288}
289
290int pthread_mutexattr_init(pthread_mutexattr_t *a)
291{
292 *a = PTHREAD_MUTEX_NORMAL | (PTHREAD_PROCESS_PRIVATE << 3);
293 return 0;
294}
295
296int pthread_mutexattr_destroy(pthread_mutexattr_t *a)
297{
298 if (!a)
299 return EINVAL;
300
301 return 0;
302}
303
304int pthread_mutexattr_gettype(const pthread_mutexattr_t *a, int *type)
305{
306 if (!a || !type)
307 return EINVAL;
308
309 *type = *a & 3;
310
311 return 0;
312}
313
314int pthread_mutexattr_settype(pthread_mutexattr_t *a, int type)
315{
316 if (!a || (type != PTHREAD_MUTEX_NORMAL && type != PTHREAD_MUTEX_RECURSIVE && type != PTHREAD_MUTEX_ERRORCHECK))
317 return EINVAL;
318 *a &= ~3;
319 *a |= type;
320
321 return 0;
322}
323
324int pthread_mutexattr_getpshared(const pthread_mutexattr_t *a, int *type)
325{
326 if (!a || !type)
327 return EINVAL;
328 *type = (*a & 4 ? PTHREAD_PROCESS_SHARED : PTHREAD_PROCESS_PRIVATE);
329
330 return 0;
331}
332
333int pthread_mutexattr_setpshared(pthread_mutexattr_t * a, int type)
334{
335 int r = 0;
336 if (!a || (type != PTHREAD_PROCESS_SHARED
337 && type != PTHREAD_PROCESS_PRIVATE))
338 return EINVAL;
339 if (type == PTHREAD_PROCESS_SHARED)
340 {
341 type = PTHREAD_PROCESS_PRIVATE;
342 r = ENOSYS;
343 }
344 type = (type == PTHREAD_PROCESS_SHARED ? 4 : 0);
345
346 *a &= ~4;
347 *a |= type;
348
349 return r;
350}
351
352int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *a, int *type)
353{
354 *type = *a & (8 + 16);
355
356 return 0;
357}
358
359int pthread_mutexattr_setprotocol(pthread_mutexattr_t *a, int type)
360{
361 if ((type & (8 + 16)) != 8 + 16) return EINVAL;
362
363 *a &= ~(8 + 16);
364 *a |= type;
365
366 return 0;
367}
368
369int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *a, int * prio)
370{
371 *prio = *a / PTHREAD_PRIO_MULT;
372 return 0;
373}
374
375int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *a, int prio)
376{
377 *a &= (PTHREAD_PRIO_MULT - 1);
378 *a += prio * PTHREAD_PRIO_MULT;
379
380 return 0;
381}
lib/libc/mingw/winpthreads/nanosleep.c created+71
......@@ -0,0 +1,71 @@
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7#include <errno.h>
8#include <time.h>
9#include <windows.h>
10#include "pthread.h"
11#include "pthread_time.h"
12#include "winpthread_internal.h"
13
14#define POW10_3 1000
15#define POW10_4 10000
16#define POW10_6 1000000
17#define POW10_9 1000000000
18#define MAX_SLEEP_IN_MS 4294967294UL
19
20/**
21 * Sleep for the specified time.
22 * @param request The desired amount of time to sleep.
23 * @param remain The remain amount of time to sleep.
24 * @return If the function succeeds, the return value is 0.
25 * If the function fails, the return value is -1,
26 * with errno set to indicate the error.
27 */
28int nanosleep(const struct timespec *request, struct timespec *remain)
29{
30 unsigned long ms, rc = 0;
31 unsigned __int64 u64, want, real;
32
33 union {
34 unsigned __int64 ns100;
35 FILETIME ft;
36 } _start, _end;
37
38 if (request->tv_sec < 0 || request->tv_nsec < 0 || request->tv_nsec >= POW10_9) {
39 errno = EINVAL;
40 return -1;
41 }
42
43 if (remain != NULL) GetSystemTimeAsFileTime(&_start.ft);
44
45 want = u64 = request->tv_sec * POW10_3 + request->tv_nsec / POW10_6;
46 while (u64 > 0 && rc == 0) {
47 if (u64 >= MAX_SLEEP_IN_MS) ms = MAX_SLEEP_IN_MS;
48 else ms = (unsigned long) u64;
49
50 u64 -= ms;
51 rc = pthread_delay_np_ms(ms);
52 }
53
54 if (rc != 0) { /* WAIT_IO_COMPLETION (192) */
55 if (remain != NULL) {
56 GetSystemTimeAsFileTime(&_end.ft);
57 real = (_end.ns100 - _start.ns100) / POW10_4;
58
59 if (real >= want) u64 = 0;
60 else u64 = want - real;
61
62 remain->tv_sec = u64 / POW10_3;
63 remain->tv_nsec = (long) (u64 % POW10_3) * POW10_6;
64 }
65
66 errno = EINTR;
67 return -1;
68 }
69
70 return 0;
71}
lib/libc/mingw/winpthreads/ref.c created+34
......@@ -0,0 +1,34 @@
1/*
2 Copyright (c) 2011-2016 mingw-w64 project
3
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the "Software"),
6 to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 DEALINGS IN THE SOFTWARE.
21*/
22
23#include <windows.h>
24#include <winternl.h>
25#include <stdio.h>
26#include "pthread.h"
27#include "semaphore.h"
28#include "rwlock.h"
29#include "cond.h"
30#include "barrier.h"
31#include "sem.h"
32#include "ref.h"
33#include "misc.h"
34
lib/libc/mingw/winpthreads/ref.h created+29
......@@ -0,0 +1,29 @@
1/*
2 Copyright (c) 2011-2016 mingw-w64 project
3
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the "Software"),
6 to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 DEALINGS IN THE SOFTWARE.
21*/
22
23#ifndef WIN_PTHREADS_REF_H
24#define WIN_PTHREADS_REF_H
25#include "pthread.h"
26#include "semaphore.h"
27
28#endif
29
lib/libc/mingw/winpthreads/rwlock.c created+537
......@@ -0,0 +1,537 @@
1/*
2 Copyright (c) 2011-2016 mingw-w64 project
3
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the "Software"),
6 to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 DEALINGS IN THE SOFTWARE.
21*/
22
23#include <windows.h>
24#include <stdio.h>
25#include <malloc.h>
26#include "pthread.h"
27#include "thread.h"
28#include "ref.h"
29#include "rwlock.h"
30#include "misc.h"
31
32static pthread_spinlock_t rwl_global = PTHREAD_SPINLOCK_INITIALIZER;
33
34static WINPTHREADS_ATTRIBUTE((noinline)) int rwlock_static_init(pthread_rwlock_t *rw);
35
36static WINPTHREADS_ATTRIBUTE((noinline)) int rwl_unref(volatile pthread_rwlock_t *rwl, int res)
37{
38 pthread_spin_lock(&rwl_global);
39#ifdef WINPTHREAD_DBG
40 assert((((rwlock_t *)*rwl)->valid == LIFE_RWLOCK) && (((rwlock_t *)*rwl)->busy > 0));
41#endif
42 ((rwlock_t *)*rwl)->busy--;
43 pthread_spin_unlock(&rwl_global);
44 return res;
45}
46
47static WINPTHREADS_ATTRIBUTE((noinline)) int rwl_ref(pthread_rwlock_t *rwl, int f )
48{
49 int r = 0;
50 if (STATIC_RWL_INITIALIZER(*rwl)) {
51 r = rwlock_static_init(rwl);
52 if (r != 0 && r != EBUSY)
53 return r;
54 }
55 pthread_spin_lock(&rwl_global);
56
57 if (!rwl || !*rwl || ((rwlock_t *)*rwl)->valid != LIFE_RWLOCK) r = EINVAL;
58 else {
59 ((rwlock_t *)*rwl)->busy ++;
60 }
61
62 pthread_spin_unlock(&rwl_global);
63
64 return r;
65}
66
67static WINPTHREADS_ATTRIBUTE((noinline)) int rwl_ref_unlock(pthread_rwlock_t *rwl )
68{
69 int r = 0;
70
71 pthread_spin_lock(&rwl_global);
72
73 if (!rwl || !*rwl || ((rwlock_t *)*rwl)->valid != LIFE_RWLOCK) r = EINVAL;
74 else if (STATIC_RWL_INITIALIZER(*rwl)) r= EPERM;
75 else {
76 ((rwlock_t *)*rwl)->busy ++;
77 }
78
79 pthread_spin_unlock(&rwl_global);
80
81 return r;
82}
83
84static WINPTHREADS_ATTRIBUTE((noinline)) int rwl_ref_destroy(pthread_rwlock_t *rwl, pthread_rwlock_t *rDestroy )
85{
86 int r = 0;
87
88 *rDestroy = (pthread_rwlock_t)NULL;
89 pthread_spin_lock(&rwl_global);
90
91 if (!rwl || !*rwl) r = EINVAL;
92 else {
93 rwlock_t *r_ = (rwlock_t *)*rwl;
94 if (STATIC_RWL_INITIALIZER(*rwl)) *rwl = (pthread_rwlock_t)NULL;
95 else if (r_->valid != LIFE_RWLOCK) r = EINVAL;
96 else if (r_->busy) r = EBUSY;
97 else {
98 *rDestroy = *rwl;
99 *rwl = (pthread_rwlock_t)NULL;
100 }
101 }
102
103 pthread_spin_unlock(&rwl_global);
104 return r;
105}
106
107static int rwlock_gain_both_locks(rwlock_t *rwlock)
108{
109 int ret;
110 ret = pthread_mutex_lock(&rwlock->mex);
111 if (ret != 0)
112 return ret;
113 ret = pthread_mutex_lock(&rwlock->mcomplete);
114 if (ret != 0)
115 pthread_mutex_unlock(&rwlock->mex);
116 return ret;
117}
118
119static int rwlock_free_both_locks(rwlock_t *rwlock, int last_fail)
120{
121 int ret, ret2;
122 ret = pthread_mutex_unlock(&rwlock->mcomplete);
123 ret2 = pthread_mutex_unlock(&rwlock->mex);
124 if (last_fail && ret2 != 0)
125 ret = ret2;
126 else if (!last_fail && !ret)
127 ret = ret2;
128 return ret;
129}
130
131#ifdef WINPTHREAD_DBG
132static int print_state = 0;
133void rwl_print_set(int state)
134{
135 print_state = state;
136}
137
138void rwl_print(volatile pthread_rwlock_t *rwl, char *txt)
139{
140 if (!print_state) return;
141 rwlock_t *r = (rwlock_t *)*rwl;
142 if (r == NULL) {
143 printf("RWL%p %lu %s\n",(void *)*rwl,GetCurrentThreadId(),txt);
144 } else {
145 printf("RWL%p %lu V=%0X B=%d r=%ld w=%ld L=%p %s\n",
146 (void *)*rwl,
147 GetCurrentThreadId(),
148 (int)r->valid,
149 (int)r->busy,
150 0L,0L,NULL,txt);
151 }
152}
153#endif
154
155static pthread_spinlock_t cond_locked = PTHREAD_SPINLOCK_INITIALIZER;
156
157static WINPTHREADS_ATTRIBUTE((noinline)) int rwlock_static_init(pthread_rwlock_t *rw)
158{
159 int r;
160 pthread_spin_lock(&cond_locked);
161 if (*rw != PTHREAD_RWLOCK_INITIALIZER)
162 {
163 pthread_spin_unlock(&cond_locked);
164 return EINVAL;
165 }
166 r = pthread_rwlock_init (rw, NULL);
167 pthread_spin_unlock(&cond_locked);
168
169 return r;
170}
171
172int pthread_rwlock_init (pthread_rwlock_t *rwlock_, const pthread_rwlockattr_t *attr)
173{
174 rwlock_t *rwlock;
175 int r;
176
177 if(!rwlock_)
178 return EINVAL;
179 *rwlock_ = (pthread_rwlock_t)NULL;
180 if ((rwlock = calloc(1, sizeof(*rwlock))) == NULL)
181 return ENOMEM;
182 rwlock->valid = DEAD_RWLOCK;
183
184 rwlock->nex_count = rwlock->nsh_count = rwlock->ncomplete = 0;
185 if ((r = pthread_mutex_init (&rwlock->mex, NULL)) != 0)
186 {
187 free(rwlock);
188 return r;
189 }
190 if ((r = pthread_mutex_init (&rwlock->mcomplete, NULL)) != 0)
191 {
192 pthread_mutex_destroy(&rwlock->mex);
193 free(rwlock);
194 return r;
195 }
196 if ((r = pthread_cond_init (&rwlock->ccomplete, NULL)) != 0)
197 {
198 pthread_mutex_destroy(&rwlock->mex);
199 pthread_mutex_destroy (&rwlock->mcomplete);
200 free(rwlock);
201 return r;
202 }
203 rwlock->valid = LIFE_RWLOCK;
204 *rwlock_ = (pthread_rwlock_t)rwlock;
205 return r;
206}
207
208int pthread_rwlock_destroy (pthread_rwlock_t *rwlock_)
209{
210 rwlock_t *rwlock;
211 pthread_rwlock_t rDestroy;
212 int r, r2;
213
214 pthread_spin_lock(&cond_locked);
215 r = rwl_ref_destroy(rwlock_,&rDestroy);
216 pthread_spin_unlock(&cond_locked);
217
218 if(r) return r;
219 if(!rDestroy) return 0; /* destroyed a (still) static initialized rwl */
220
221 rwlock = (rwlock_t *)rDestroy;
222 r = rwlock_gain_both_locks (rwlock);
223 if (r != 0)
224 {
225 *rwlock_ = rDestroy;
226 return r;
227 }
228 if (rwlock->nsh_count > rwlock->ncomplete || rwlock->nex_count > 0)
229 {
230 *rwlock_ = rDestroy;
231 r = rwlock_free_both_locks(rwlock, 1);
232 if (!r)
233 r = EBUSY;
234 return r;
235 }
236 rwlock->valid = DEAD_RWLOCK;
237 r = rwlock_free_both_locks(rwlock, 0);
238 if (r != 0) { *rwlock_ = rDestroy; return r; }
239
240 r = pthread_cond_destroy(&rwlock->ccomplete);
241 r2 = pthread_mutex_destroy(&rwlock->mex);
242 if (!r) r = r2;
243 r2 = pthread_mutex_destroy(&rwlock->mcomplete);
244 if (!r) r = r2;
245 rwlock->valid = DEAD_RWLOCK;
246 free((void *)rDestroy);
247 return 0;
248}
249
250int pthread_rwlock_rdlock (pthread_rwlock_t *rwlock_)
251{
252 rwlock_t *rwlock;
253 int ret;
254
255 /* pthread_testcancel(); */
256
257 ret = rwl_ref(rwlock_,0);
258 if(ret != 0) return ret;
259
260 rwlock = (rwlock_t *)*rwlock_;
261
262 ret = pthread_mutex_lock(&rwlock->mex);
263 if (ret != 0) return rwl_unref(rwlock_, ret);
264 InterlockedIncrement((long*)&rwlock->nsh_count);
265 if (rwlock->nsh_count == INT_MAX)
266 {
267 ret = pthread_mutex_lock(&rwlock->mcomplete);
268 if (ret != 0)
269 {
270 pthread_mutex_unlock(&rwlock->mex);
271 return rwl_unref(rwlock_,ret);
272 }
273 rwlock->nsh_count -= rwlock->ncomplete;
274 rwlock->ncomplete = 0;
275 ret = rwlock_free_both_locks(rwlock, 0);
276 return rwl_unref(rwlock_, ret);
277 }
278 ret = pthread_mutex_unlock(&rwlock->mex);
279 return rwl_unref(rwlock_, ret);
280}
281
282int pthread_rwlock_timedrdlock (pthread_rwlock_t *rwlock_, const struct timespec *ts)
283{
284 rwlock_t *rwlock;
285 int ret;
286
287 /* pthread_testcancel(); */
288
289 ret = rwl_ref(rwlock_,0);
290 if(ret != 0) return ret;
291
292 rwlock = (rwlock_t *)*rwlock_;
293 if ((ret = pthread_mutex_timedlock (&rwlock->mex, ts)) != 0)
294 return rwl_unref(rwlock_, ret);
295 InterlockedIncrement(&rwlock->nsh_count);
296 if (rwlock->nsh_count == INT_MAX)
297 {
298 ret = pthread_mutex_timedlock(&rwlock->mcomplete, ts);
299 if (ret != 0)
300 {
301 if (ret == ETIMEDOUT)
302 InterlockedIncrement(&rwlock->ncomplete);
303 pthread_mutex_unlock(&rwlock->mex);
304 return rwl_unref(rwlock_, ret);
305 }
306 rwlock->nsh_count -= rwlock->ncomplete;
307 rwlock->ncomplete = 0;
308 ret = rwlock_free_both_locks(rwlock, 0);
309 return rwl_unref(rwlock_, ret);
310 }
311 ret = pthread_mutex_unlock(&rwlock->mex);
312 return rwl_unref(rwlock_, ret);
313}
314
315int pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock_)
316{
317 rwlock_t *rwlock;
318 int ret;
319
320 ret = rwl_ref(rwlock_,RWL_TRY);
321 if(ret != 0) return ret;
322
323 rwlock = (rwlock_t *)*rwlock_;
324 ret = pthread_mutex_trylock(&rwlock->mex);
325 if (ret != 0)
326 return rwl_unref(rwlock_, ret);
327 InterlockedIncrement(&rwlock->nsh_count);
328 if (rwlock->nsh_count == INT_MAX)
329 {
330 ret = pthread_mutex_lock(&rwlock->mcomplete);
331 if (ret != 0)
332 {
333 pthread_mutex_unlock(&rwlock->mex);
334 return rwl_unref(rwlock_, ret);
335 }
336 rwlock->nsh_count -= rwlock->ncomplete;
337 rwlock->ncomplete = 0;
338 ret = rwlock_free_both_locks(rwlock, 0);
339 return rwl_unref(rwlock_, ret);
340 }
341 ret = pthread_mutex_unlock(&rwlock->mex);
342 return rwl_unref(rwlock_,ret);
343}
344
345int pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock_)
346{
347 rwlock_t *rwlock;
348 int ret;
349
350 ret = rwl_ref(rwlock_,RWL_TRY);
351 if(ret != 0) return ret;
352
353 rwlock = (rwlock_t *)*rwlock_;
354 ret = pthread_mutex_trylock (&rwlock->mex);
355 if (ret != 0)
356 return rwl_unref(rwlock_, ret);
357 ret = pthread_mutex_trylock(&rwlock->mcomplete);
358 if (ret != 0)
359 {
360 int r1 = pthread_mutex_unlock(&rwlock->mex);
361 if (r1 != 0)
362 ret = r1;
363 return rwl_unref(rwlock_, ret);
364 }
365 if (rwlock->nex_count != 0)
366 return rwl_unref(rwlock_, EBUSY);
367 if (rwlock->ncomplete > 0)
368 {
369 rwlock->nsh_count -= rwlock->ncomplete;
370 rwlock->ncomplete = 0;
371 }
372 if (rwlock->nsh_count > 0)
373 {
374 ret = rwlock_free_both_locks(rwlock, 0);
375 if (!ret)
376 ret = EBUSY;
377 return rwl_unref(rwlock_, ret);
378 }
379 rwlock->nex_count = 1;
380 return rwl_unref(rwlock_, 0);
381}
382
383int pthread_rwlock_unlock (pthread_rwlock_t *rwlock_)
384{
385 rwlock_t *rwlock;
386 int ret;
387
388 ret = rwl_ref_unlock(rwlock_);
389 if(ret != 0) return ret;
390
391 rwlock = (rwlock_t *)*rwlock_;
392 if (rwlock->nex_count == 0)
393 {
394 ret = pthread_mutex_lock(&rwlock->mcomplete);
395 if (!ret)
396 {
397 int r1;
398 InterlockedIncrement(&rwlock->ncomplete);
399 if (rwlock->ncomplete == 0)
400 ret = pthread_cond_signal(&rwlock->ccomplete);
401 r1 = pthread_mutex_unlock(&rwlock->mcomplete);
402 if (!ret)
403 ret = r1;
404 }
405 }
406 else
407 {
408 InterlockedDecrement(&rwlock->nex_count);
409 ret = rwlock_free_both_locks(rwlock, 0);
410 }
411 return rwl_unref(rwlock_, ret);
412}
413
414static void st_cancelwrite (void *arg)
415{
416 rwlock_t *rwlock = (rwlock_t *)arg;
417
418 rwlock->nsh_count = - rwlock->ncomplete;
419 rwlock->ncomplete = 0;
420 rwlock_free_both_locks(rwlock, 0);
421}
422
423int pthread_rwlock_wrlock (pthread_rwlock_t *rwlock_)
424{
425 rwlock_t *rwlock;
426 int ret;
427
428 /* pthread_testcancel(); */
429 ret = rwl_ref(rwlock_,0);
430 if(ret != 0) return ret;
431
432 rwlock = (rwlock_t *)*rwlock_;
433 ret = rwlock_gain_both_locks(rwlock);
434 if (ret != 0)
435 return rwl_unref(rwlock_,ret);
436
437 if (rwlock->nex_count == 0)
438 {
439 if (rwlock->ncomplete > 0)
440 {
441 rwlock->nsh_count -= rwlock->ncomplete;
442 rwlock->ncomplete = 0;
443 }
444 if (rwlock->nsh_count > 0)
445 {
446 rwlock->ncomplete = -rwlock->nsh_count;
447 pthread_cleanup_push(st_cancelwrite, (void *) rwlock);
448 do {
449 ret = pthread_cond_wait(&rwlock->ccomplete, &rwlock->mcomplete);
450 } while (!ret && rwlock->ncomplete < 0);
451
452 pthread_cleanup_pop(!ret ? 0 : 1);
453 if (!ret)
454 rwlock->nsh_count = 0;
455 }
456 }
457 if(!ret)
458 InterlockedIncrement((long*)&rwlock->nex_count);
459 return rwl_unref(rwlock_,ret);
460}
461
462int pthread_rwlock_timedwrlock (pthread_rwlock_t *rwlock_, const struct timespec *ts)
463{
464 int ret;
465 rwlock_t *rwlock;
466
467 /* pthread_testcancel(); */
468 if (!rwlock_ || !ts)
469 return EINVAL;
470 if ((ret = rwl_ref(rwlock_,0)) != 0)
471 return ret;
472 rwlock = (rwlock_t *)*rwlock_;
473
474 ret = pthread_mutex_timedlock(&rwlock->mex, ts);
475 if (ret != 0)
476 return rwl_unref(rwlock_,ret);
477 ret = pthread_mutex_timedlock (&rwlock->mcomplete, ts);
478 if (ret != 0)
479 {
480 pthread_mutex_unlock(&rwlock->mex);
481 return rwl_unref(rwlock_,ret);
482 }
483 if (rwlock->nex_count == 0)
484 {
485 if (rwlock->ncomplete > 0)
486 {
487 rwlock->nsh_count -= rwlock->ncomplete;
488 rwlock->ncomplete = 0;
489 }
490 if (rwlock->nsh_count > 0)
491 {
492 rwlock->ncomplete = -rwlock->nsh_count;
493 pthread_cleanup_push(st_cancelwrite, (void *) rwlock);
494 do {
495 ret = pthread_cond_timedwait(&rwlock->ccomplete, &rwlock->mcomplete, ts);
496 } while (rwlock->ncomplete < 0 && !ret);
497 pthread_cleanup_pop(!ret ? 0 : 1);
498
499 if (!ret)
500 rwlock->nsh_count = 0;
501 }
502 }
503 if(!ret)
504 InterlockedIncrement((long*)&rwlock->nex_count);
505 return rwl_unref(rwlock_,ret);
506}
507
508int pthread_rwlockattr_destroy(pthread_rwlockattr_t *a)
509{
510 if (!a)
511 return EINVAL;
512 return 0;
513}
514
515int pthread_rwlockattr_init(pthread_rwlockattr_t *a)
516{
517 if (!a)
518 return EINVAL;
519 *a = PTHREAD_PROCESS_PRIVATE;
520 return 0;
521}
522
523int pthread_rwlockattr_getpshared(pthread_rwlockattr_t *a, int *s)
524{
525 if (!a || !s)
526 return EINVAL;
527 *s = *a;
528 return 0;
529}
530
531int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *a, int s)
532{
533 if (!a || (s != PTHREAD_PROCESS_SHARED && s != PTHREAD_PROCESS_PRIVATE))
534 return EINVAL;
535 *a = s;
536 return 0;
537}
lib/libc/mingw/winpthreads/rwlock.h created+49
......@@ -0,0 +1,49 @@
1/*
2 Copyright (c) 2011-2016 mingw-w64 project
3
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the "Software"),
6 to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 DEALINGS IN THE SOFTWARE.
21*/
22
23#ifndef WIN_PTHREADS_RWLOCK_H
24#define WIN_PTHREADS_RWLOCK_H
25
26#define LIFE_RWLOCK 0xBAB1F0ED
27#define DEAD_RWLOCK 0xDEADB0EF
28
29#define STATIC_RWL_INITIALIZER(x) ((pthread_rwlock_t)(x) == ((pthread_rwlock_t)PTHREAD_RWLOCK_INITIALIZER))
30
31typedef struct rwlock_t rwlock_t;
32struct rwlock_t {
33 unsigned int valid;
34 int busy;
35 LONG nex_count; /* Exclusive access counter. */
36 LONG nsh_count; /* Shared access counter. */
37 LONG ncomplete; /* Shared completed counter. */
38 pthread_mutex_t mex; /* Exclusive access protection. */
39 pthread_mutex_t mcomplete; /* Shared completed protection. */
40 pthread_cond_t ccomplete; /* Shared access completed queue. */
41};
42
43#define RWL_SET 0x01
44#define RWL_TRY 0x02
45
46void rwl_print(volatile pthread_rwlock_t *rwl, char *txt);
47void rwl_print_set(int state);
48
49#endif
lib/libc/mingw/winpthreads/sched.c created+218
......@@ -0,0 +1,218 @@
1/*
2 Copyright (c) 2011-2016 mingw-w64 project
3
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the "Software"),
6 to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 DEALINGS IN THE SOFTWARE.
21*/
22
23#include <windows.h>
24#include <stdio.h>
25#include "pthread.h"
26#include "thread.h"
27
28#include "misc.h"
29
30int sched_get_priority_min(int pol)
31{
32 if (pol < SCHED_MIN || pol > SCHED_MAX) {
33 errno = EINVAL;
34 return -1;
35 }
36
37 return THREAD_PRIORITY_IDLE;
38}
39
40int sched_get_priority_max(int pol)
41{
42 if (pol < SCHED_MIN || pol > SCHED_MAX) {
43 errno = EINVAL;
44 return -1;
45 }
46
47 return THREAD_PRIORITY_TIME_CRITICAL;
48}
49
50int pthread_attr_setschedparam(pthread_attr_t *attr, const struct sched_param *p)
51{
52 int r = 0;
53
54 if (attr == NULL || p == NULL) {
55 return EINVAL;
56 }
57 memcpy(&attr->param, p, sizeof (*p));
58 return r;
59}
60
61int pthread_attr_getschedparam(const pthread_attr_t *attr, struct sched_param *p)
62{
63 int r = 0;
64
65 if (attr == NULL || p == NULL) {
66 return EINVAL;
67 }
68 memcpy(p, &attr->param, sizeof (*p));
69 return r;
70}
71
72int pthread_attr_setschedpolicy (pthread_attr_t *attr, int pol)
73{
74 if (!attr || pol < SCHED_MIN || pol > SCHED_MAX)
75 return EINVAL;
76 if (pol != SCHED_OTHER)
77 return ENOTSUP;
78 return 0;
79}
80
81int pthread_attr_getschedpolicy (const pthread_attr_t *attr, int *pol)
82{
83 if (!attr || !pol)
84 return EINVAL;
85 *pol = SCHED_OTHER;
86 return 0;
87}
88
89static int pthread_check(pthread_t t)
90{
91 struct _pthread_v *pv;
92
93 if (!t)
94 return ESRCH;
95 pv = __pth_gpointer_locked (t);
96 if (pv->ended == 0)
97 return 0;
98 CHECK_OBJECT(pv, ESRCH);
99 return 0;
100}
101
102int pthread_getschedparam(pthread_t t, int *pol, struct sched_param *p)
103{
104 int r;
105 //if (!t)
106 // t = pthread_self();
107
108 if ((r = pthread_check(t)) != 0)
109 {
110 return r;
111 }
112
113 if (!p || !pol)
114 {
115 return EINVAL;
116 }
117 *pol = __pth_gpointer_locked (t)->sched_pol;
118 p->sched_priority = __pth_gpointer_locked (t)->sched.sched_priority;
119
120 return 0;
121}
122
123int pthread_setschedparam(pthread_t t, int pol, const struct sched_param *p)
124{
125 struct _pthread_v *pv;
126 int r, pr = 0;
127 //if (!t.p) t = pthread_self();
128
129 if ((r = pthread_check(t)) != 0)
130 return r;
131
132 if (pol < SCHED_MIN || pol > SCHED_MAX || p == NULL)
133 return EINVAL;
134 if (pol != SCHED_OTHER)
135 return ENOTSUP;
136 pr = p->sched_priority;
137 if (pr < sched_get_priority_min(pol) || pr > sched_get_priority_max(pol))
138 return EINVAL;
139
140 /* See msdn: there are actually 7 priorities:
141 THREAD_PRIORITY_IDLE - -15
142 THREAD_PRIORITY_LOWEST -2
143 THREAD_PRIORITY_BELOW_NORMAL -1
144 THREAD_PRIORITY_NORMAL 0
145 THREAD_PRIORITY_ABOVE_NORMAL 1
146 THREAD_PRIORITY_HIGHEST 2
147 THREAD_PRIORITY_TIME_CRITICAL 15
148 */
149 if (pr <= THREAD_PRIORITY_IDLE) {
150 pr = THREAD_PRIORITY_IDLE;
151 } else if (pr <= THREAD_PRIORITY_LOWEST) {
152 pr = THREAD_PRIORITY_LOWEST;
153 } else if (pr >= THREAD_PRIORITY_TIME_CRITICAL) {
154 pr = THREAD_PRIORITY_TIME_CRITICAL;
155 } else if (pr >= THREAD_PRIORITY_HIGHEST) {
156 pr = THREAD_PRIORITY_HIGHEST;
157 }
158 pv = __pth_gpointer_locked (t);
159 if (SetThreadPriority(pv->h, pr)) {
160 pv->sched_pol = pol;
161 pv->sched.sched_priority = p->sched_priority;
162 } else
163 r = EINVAL;
164 return r;
165}
166
167int sched_getscheduler(pid_t pid)
168{
169 if (pid != 0)
170 {
171 HANDLE h = NULL;
172 int selfPid = (int) GetCurrentProcessId ();
173
174 if (pid != (pid_t) selfPid && (h = OpenProcess (PROCESS_QUERY_INFORMATION, 0, (DWORD) pid)) == NULL)
175 {
176 errno = (GetLastError () == (0xFF & ERROR_ACCESS_DENIED)) ? EPERM : ESRCH;
177 return -1;
178 }
179 if (h)
180 CloseHandle (h);
181 }
182 return SCHED_OTHER;
183}
184
185int sched_setscheduler(pid_t pid, int pol, const struct sched_param *param)
186{
187 if (!param)
188 {
189 errno = EINVAL;
190 return -1;
191 }
192 if (pid != 0)
193 {
194 HANDLE h = NULL;
195 int selfPid = (int) GetCurrentProcessId ();
196
197 if (pid != (pid_t) selfPid && (h = OpenProcess (PROCESS_SET_INFORMATION, 0, (DWORD) pid)) == NULL)
198 {
199 errno = (GetLastError () == (0xFF & ERROR_ACCESS_DENIED)) ? EPERM : ESRCH;
200 return -1;
201 }
202 if (h)
203 CloseHandle (h);
204 }
205
206 if (pol != SCHED_OTHER)
207 {
208 errno = ENOSYS;
209 return -1;
210 }
211 return SCHED_OTHER;
212}
213
214int sched_yield(void)
215{
216 Sleep(0);
217 return 0;
218}
lib/libc/mingw/winpthreads/sem.c created+354
......@@ -0,0 +1,354 @@
1/*
2 Copyright (c) 2011-2016 mingw-w64 project
3
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the "Software"),
6 to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 DEALINGS IN THE SOFTWARE.
21*/
22
23#include <windows.h>
24#include <stdio.h>
25#include <malloc.h>
26#include "pthread.h"
27#include "thread.h"
28#include "misc.h"
29#include "semaphore.h"
30#include "sem.h"
31#include "ref.h"
32
33int do_sema_b_wait_intern (HANDLE sema, int nointerrupt, DWORD timeout);
34
35static int
36sem_result (int res)
37{
38 if (res != 0) {
39 errno = res;
40 return -1;
41 }
42 return 0;
43}
44
45int
46sem_init (sem_t *sem, int pshared, unsigned int value)
47{
48 _sem_t *sv;
49
50 if (!sem || value > (unsigned int)SEM_VALUE_MAX)
51 return sem_result (EINVAL);
52 if (pshared != PTHREAD_PROCESS_PRIVATE)
53 return sem_result (EPERM);
54
55 if ((sv = (sem_t) calloc (1,sizeof (*sv))) == NULL)
56 return sem_result (ENOMEM);
57
58 sv->value = value;
59 if (pthread_mutex_init (&sv->vlock, NULL) != 0)
60 {
61 free (sv);
62 return sem_result (ENOSPC);
63 }
64 if ((sv->s = CreateSemaphore (NULL, 0, SEM_VALUE_MAX, NULL)) == NULL)
65 {
66 pthread_mutex_destroy (&sv->vlock);
67 free (sv);
68 return sem_result (ENOSPC);
69 }
70
71 sv->valid = LIFE_SEM;
72 *sem = sv;
73 return 0;
74}
75
76int
77sem_destroy (sem_t *sem)
78{
79 int r;
80 _sem_t *sv = NULL;
81
82 if (!sem || (sv = *sem) == NULL)
83 return sem_result (EINVAL);
84 if ((r = pthread_mutex_lock (&sv->vlock)) != 0)
85 return sem_result (r);
86
87#if 0
88 /* We don't wait for destroying a semaphore ...
89 or? */
90 if (sv->value < 0)
91 {
92 pthread_mutex_unlock (&sv->vlock);
93 return sem_result (EBUSY);
94 }
95#endif
96
97 if (!CloseHandle (sv->s))
98 {
99 pthread_mutex_unlock (&sv->vlock);
100 return sem_result (EINVAL);
101 }
102 *sem = NULL;
103 sv->value = SEM_VALUE_MAX;
104 pthread_mutex_unlock(&sv->vlock);
105 Sleep (0);
106 while (pthread_mutex_destroy (&sv->vlock) == EBUSY)
107 Sleep (0);
108 sv->valid = DEAD_SEM;
109 free (sv);
110 return 0;
111}
112
113static int
114sem_std_enter (sem_t *sem,_sem_t **svp, int do_test)
115{
116 int r;
117 _sem_t *sv;
118
119 if (do_test)
120 pthread_testcancel ();
121 if (!sem)
122 return sem_result (EINVAL);
123 sv = *sem;
124 if (sv == NULL)
125 return sem_result (EINVAL);
126
127 if ((r = pthread_mutex_lock (&sv->vlock)) != 0)
128 return sem_result (r);
129
130 if (*sem == NULL)
131 {
132 pthread_mutex_unlock(&sv->vlock);
133 return sem_result (EINVAL);
134 }
135 *svp = sv;
136 return 0;
137}
138
139int
140sem_trywait (sem_t *sem)
141{
142 _sem_t *sv;
143
144 if (sem_std_enter (sem, &sv, 0) != 0)
145 return -1;
146 if (sv->value <= 0)
147 {
148 pthread_mutex_unlock (&sv->vlock);
149 return sem_result (EAGAIN);
150 }
151 sv->value--;
152 pthread_mutex_unlock (&sv->vlock);
153
154 return 0;
155}
156
157struct sSemTimedWait
158{
159 sem_t *p;
160 int *ret;
161};
162
163static void
164clean_wait_sem (void *s)
165{
166 struct sSemTimedWait *p = (struct sSemTimedWait *) s;
167 _sem_t *sv = NULL;
168
169 if (sem_std_enter (p->p, &sv, 0) != 0)
170 return;
171
172 if (WaitForSingleObject (sv->s, 0) != WAIT_OBJECT_0)
173 InterlockedIncrement (&sv->value);
174 else if (p->ret)
175 p->ret[0] = 0;
176 pthread_mutex_unlock (&sv->vlock);
177}
178
179int
180sem_wait (sem_t *sem)
181{
182 long cur_v;
183 int ret = 0;
184 _sem_t *sv;
185 HANDLE semh;
186 struct sSemTimedWait arg;
187
188 if (sem_std_enter (sem, &sv, 1) != 0)
189 return -1;
190
191 arg.ret = &ret;
192 arg.p = sem;
193 InterlockedDecrement (&sv->value);
194 cur_v = sv->value;
195 semh = sv->s;
196 pthread_mutex_unlock (&sv->vlock);
197
198 if (cur_v >= 0)
199 return 0;
200 else
201 {
202 pthread_cleanup_push (clean_wait_sem, (void *) &arg);
203 ret = do_sema_b_wait_intern (semh, 2, INFINITE);
204 pthread_cleanup_pop (ret);
205 if (ret == EINVAL)
206 return 0;
207 }
208
209 if (!ret)
210 return 0;
211
212 return sem_result (ret);
213}
214
215int
216sem_timedwait (sem_t *sem, const struct timespec *t)
217{
218 int cur_v, ret = 0;
219 DWORD dwr;
220 HANDLE semh;
221 _sem_t *sv;
222 struct sSemTimedWait arg;
223
224 if (!t)
225 return sem_wait (sem);
226 dwr = dwMilliSecs(_pthread_rel_time_in_ms (t));
227
228 if (sem_std_enter (sem, &sv, 1) != 0)
229 return -1;
230
231 arg.ret = &ret;
232 arg.p = sem;
233 InterlockedDecrement (&sv->value);
234 cur_v = sv->value;
235 semh = sv->s;
236 pthread_mutex_unlock(&sv->vlock);
237
238 if (cur_v >= 0)
239 return 0;
240 else
241 {
242 pthread_cleanup_push (clean_wait_sem, (void *) &arg);
243 ret = do_sema_b_wait_intern (semh, 2, dwr);
244 pthread_cleanup_pop (ret);
245 if (ret == EINVAL)
246 return 0;
247 }
248
249 if (!ret)
250 return 0;
251 return sem_result (ret);
252}
253
254int
255sem_post (sem_t *sem)
256{
257 _sem_t *sv;
258
259 if (sem_std_enter (sem, &sv, 0) != 0)
260 return -1;
261
262 if (sv->value >= SEM_VALUE_MAX)
263 {
264 pthread_mutex_unlock (&sv->vlock);
265 return sem_result (ERANGE);
266 }
267 InterlockedIncrement (&sv->value);
268 if (sv->value > 0 || ReleaseSemaphore (sv->s, 1, NULL))
269 {
270 pthread_mutex_unlock (&sv->vlock);
271 return 0;
272 }
273 InterlockedDecrement (&sv->value);
274 pthread_mutex_unlock (&sv->vlock);
275
276 return sem_result (EINVAL);
277}
278
279int
280sem_post_multiple (sem_t *sem, int count)
281{
282 int waiters_count;
283 _sem_t *sv;
284
285 if (count <= 0)
286 return sem_result (EINVAL);
287 if (sem_std_enter (sem, &sv, 0) != 0)
288 return -1;
289
290 if (sv->value > (SEM_VALUE_MAX - count))
291 {
292 pthread_mutex_unlock (&sv->vlock);
293 return sem_result (ERANGE);
294 }
295 waiters_count = -sv->value;
296 sv->value += count;
297 /*InterlockedExchangeAdd((long*)&sv->value, (long) count);*/
298 if (waiters_count <= 0
299 || ReleaseSemaphore (sv->s,
300 (waiters_count < count ? waiters_count
301 : count), NULL))
302 {
303 pthread_mutex_unlock(&sv->vlock);
304 return 0;
305 }
306 /*InterlockedExchangeAdd((long*)&sv->value, -((long) count));*/
307 sv->value -= count;
308 pthread_mutex_unlock(&sv->vlock);
309 return sem_result (EINVAL);
310}
311
312sem_t *
313sem_open (const char *name, int oflag, mode_t mode, unsigned int value)
314{
315 sem_result (ENOSYS);
316 return NULL;
317}
318
319int
320sem_close (sem_t *sem)
321{
322 return sem_result (ENOSYS);
323}
324
325int
326sem_unlink (const char *name)
327{
328 return sem_result (ENOSYS);
329}
330
331int
332sem_getvalue (sem_t *sem, int *sval)
333{
334 _sem_t *sv;
335 int r;
336
337 if (!sval)
338 return sem_result (EINVAL);
339
340 if (!sem || (sv = *sem) == NULL)
341 return sem_result (EINVAL);
342
343 if ((r = pthread_mutex_lock (&sv->vlock)) != 0)
344 return sem_result (r);
345 if (*sem == NULL)
346 {
347 pthread_mutex_unlock (&sv->vlock);
348 return sem_result (EINVAL);
349 }
350
351 *sval = (int) sv->value;
352 pthread_mutex_unlock (&sv->vlock);
353 return 0;
354}
lib/libc/mingw/winpthreads/sem.h created+40
......@@ -0,0 +1,40 @@
1/*
2 Copyright (c) 2011-2016 mingw-w64 project
3
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the "Software"),
6 to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 DEALINGS IN THE SOFTWARE.
21*/
22
23#ifndef WIN_SEM
24#define WIN_SEM
25
26#include <windows.h>
27
28#define LIFE_SEM 0xBAB1F00D
29#define DEAD_SEM 0xDEADBEEF
30
31typedef struct _sem_t _sem_t;
32struct _sem_t
33{
34 unsigned int valid;
35 HANDLE s;
36 volatile long value;
37 pthread_mutex_t vlock;
38};
39
40#endif /* WIN_SEM */
lib/libc/mingw/winpthreads/spinlock.c created+74
......@@ -0,0 +1,74 @@
1/*
2 Copyright (c) 2013 mingw-w64 project
3 Copyright (c) 2015 Intel Corporation
4
5 Permission is hereby granted, free of charge, to any person obtaining a
6 copy of this software and associated documentation files (the "Software"),
7 to deal in the Software without restriction, including without limitation
8 the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 and/or sell copies of the Software, and to permit persons to whom the
10 Software is furnished to do so, subject to the following conditions:
11
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
14
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 DEALINGS IN THE SOFTWARE.
22*/
23
24#include <windows.h>
25#include "pthread.h"
26#include "misc.h"
27
28/* We use the pthread_spinlock_t itself as a lock:
29 -1 is free, 0 is locked.
30 (This is dictated by PTHREAD_SPINLOCK_INITIALIZER, which we can't change
31 without breaking binary compatibility.) */
32typedef intptr_t spinlock_word_t;
33
34int
35pthread_spin_init (pthread_spinlock_t *lock, int pshared)
36{
37 spinlock_word_t *lk = (spinlock_word_t *)lock;
38 *lk = -1;
39 return 0;
40}
41
42
43int
44pthread_spin_destroy (pthread_spinlock_t *lock)
45{
46 return 0;
47}
48
49int
50pthread_spin_lock (pthread_spinlock_t *lock)
51{
52 volatile spinlock_word_t *lk = (volatile spinlock_word_t *)lock;
53 while (unlikely(InterlockedExchangePointer((PVOID volatile *)lk, 0) == 0))
54 do {
55 YieldProcessor();
56 } while (*lk == 0);
57 return 0;
58}
59
60int
61pthread_spin_trylock (pthread_spinlock_t *lock)
62{
63 spinlock_word_t *lk = (spinlock_word_t *)lock;
64 return InterlockedExchangePointer((PVOID volatile *)lk, 0) == 0 ? EBUSY : 0;
65}
66
67
68int
69pthread_spin_unlock (pthread_spinlock_t *lock)
70{
71 volatile spinlock_word_t *lk = (volatile spinlock_word_t *)lock;
72 *lk = -1;
73 return 0;
74}
lib/libc/mingw/winpthreads/thread.c created+1929
......@@ -0,0 +1,1929 @@
1/*
2 Copyright (c) 2011-2016 mingw-w64 project
3
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the "Software"),
6 to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 DEALINGS IN THE SOFTWARE.
21*/
22
23#include <windows.h>
24#include <strsafe.h>
25#include <stdio.h>
26#include <stdlib.h>
27#include <malloc.h>
28#include <signal.h>
29#include "pthread.h"
30#include "thread.h"
31#include "misc.h"
32#include "winpthread_internal.h"
33
34static _pthread_v *__pthread_self_lite (void);
35
36void (**_pthread_key_dest)(void *) = NULL;
37
38static volatile long _pthread_cancelling;
39static int _pthread_concur;
40
41/* FIXME Will default to zero as needed */
42static pthread_once_t _pthread_tls_once;
43static DWORD _pthread_tls = 0xffffffff;
44
45static pthread_rwlock_t _pthread_key_lock = PTHREAD_RWLOCK_INITIALIZER;
46static unsigned long _pthread_key_max=0L;
47static unsigned long _pthread_key_sch=0L;
48
49static _pthread_v *pthr_root = NULL, *pthr_last = NULL;
50static pthread_mutex_t mtx_pthr_locked = PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
51
52static __pthread_idlist *idList = NULL;
53static size_t idListCnt = 0;
54static size_t idListMax = 0;
55static pthread_t idListNextId = 0;
56
57#if !defined(_MSC_VER)
58#define USE_VEH_FOR_MSC_SETTHREADNAME
59#endif
60#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
61/* forbidden RemoveVectoredExceptionHandler/AddVectoredExceptionHandler APIs */
62#undef USE_VEH_FOR_MSC_SETTHREADNAME
63#endif
64
65#if defined(USE_VEH_FOR_MSC_SETTHREADNAME)
66static void *SetThreadName_VEH_handle = NULL;
67
68static LONG __stdcall
69SetThreadName_VEH (PEXCEPTION_POINTERS ExceptionInfo)
70{
71 if (ExceptionInfo->ExceptionRecord != NULL &&
72 ExceptionInfo->ExceptionRecord->ExceptionCode == EXCEPTION_SET_THREAD_NAME)
73 return EXCEPTION_CONTINUE_EXECUTION;
74
75 return EXCEPTION_CONTINUE_SEARCH;
76}
77
78static PVOID (WINAPI *AddVectoredExceptionHandlerFuncPtr) (ULONG, PVECTORED_EXCEPTION_HANDLER);
79static ULONG (WINAPI *RemoveVectoredExceptionHandlerFuncPtr) (PVOID);
80
81static void __attribute__((constructor))
82ctor (void)
83{
84 HMODULE module = GetModuleHandleA("kernel32.dll");
85 if (module) {
86 AddVectoredExceptionHandlerFuncPtr = (__typeof__(AddVectoredExceptionHandlerFuncPtr)) GetProcAddress(module, "AddVectoredExceptionHandler");
87 RemoveVectoredExceptionHandlerFuncPtr = (__typeof__(RemoveVectoredExceptionHandlerFuncPtr)) GetProcAddress(module, "RemoveVectoredExceptionHandler");
88 }
89}
90#endif
91
92typedef struct _THREADNAME_INFO
93{
94 DWORD dwType; /* must be 0x1000 */
95 LPCSTR szName; /* pointer to name (in user addr space) */
96 DWORD dwThreadID; /* thread ID (-1=caller thread) */
97 DWORD dwFlags; /* reserved for future use, must be zero */
98} THREADNAME_INFO;
99
100static void
101SetThreadName (DWORD dwThreadID, LPCSTR szThreadName)
102{
103 THREADNAME_INFO info;
104 DWORD infosize;
105
106 info.dwType = 0x1000;
107 info.szName = szThreadName;
108 info.dwThreadID = dwThreadID;
109 info.dwFlags = 0;
110
111 infosize = sizeof (info) / sizeof (ULONG_PTR);
112
113#if defined(_MSC_VER) && !defined (USE_VEH_FOR_MSC_SETTHREADNAME)
114 __try
115 {
116 RaiseException (EXCEPTION_SET_THREAD_NAME, 0, infosize, (ULONG_PTR *)&info);
117 }
118 __except (EXCEPTION_EXECUTE_HANDLER)
119 {
120 }
121#else
122 /* Without a debugger we *must* have an exception handler,
123 * otherwise raising an exception will crash the process.
124 */
125#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
126 if ((!IsDebuggerPresent ()) && (SetThreadName_VEH_handle == NULL))
127#else
128 if (!IsDebuggerPresent ())
129#endif
130 return;
131
132 RaiseException (EXCEPTION_SET_THREAD_NAME, 0, infosize, (ULONG_PTR *) &info);
133#endif
134}
135
136/* Search the list idList for an element with identifier ID. If
137 found, its associated _pthread_v pointer is returned, otherwise
138 NULL.
139 NOTE: This method is not locked. */
140static struct _pthread_v *
141__pthread_get_pointer (pthread_t id)
142{
143 size_t l, r, p;
144 if (!idListCnt)
145 return NULL;
146 if (idListCnt == 1)
147 return (idList[0].id == id ? idList[0].ptr : NULL);
148 l = 0; r = idListCnt - 1;
149 while (l <= r)
150 {
151 p = (l + r) >> 1;
152 if (idList[p].id == id)
153 return idList[p].ptr;
154 else if (idList[p].id > id)
155 {
156 if (p == l)
157 return NULL;
158 r = p - 1;
159 }
160 else
161 {
162 l = p + 1;
163 }
164 }
165
166 return NULL;
167}
168
169static void
170__pth_remove_use_for_key (pthread_key_t key)
171{
172 int i;
173
174 pthread_mutex_lock (&mtx_pthr_locked);
175 for (i = 0; i < idListCnt; i++)
176 {
177 if (idList[i].ptr != NULL
178 && idList[i].ptr->keyval != NULL
179 && key < idList[i].ptr->keymax)
180 {
181 idList[i].ptr->keyval[key] = NULL;
182 idList[i].ptr->keyval_set[key] = 0;
183 }
184 }
185 pthread_mutex_unlock (&mtx_pthr_locked);
186}
187
188/* Search the list idList for an element with identifier ID. If
189 found, its associated _pthread_v pointer is returned, otherwise
190 NULL.
191 NOTE: This method uses lock mtx_pthr_locked. */
192struct _pthread_v *
193__pth_gpointer_locked (pthread_t id)
194{
195 struct _pthread_v *ret;
196 if (!id)
197 return NULL;
198 pthread_mutex_lock (&mtx_pthr_locked);
199 ret = __pthread_get_pointer (id);
200 pthread_mutex_unlock (&mtx_pthr_locked);
201 return ret;
202}
203
204/* Registers in the list idList an element with _pthread_v pointer
205 and creates and unique identifier ID. If successful created the
206 ID of this element is returned, otherwise on failure zero ID gets
207 returned.
208 NOTE: This method is not locked. */
209static pthread_t
210__pthread_register_pointer (struct _pthread_v *ptr)
211{
212 __pthread_idlist *e;
213 size_t i;
214
215 if (!ptr)
216 return 0;
217 /* Check if a resize of list is necessary. */
218 if (idListCnt >= idListMax)
219 {
220 if (!idListCnt)
221 {
222 e = (__pthread_idlist *) malloc (sizeof (__pthread_idlist) * 16);
223 if (!e)
224 return 0;
225 idListMax = 16;
226 idList = e;
227 }
228 else
229 {
230 e = (__pthread_idlist *) realloc (idList, sizeof (__pthread_idlist) * (idListMax + 16));
231 if (!e)
232 return 0;
233 idListMax += 16;
234 idList = e;
235 }
236 }
237 do
238 {
239 ++idListNextId;
240 /* If two MSB are set we reset to id 1. We need to check here bits
241 to avoid gcc's no-overflow issue on increment. Additionally we
242 need to handle different size of pthread_t on 32-bit/64-bit. */
243 if ((idListNextId & ( ((pthread_t) 1) << ((sizeof (pthread_t) * 8) - 2))) != 0)
244 idListNextId = 1;
245 }
246 while (idListNextId == 0 || __pthread_get_pointer (idListNextId));
247 /* We assume insert at end of list. */
248 i = idListCnt;
249 if (i != 0)
250 {
251 /* Find position we can actual insert sorted. */
252 while (i > 0 && idList[i - 1].id > idListNextId)
253 --i;
254 if (i != idListCnt)
255 memmove (&idList[i + 1], &idList[i], sizeof (__pthread_idlist) * (idListCnt - i));
256 }
257 idList[i].id = idListNextId;
258 idList[i].ptr = ptr;
259 ++idListCnt;
260 return idListNextId;
261}
262
263/* Deregisters in the list idList an element with identifier ID and
264 returns its _pthread_v pointer on success. Otherwise NULL is returned.
265 NOTE: This method is not locked. */
266static struct _pthread_v *
267__pthread_deregister_pointer (pthread_t id)
268{
269 size_t l, r, p;
270 if (!idListCnt)
271 return NULL;
272 l = 0; r = idListCnt - 1;
273 while (l <= r)
274 {
275 p = (l + r) >> 1;
276 if (idList[p].id == id)
277 {
278 struct _pthread_v *ret = idList[p].ptr;
279 p++;
280 if (p < idListCnt)
281 memmove (&idList[p - 1], &idList[p], sizeof (__pthread_idlist) * (idListCnt - p));
282 --idListCnt;
283 /* Is this last element in list then free list. */
284 if (idListCnt == 0)
285 {
286 free (idList);
287 idListCnt = idListMax = 0;
288 }
289 return ret;
290 }
291 else if (idList[p].id > id)
292 {
293 if (p == l)
294 return NULL;
295 r = p - 1;
296 }
297 else
298 {
299 l = p + 1;
300 }
301 }
302 return NULL;
303}
304
305/* Save a _pthread_v element for reuse in pool. */
306static void
307push_pthread_mem (_pthread_v *sv)
308{
309 if (!sv || sv->next != NULL)
310 return;
311 pthread_mutex_lock (&mtx_pthr_locked);
312 if (sv->x != 0)
313 __pthread_deregister_pointer (sv->x);
314 if (sv->keyval)
315 free (sv->keyval);
316 if (sv->keyval_set)
317 free (sv->keyval_set);
318 if (sv->thread_name)
319 free (sv->thread_name);
320 memset (sv, 0, sizeof(struct _pthread_v));
321 if (pthr_last == NULL)
322 pthr_root = pthr_last = sv;
323 else
324 {
325 pthr_last->next = sv;
326 pthr_last = sv;
327 }
328 pthread_mutex_unlock (&mtx_pthr_locked);
329}
330
331/* Get a _pthread_v element from pool, or allocate it.
332 Note the unique identifier is created for the element here, too. */
333static _pthread_v *
334pop_pthread_mem (void)
335{
336 _pthread_v *r = NULL;
337
338 pthread_mutex_lock (&mtx_pthr_locked);
339 if ((r = pthr_root) == NULL)
340 {
341 if ((r = (_pthread_v *)calloc (1,sizeof(struct _pthread_v))) != NULL)
342 {
343 r->x = __pthread_register_pointer (r);
344 if (r->x == 0)
345 {
346 free (r);
347 r = NULL;
348 }
349 }
350 pthread_mutex_unlock (&mtx_pthr_locked);
351 return r;
352 }
353 r->x = __pthread_register_pointer (r);
354 if (r->x == 0)
355 r = NULL;
356 else
357 {
358 if((pthr_root = r->next) == NULL)
359 pthr_last = NULL;
360
361 r->next = NULL;
362 }
363 pthread_mutex_unlock (&mtx_pthr_locked);
364 return r;
365}
366
367/* Free memory consumed in _pthread_v pointer pool. */
368static void
369free_pthread_mem (void)
370{
371#if 0
372 _pthread_v *t;
373
374 pthread_mutex_lock (&mtx_pthr_locked);
375 t = pthr_root;
376 while (t != NULL)
377 {
378 _pthread_v *sv = t;
379 t = t->next;
380 if (sv->x != 0 && sv->ended == 0 && sv->valid != DEAD_THREAD)
381 {
382 pthread_mutex_unlock (&mtx_pthr_locked);
383 pthread_cancel (t->x);
384 Sleep (0);
385 pthread_mutex_lock (&mtx_pthr_locked);
386 t = pthr_root;
387 continue;
388 }
389 else if (sv->x != 0 && sv->valid != DEAD_THREAD)
390 {
391 pthread_mutex_unlock (&mtx_pthr_locked);
392 Sleep (0);
393 pthread_mutex_lock (&mtx_pthr_locked);
394 continue;
395 }
396 if (sv->x != 0)
397 __pthread_deregister_pointer (sv->x);
398 sv->x = 0;
399 free (sv);
400 pthr_root = t;
401 }
402 pthread_mutex_unlock (&mtx_pthr_locked);
403#endif
404 return;
405}
406
407static void
408replace_spin_keys (pthread_spinlock_t *old, pthread_spinlock_t new)
409{
410 if (old == NULL)
411 return;
412
413 if (EPERM == pthread_spin_destroy (old))
414 {
415#define THREADERR "Error cleaning up spin_keys for thread %lu.\n"
416 char threaderr[sizeof(THREADERR) + 8] = { 0 };
417 snprintf(threaderr, sizeof(threaderr), THREADERR, GetCurrentThreadId());
418#undef THREADERR
419 OutputDebugStringA (threaderr);
420 abort ();
421 }
422
423 *old = new;
424}
425
426/* Hook for TLS-based deregistration/registration of thread. */
427static void WINAPI
428__dyn_tls_pthread (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
429{
430 _pthread_v *t = NULL;
431 pthread_spinlock_t new_spin_keys = PTHREAD_SPINLOCK_INITIALIZER;
432
433 if (dwReason == DLL_PROCESS_DETACH)
434 {
435#if defined(USE_VEH_FOR_MSC_SETTHREADNAME)
436 if (lpreserved == NULL && SetThreadName_VEH_handle != NULL)
437 {
438 if (RemoveVectoredExceptionHandlerFuncPtr != NULL)
439 RemoveVectoredExceptionHandlerFuncPtr (SetThreadName_VEH_handle);
440 SetThreadName_VEH_handle = NULL;
441 }
442#endif
443 free_pthread_mem ();
444 }
445 else if (dwReason == DLL_PROCESS_ATTACH)
446 {
447#if defined(USE_VEH_FOR_MSC_SETTHREADNAME)
448 if (AddVectoredExceptionHandlerFuncPtr != NULL)
449 SetThreadName_VEH_handle = AddVectoredExceptionHandlerFuncPtr (1, &SetThreadName_VEH);
450 else
451 SetThreadName_VEH_handle = NULL;
452 /* Can't do anything on error anyway, check for NULL later */
453#endif
454 }
455 else if (dwReason == DLL_THREAD_DETACH)
456 {
457 if (_pthread_tls != 0xffffffff)
458 t = (_pthread_v *)TlsGetValue(_pthread_tls);
459 if (t && t->thread_noposix != 0)
460 {
461 _pthread_cleanup_dest (t->x);
462 if (t->h != NULL)
463 {
464 CloseHandle (t->h);
465 if (t->evStart)
466 CloseHandle (t->evStart);
467 t->evStart = NULL;
468 t->h = NULL;
469 }
470 pthread_mutex_destroy (&t->p_clock);
471 replace_spin_keys (&t->spin_keys, new_spin_keys);
472 push_pthread_mem (t);
473 t = NULL;
474 TlsSetValue (_pthread_tls, t);
475 }
476 else if (t && t->ended == 0)
477 {
478 if (t->evStart)
479 CloseHandle(t->evStart);
480 t->evStart = NULL;
481 t->ended = 1;
482 _pthread_cleanup_dest (t->x);
483 if ((t->p_state & PTHREAD_CREATE_DETACHED) == PTHREAD_CREATE_DETACHED)
484 {
485 t->valid = DEAD_THREAD;
486 if (t->h != NULL)
487 CloseHandle (t->h);
488 t->h = NULL;
489 pthread_mutex_destroy(&t->p_clock);
490 replace_spin_keys (&t->spin_keys, new_spin_keys);
491 push_pthread_mem (t);
492 t = NULL;
493 TlsSetValue (_pthread_tls, t);
494 return;
495 }
496 pthread_mutex_destroy(&t->p_clock);
497 replace_spin_keys (&t->spin_keys, new_spin_keys);
498 }
499 else if (t)
500 {
501 if (t->evStart)
502 CloseHandle (t->evStart);
503 t->evStart = NULL;
504 pthread_mutex_destroy (&t->p_clock);
505 replace_spin_keys (&t->spin_keys, new_spin_keys);
506 }
507 }
508}
509
510/* TLS-runtime section variable. */
511
512#if defined(_MSC_VER)
513/* Force a reference to _tls_used to make the linker create the TLS
514 * directory if it's not already there. (e.g. if __declspec(thread)
515 * is not used).
516 * Force a reference to __xl_f to prevent whole program optimization
517 * from discarding the variable. */
518
519/* On x86, symbols are prefixed with an underscore. */
520# if defined(_M_IX86)
521# pragma comment(linker, "/include:__tls_used")
522# pragma comment(linker, "/include:___xl_f")
523# else
524# pragma comment(linker, "/include:_tls_used")
525# pragma comment(linker, "/include:__xl_f")
526# endif
527
528/* .CRT$XLA to .CRT$XLZ is an array of PIMAGE_TLS_CALLBACK
529 * pointers. Pick an arbitrary location for our callback.
530 *
531 * See VC\...\crt\src\vcruntime\tlssup.cpp for reference. */
532
533# pragma section(".CRT$XLF", long, read)
534#endif
535
536WINPTHREADS_ATTRIBUTE((WINPTHREADS_SECTION(".CRT$XLF")))
537extern const PIMAGE_TLS_CALLBACK __xl_f;
538const PIMAGE_TLS_CALLBACK __xl_f = __dyn_tls_pthread;
539
540
541#ifdef WINPTHREAD_DBG
542static int print_state = 0;
543void thread_print_set (int state)
544{
545 print_state = state;
546}
547
548void
549thread_print (volatile pthread_t t, char *txt)
550{
551 if (!print_state)
552 return;
553 if (!t)
554 printf("T%p %lu %s\n",NULL,GetCurrentThreadId(),txt);
555 else
556 {
557 printf("T%p %lu V=%0X H=%p %s\n",
558 (void *) __pth_gpointer_locked (t),
559 GetCurrentThreadId(),
560 (__pth_gpointer_locked (t))->valid,
561 (__pth_gpointer_locked (t))->h,
562 txt
563 );
564 }
565}
566#endif
567
568/* Internal collect-once structure. */
569typedef struct collect_once_t {
570 pthread_once_t *o;
571 pthread_mutex_t m;
572 int count;
573 struct collect_once_t *next;
574} collect_once_t;
575
576static collect_once_t *once_obj = NULL;
577
578static pthread_spinlock_t once_global = PTHREAD_SPINLOCK_INITIALIZER;
579
580static collect_once_t *
581enterOnceObject (pthread_once_t *o)
582{
583 collect_once_t *c, *p = NULL;
584 pthread_spin_lock (&once_global);
585 c = once_obj;
586 while (c != NULL && c->o != o)
587 {
588 c = (p = c)->next;
589 }
590 if (!c)
591 {
592 c = (collect_once_t *) calloc(1,sizeof(collect_once_t));
593 c->o = o;
594 c->count = 1;
595 if (!p)
596 once_obj = c;
597 else
598 p->next = c;
599 pthread_mutex_init(&c->m, NULL);
600 }
601 else
602 c->count += 1;
603 pthread_spin_unlock (&once_global);
604 return c;
605}
606
607static void
608leaveOnceObject (collect_once_t *c)
609{
610 collect_once_t *h, *p = NULL;
611 if (!c)
612 return;
613 pthread_spin_lock (&once_global);
614 h = once_obj;
615 while (h != NULL && c != h)
616 h = (p = h)->next;
617
618 if (h)
619 {
620 c->count -= 1;
621 if (c->count == 0)
622 {
623 pthread_mutex_destroy(&c->m);
624 if (!p)
625 once_obj = c->next;
626 else
627 p->next = c->next;
628 free (c);
629 }
630 }
631 else
632 fprintf(stderr, "%p not found?!?!\n", (void *) c);
633 pthread_spin_unlock (&once_global);
634}
635
636static void
637_pthread_once_cleanup (void *o)
638{
639 collect_once_t *co = (collect_once_t *) o;
640 pthread_mutex_unlock (&co->m);
641 leaveOnceObject (co);
642}
643
644static int
645_pthread_once_raw (pthread_once_t *o, void (*func)(void))
646{
647 collect_once_t *co;
648 long state = *o;
649
650 CHECK_PTR(o);
651 CHECK_PTR(func);
652
653 if (state == 1)
654 return 0;
655 co = enterOnceObject(o);
656 pthread_mutex_lock(&co->m);
657 if (*o == 0)
658 {
659 func();
660 *o = 1;
661 }
662 else if (*o != 1)
663 fprintf (stderr," once %p is %ld\n", (void *) o, (long) *o);
664 pthread_mutex_unlock(&co->m);
665 leaveOnceObject(co);
666
667 /* Done */
668 return 0;
669}
670
671/* Unimplemented. */
672void *
673pthread_timechange_handler_np(void *dummy)
674{
675 return NULL;
676}
677
678/* Compatibility routine for pthread-win32. It waits for ellapse of
679 interval and additionally checks for possible thread-cancelation. */
680int
681pthread_delay_np (const struct timespec *interval)
682{
683 DWORD to = (!interval ? 0 : dwMilliSecs (_pthread_time_in_ms_from_timespec (interval)));
684 struct _pthread_v *s = __pthread_self_lite ();
685
686 if (!to)
687 {
688 pthread_testcancel ();
689 Sleep (0);
690 pthread_testcancel ();
691 return 0;
692 }
693 pthread_testcancel ();
694 if (s->evStart)
695 _pthread_wait_for_single_object (s->evStart, to);
696 else
697 Sleep (to);
698 pthread_testcancel ();
699 return 0;
700}
701
702int pthread_delay_np_ms (DWORD to);
703
704int
705pthread_delay_np_ms (DWORD to)
706{
707 struct _pthread_v *s = __pthread_self_lite ();
708
709 if (!to)
710 {
711 pthread_testcancel ();
712 Sleep (0);
713 pthread_testcancel ();
714 return 0;
715 }
716 pthread_testcancel ();
717 if (s->evStart)
718 _pthread_wait_for_single_object (s->evStart, to);
719 else
720 Sleep (to);
721 pthread_testcancel ();
722 return 0;
723}
724
725/* Compatibility routine for pthread-win32. It returns the
726 amount of available CPUs on system. */
727int
728pthread_num_processors_np(void)
729{
730 int r = 0;
731 DWORD_PTR ProcessAffinityMask, SystemAffinityMask;
732
733 if (GetProcessAffinityMask(GetCurrentProcess(), &ProcessAffinityMask, &SystemAffinityMask))
734 {
735 for(; ProcessAffinityMask != 0; ProcessAffinityMask >>= 1)
736 r += (ProcessAffinityMask & 1) != 0;
737 }
738 /* assume at least 1 */
739 return r ? r : 1;
740}
741
742/* Compatiblity routine for pthread-win32. Allows to set amount of used
743 CPUs for process. */
744int
745pthread_set_num_processors_np(int n)
746{
747 DWORD_PTR ProcessAffinityMask, ProcessNewAffinityMask = 0, SystemAffinityMask;
748 int r = 0;
749 /* need at least 1 */
750 n = n ? n : 1;
751 if (GetProcessAffinityMask (GetCurrentProcess (), &ProcessAffinityMask, &SystemAffinityMask))
752 {
753 for (; ProcessAffinityMask != 0; ProcessAffinityMask >>= 1)
754 {
755 ProcessNewAffinityMask <<= 1;
756 if ((ProcessAffinityMask & 1) != 0 && r < n)
757 {
758 ProcessNewAffinityMask |= 1;
759 r++;
760 }
761 }
762 SetProcessAffinityMask (GetCurrentProcess (),ProcessNewAffinityMask);
763 }
764 return r;
765}
766
767int
768pthread_once (pthread_once_t *o, void (*func)(void))
769{
770 collect_once_t *co;
771 long state = *o;
772
773 CHECK_PTR(o);
774 CHECK_PTR(func);
775
776 if (state == 1)
777 return 0;
778 co = enterOnceObject(o);
779 pthread_mutex_lock(&co->m);
780 if (*o == 0)
781 {
782 pthread_cleanup_push(_pthread_once_cleanup, co);
783 func();
784 pthread_cleanup_pop(0);
785 *o = 1;
786 }
787 else if (*o != 1)
788 fprintf (stderr," once %p is %ld\n", (void *) o, (long) *o);
789 pthread_mutex_unlock(&co->m);
790 leaveOnceObject(co);
791
792 return 0;
793}
794
795int
796pthread_key_create (pthread_key_t *key, void (* dest)(void *))
797{
798 unsigned int i;
799 long nmax;
800 void (**d)(void *);
801
802 if (!key)
803 return EINVAL;
804
805 pthread_rwlock_wrlock (&_pthread_key_lock);
806
807 for (i = _pthread_key_sch; i < _pthread_key_max; i++)
808 {
809 if (!_pthread_key_dest[i])
810 {
811 *key = i;
812 if (dest)
813 _pthread_key_dest[i] = dest;
814 else
815 _pthread_key_dest[i] = (void(*)(void *))1;
816 pthread_rwlock_unlock (&_pthread_key_lock);
817 return 0;
818 }
819 }
820
821 for (i = 0; i < _pthread_key_sch; i++)
822 {
823 if (!_pthread_key_dest[i])
824 {
825 *key = i;
826 if (dest)
827 _pthread_key_dest[i] = dest;
828 else
829 _pthread_key_dest[i] = (void(*)(void *))1;
830 pthread_rwlock_unlock (&_pthread_key_lock);
831
832 return 0;
833 }
834 }
835
836 if (_pthread_key_max == PTHREAD_KEYS_MAX)
837 {
838 pthread_rwlock_unlock(&_pthread_key_lock);
839 return ENOMEM;
840 }
841
842 nmax = _pthread_key_max * 2;
843 if (nmax == 0)
844 nmax = _pthread_key_max + 1;
845 if (nmax > PTHREAD_KEYS_MAX)
846 nmax = PTHREAD_KEYS_MAX;
847
848 /* No spare room anywhere */
849 d = (void (__cdecl **)(void *))realloc(_pthread_key_dest, nmax * sizeof(*d));
850 if (!d)
851 {
852 pthread_rwlock_unlock (&_pthread_key_lock);
853 return ENOMEM;
854 }
855
856 /* Clear new region */
857 memset ((void *) &d[_pthread_key_max], 0, (nmax-_pthread_key_max)*sizeof(void *));
858
859 /* Use new region */
860 _pthread_key_dest = d;
861 _pthread_key_sch = _pthread_key_max + 1;
862 *key = _pthread_key_max;
863 _pthread_key_max = nmax;
864
865 if (dest)
866 _pthread_key_dest[*key] = dest;
867 else
868 _pthread_key_dest[*key] = (void(*)(void *))1;
869
870 pthread_rwlock_unlock (&_pthread_key_lock);
871 return 0;
872}
873
874int
875pthread_key_delete (pthread_key_t key)
876{
877 if (key >= _pthread_key_max || !_pthread_key_dest)
878 return EINVAL;
879
880 pthread_rwlock_wrlock (&_pthread_key_lock);
881
882 _pthread_key_dest[key] = NULL;
883
884 /* Start next search from our location */
885 if (_pthread_key_sch > key)
886 _pthread_key_sch = key;
887 /* So now we need to walk the complete list of threads
888 and remove key's reference for it. */
889 __pth_remove_use_for_key (key);
890
891 pthread_rwlock_unlock (&_pthread_key_lock);
892 return 0;
893}
894
895void *
896pthread_getspecific (pthread_key_t key)
897{
898 DWORD lasterr = GetLastError ();
899 void *r;
900 _pthread_v *t = __pthread_self_lite ();
901 pthread_spin_lock (&t->spin_keys);
902 r = (key >= t->keymax || t->keyval_set[key] == 0 ? NULL : t->keyval[key]);
903 pthread_spin_unlock (&t->spin_keys);
904 SetLastError (lasterr);
905 return r;
906}
907
908int
909pthread_setspecific (pthread_key_t key, const void *value)
910{
911 DWORD lasterr = GetLastError ();
912 _pthread_v *t = __pthread_self_lite ();
913
914 pthread_spin_lock (&t->spin_keys);
915
916 if (key >= t->keymax)
917 {
918 int keymax = (key + 1);
919 void **kv;
920 unsigned char *kv_set;
921
922 kv = (void **) realloc (t->keyval, keymax * sizeof (void *));
923
924 if (!kv)
925 {
926 pthread_spin_unlock (&t->spin_keys);
927 return ENOMEM;
928 }
929 kv_set = (unsigned char *) realloc (t->keyval_set, keymax);
930 if (!kv_set)
931 {
932 pthread_spin_unlock (&t->spin_keys);
933 return ENOMEM;
934 }
935
936 /* Clear new region */
937 memset (&kv[t->keymax], 0, (keymax - t->keymax)*sizeof(void *));
938 memset (&kv_set[t->keymax], 0, (keymax - t->keymax));
939
940 t->keyval = kv;
941 t->keyval_set = kv_set;
942 t->keymax = keymax;
943 }
944
945 t->keyval[key] = (void *) value;
946 t->keyval_set[key] = 1;
947 pthread_spin_unlock (&t->spin_keys);
948 SetLastError (lasterr);
949
950 return 0;
951}
952
953int
954pthread_equal (pthread_t t1, pthread_t t2)
955{
956 return (t1 == t2);
957}
958
959void
960pthread_tls_init (void)
961{
962 _pthread_tls = TlsAlloc();
963
964 /* Cannot continue if out of indexes */
965 if (_pthread_tls == TLS_OUT_OF_INDEXES)
966 abort();
967}
968
969void
970_pthread_cleanup_dest (pthread_t t)
971{
972 _pthread_v *tv;
973 unsigned int i, j;
974
975 if (!t)
976 return;
977 tv = __pth_gpointer_locked (t);
978 if (!tv)
979 return;
980
981 for (j = 0; j < PTHREAD_DESTRUCTOR_ITERATIONS; j++)
982 {
983 int flag = 0;
984
985 pthread_spin_lock (&tv->spin_keys);
986 for (i = 0; i < tv->keymax; i++)
987 {
988 void *val = tv->keyval[i];
989
990 if (tv->keyval_set[i])
991 {
992 pthread_rwlock_rdlock (&_pthread_key_lock);
993 if ((uintptr_t) _pthread_key_dest[i] > 1)
994 {
995 /* Call destructor */
996 tv->keyval[i] = NULL;
997 tv->keyval_set[i] = 0;
998 pthread_spin_unlock (&tv->spin_keys);
999 _pthread_key_dest[i](val);
1000 pthread_spin_lock (&tv->spin_keys);
1001 flag = 1;
1002 }
1003 else
1004 {
1005 tv->keyval[i] = NULL;
1006 tv->keyval_set[i] = 0;
1007 }
1008 pthread_rwlock_unlock(&_pthread_key_lock);
1009 }
1010 }
1011 pthread_spin_unlock (&tv->spin_keys);
1012 /* Nothing to do? */
1013 if (!flag)
1014 return;
1015 }
1016}
1017
1018static _pthread_v *
1019__pthread_self_lite (void)
1020{
1021 _pthread_v *t;
1022 pthread_spinlock_t new_spin_keys = PTHREAD_SPINLOCK_INITIALIZER;
1023
1024 _pthread_once_raw (&_pthread_tls_once, pthread_tls_init);
1025
1026 t = (_pthread_v *) TlsGetValue (_pthread_tls);
1027 if (t)
1028 return t;
1029 /* Main thread? */
1030 t = (struct _pthread_v *) pop_pthread_mem ();
1031
1032 /* If cannot initialize main thread, then the only thing we can do is return null pthread_t */
1033 if (!__xl_f || !t)
1034 return 0;
1035
1036 t->p_state = PTHREAD_DEFAULT_ATTR /*| PTHREAD_CREATE_DETACHED*/;
1037 t->tid = GetCurrentThreadId();
1038 t->evStart = CreateEvent (NULL, 1, 0, NULL);
1039 t->p_clock = PTHREAD_MUTEX_INITIALIZER;
1040 replace_spin_keys (&t->spin_keys, new_spin_keys);
1041 t->sched_pol = SCHED_OTHER;
1042 t->h = NULL; //GetCurrentThread();
1043 if (!DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &t->h, 0, FALSE, DUPLICATE_SAME_ACCESS))
1044 abort ();
1045 t->sched.sched_priority = GetThreadPriority(t->h);
1046 t->ended = 0;
1047 t->thread_noposix = 1;
1048
1049 /* Save for later */
1050 if (!TlsSetValue(_pthread_tls, t))
1051 abort ();
1052 return t;
1053}
1054
1055pthread_t
1056pthread_self (void)
1057{
1058 _pthread_v *t = __pthread_self_lite ();
1059
1060 if (!t)
1061 return 0;
1062 return t->x;
1063}
1064
1065/* Internal helper for getting event handle of thread T. */
1066void *
1067pthread_getevent (void)
1068{
1069 _pthread_v *t = __pthread_self_lite ();
1070 return (!t ? NULL : t->evStart);
1071}
1072
1073/* Internal helper for getting thread handle of thread T. */
1074void *
1075pthread_gethandle (pthread_t t)
1076{
1077 struct _pthread_v *tv = __pth_gpointer_locked (t);
1078 return (!tv ? NULL : tv->h);
1079}
1080
1081/* Internal helper for getting pointer of clean of current thread. */
1082struct _pthread_cleanup **
1083pthread_getclean (void)
1084{
1085 struct _pthread_v *t = __pthread_self_lite ();
1086 if (!t) return NULL;
1087 return &t->clean;
1088}
1089
1090int
1091pthread_get_concurrency (int *val)
1092{
1093 *val = _pthread_concur;
1094 return 0;
1095}
1096
1097int
1098pthread_set_concurrency (int val)
1099{
1100 _pthread_concur = val;
1101 return 0;
1102}
1103
1104void
1105pthread_exit (void *res)
1106{
1107 _pthread_v *t = NULL;
1108 unsigned rslt = (unsigned) ((intptr_t) res);
1109 struct _pthread_v *id = __pthread_self_lite ();
1110
1111 id->ret_arg = res;
1112
1113 _pthread_cleanup_dest (id->x);
1114 if (id->thread_noposix == 0)
1115 longjmp(id->jb, 1);
1116
1117 /* Make sure we free ourselves if we are detached */
1118 if ((t = (_pthread_v *)TlsGetValue(_pthread_tls)) != NULL)
1119 {
1120 if (!t->h)
1121 {
1122 t->valid = DEAD_THREAD;
1123 if (t->evStart)
1124 CloseHandle (t->evStart);
1125 t->evStart = NULL;
1126 rslt = (unsigned) (size_t) t->ret_arg;
1127 push_pthread_mem(t);
1128 t = NULL;
1129 TlsSetValue (_pthread_tls, t);
1130 }
1131 else
1132 {
1133 rslt = (unsigned) (size_t) t->ret_arg;
1134 t->ended = 1;
1135 if (t->evStart)
1136 CloseHandle (t->evStart);
1137 t->evStart = NULL;
1138 if ((t->p_state & PTHREAD_CREATE_DETACHED) == PTHREAD_CREATE_DETACHED)
1139 {
1140 t->valid = DEAD_THREAD;
1141 CloseHandle (t->h);
1142 t->h = NULL;
1143 push_pthread_mem(t);
1144 t = NULL;
1145 TlsSetValue(_pthread_tls, t);
1146 }
1147 }
1148 }
1149 /* Time to die */
1150 _endthreadex(rslt);
1151}
1152
1153void
1154_pthread_invoke_cancel (void)
1155{
1156 _pthread_cleanup *pcup;
1157 struct _pthread_v *se = __pthread_self_lite ();
1158 se->in_cancel = 1;
1159 _pthread_setnobreak (1);
1160 InterlockedDecrement(&_pthread_cancelling);
1161
1162 /* Call cancel queue */
1163 for (pcup = se->clean; pcup; pcup = pcup->next)
1164 {
1165 pcup->func((pthread_once_t *)pcup->arg);
1166 }
1167
1168 _pthread_setnobreak (0);
1169 pthread_exit(PTHREAD_CANCELED);
1170}
1171
1172int
1173__pthread_shallcancel (void)
1174{
1175 struct _pthread_v *t;
1176 if (!_pthread_cancelling)
1177 return 0;
1178 t = __pthread_self_lite ();
1179 if (t == NULL)
1180 return 0;
1181 if (t->nobreak <= 0 && t->cancelled && (t->p_state & PTHREAD_CANCEL_ENABLE))
1182 return 1;
1183 return 0;
1184}
1185
1186void
1187_pthread_setnobreak (int v)
1188{
1189 struct _pthread_v *t = __pthread_self_lite ();
1190 if (t == NULL)
1191 return;
1192 if (v > 0)
1193 InterlockedIncrement ((long*)&t->nobreak);
1194 else
1195 InterlockedDecrement((long*)&t->nobreak);
1196}
1197
1198void
1199pthread_testcancel (void)
1200{
1201 struct _pthread_v *self = __pthread_self_lite ();
1202
1203 if (!self || self->in_cancel)
1204 return;
1205 if (!_pthread_cancelling)
1206 return;
1207 pthread_mutex_lock (&self->p_clock);
1208
1209 if (self->cancelled && (self->p_state & PTHREAD_CANCEL_ENABLE) && self->nobreak <= 0)
1210 {
1211 self->in_cancel = 1;
1212 self->p_state &= ~PTHREAD_CANCEL_ENABLE;
1213 if (self->evStart)
1214 ResetEvent (self->evStart);
1215 pthread_mutex_unlock (&self->p_clock);
1216 _pthread_invoke_cancel ();
1217 }
1218 pthread_mutex_unlock (&self->p_clock);
1219}
1220
1221int
1222pthread_cancel (pthread_t t)
1223{
1224 struct _pthread_v *tv = __pth_gpointer_locked (t);
1225
1226 if (tv == NULL)
1227 return ESRCH;
1228 CHECK_OBJECT(tv, ESRCH);
1229 /*if (tv->ended) return ESRCH;*/
1230 pthread_mutex_lock(&tv->p_clock);
1231 if (pthread_equal(pthread_self(), t))
1232 {
1233 if(tv->cancelled)
1234 {
1235 pthread_mutex_unlock(&tv->p_clock);
1236 return (tv->in_cancel ? ESRCH : 0);
1237 }
1238 tv->cancelled = 1;
1239 InterlockedIncrement(&_pthread_cancelling);
1240 if(tv->evStart) SetEvent(tv->evStart);
1241 if ((tv->p_state & PTHREAD_CANCEL_ASYNCHRONOUS) != 0 && (tv->p_state & PTHREAD_CANCEL_ENABLE) != 0)
1242 {
1243 tv->p_state &= ~PTHREAD_CANCEL_ENABLE;
1244 tv->in_cancel = 1;
1245 pthread_mutex_unlock(&tv->p_clock);
1246 _pthread_invoke_cancel();
1247 }
1248 else
1249 pthread_mutex_unlock(&tv->p_clock);
1250 return 0;
1251 }
1252
1253 if ((tv->p_state & PTHREAD_CANCEL_ASYNCHRONOUS) != 0 && (tv->p_state & PTHREAD_CANCEL_ENABLE) != 0)
1254 {
1255 /* Dangerous asynchronous cancelling */
1256 CONTEXT ctxt;
1257
1258 if(tv->in_cancel)
1259 {
1260 pthread_mutex_unlock(&tv->p_clock);
1261 return (tv->in_cancel ? ESRCH : 0);
1262 }
1263 /* Already done? */
1264 if(tv->cancelled || tv->in_cancel)
1265 {
1266 /* ??? pthread_mutex_unlock (&tv->p_clock); */
1267 return ESRCH;
1268 }
1269
1270 ctxt.ContextFlags = CONTEXT_CONTROL;
1271
1272 SuspendThread (tv->h);
1273 if (WaitForSingleObject (tv->h, 0) == WAIT_TIMEOUT)
1274 {
1275 GetThreadContext(tv->h, &ctxt);
1276#ifdef _M_X64
1277 ctxt.Rip = (uintptr_t) _pthread_invoke_cancel;
1278#elif defined(_M_IX86)
1279 ctxt.Eip = (uintptr_t) _pthread_invoke_cancel;
1280#elif defined(_M_ARM) || defined(_M_ARM64)
1281 ctxt.Pc = (uintptr_t) _pthread_invoke_cancel;
1282#else
1283#error Unsupported architecture
1284#endif
1285#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
1286 SetThreadContext (tv->h, &ctxt);
1287#endif
1288
1289 /* Also try deferred Cancelling */
1290 tv->cancelled = 1;
1291 tv->p_state &= ~PTHREAD_CANCEL_ENABLE;
1292 tv->in_cancel = 1;
1293
1294 /* Notify everyone to look */
1295 InterlockedIncrement (&_pthread_cancelling);
1296 if (tv->evStart)
1297 SetEvent (tv->evStart);
1298 pthread_mutex_unlock (&tv->p_clock);
1299
1300 ResumeThread (tv->h);
1301 }
1302 }
1303 else
1304 {
1305 if (tv->cancelled == 0)
1306 {
1307 /* Safe deferred Cancelling */
1308 tv->cancelled = 1;
1309
1310 /* Notify everyone to look */
1311 InterlockedIncrement (&_pthread_cancelling);
1312 if (tv->evStart)
1313 SetEvent (tv->evStart);
1314 }
1315 else
1316 {
1317 pthread_mutex_unlock (&tv->p_clock);
1318 return (tv->in_cancel ? ESRCH : 0);
1319 }
1320 }
1321 pthread_mutex_unlock (&tv->p_clock);
1322 return 0;
1323}
1324
1325/* half-stubbed version as we don't really well support signals */
1326int
1327pthread_kill (pthread_t t, int sig)
1328{
1329 struct _pthread_v *tv;
1330
1331 pthread_mutex_lock (&mtx_pthr_locked);
1332 tv = __pthread_get_pointer (t);
1333 if (!tv || t != tv->x || tv->in_cancel || tv->ended || tv->h == NULL
1334 || tv->h == INVALID_HANDLE_VALUE)
1335 {
1336 pthread_mutex_unlock (&mtx_pthr_locked);
1337 return ESRCH;
1338 }
1339 pthread_mutex_unlock (&mtx_pthr_locked);
1340 if (!sig)
1341 return 0;
1342 if (sig < SIGINT || sig > NSIG)
1343 return EINVAL;
1344 return pthread_cancel(t);
1345}
1346
1347unsigned
1348_pthread_get_state (const pthread_attr_t *attr, unsigned flag)
1349{
1350 return (attr->p_state & flag);
1351}
1352
1353int
1354_pthread_set_state (pthread_attr_t *attr, unsigned flag, unsigned val)
1355{
1356 if (~flag & val)
1357 return EINVAL;
1358 attr->p_state &= ~flag;
1359 attr->p_state |= val;
1360
1361 return 0;
1362}
1363
1364int
1365pthread_attr_init (pthread_attr_t *attr)
1366{
1367 memset (attr, 0, sizeof (pthread_attr_t));
1368 attr->p_state = PTHREAD_DEFAULT_ATTR;
1369 attr->stack = NULL;
1370 attr->s_size = 0;
1371 return 0;
1372}
1373
1374int
1375pthread_attr_destroy (pthread_attr_t *attr)
1376{
1377 /* No need to do anything */
1378 memset (attr, 0, sizeof(pthread_attr_t));
1379 return 0;
1380}
1381
1382int
1383pthread_attr_setdetachstate (pthread_attr_t *a, int flag)
1384{
1385 return _pthread_set_state(a, PTHREAD_CREATE_DETACHED, flag);
1386}
1387
1388int
1389pthread_attr_getdetachstate (const pthread_attr_t *a, int *flag)
1390{
1391 *flag = _pthread_get_state(a, PTHREAD_CREATE_DETACHED);
1392 return 0;
1393}
1394
1395int
1396pthread_attr_setinheritsched (pthread_attr_t *a, int flag)
1397{
1398 if (!a || (flag != PTHREAD_INHERIT_SCHED && flag != PTHREAD_EXPLICIT_SCHED))
1399 return EINVAL;
1400 return _pthread_set_state(a, PTHREAD_INHERIT_SCHED, flag);
1401}
1402
1403int
1404pthread_attr_getinheritsched (const pthread_attr_t *a, int *flag)
1405{
1406 *flag = _pthread_get_state(a, PTHREAD_INHERIT_SCHED);
1407 return 0;
1408}
1409
1410int
1411pthread_attr_setscope (pthread_attr_t *a, int flag)
1412{
1413 return _pthread_set_state(a, PTHREAD_SCOPE_SYSTEM, flag);
1414}
1415
1416int
1417pthread_attr_getscope (const pthread_attr_t *a, int *flag)
1418{
1419 *flag = _pthread_get_state(a, PTHREAD_SCOPE_SYSTEM);
1420 return 0;
1421}
1422
1423int
1424pthread_attr_getstack (const pthread_attr_t *attr, void **stack, size_t *size)
1425{
1426 *stack = (char *) attr->stack - attr->s_size;
1427 *size = attr->s_size;
1428 return 0;
1429}
1430
1431int
1432pthread_attr_setstack (pthread_attr_t *attr, void *stack, size_t size)
1433{
1434 attr->s_size = size;
1435 attr->stack = (char *) stack + size;
1436 return 0;
1437}
1438
1439int
1440pthread_attr_getstackaddr (const pthread_attr_t *attr, void **stack)
1441{
1442 *stack = attr->stack;
1443 return 0;
1444}
1445
1446int
1447pthread_attr_setstackaddr (pthread_attr_t *attr, void *stack)
1448{
1449 attr->stack = stack;
1450 return 0;
1451}
1452
1453int
1454pthread_attr_getstacksize (const pthread_attr_t *attr, size_t *size)
1455{
1456 *size = attr->s_size;
1457 return 0;
1458}
1459
1460int
1461pthread_attr_setstacksize (pthread_attr_t *attr, size_t size)
1462{
1463 attr->s_size = size;
1464 return 0;
1465}
1466
1467static void
1468test_cancel_locked (pthread_t t)
1469{
1470 struct _pthread_v *tv = __pth_gpointer_locked (t);
1471
1472 if (!tv || tv->in_cancel || tv->ended != 0 || (tv->p_state & PTHREAD_CANCEL_ENABLE) == 0)
1473 return;
1474 if ((tv->p_state & PTHREAD_CANCEL_ASYNCHRONOUS) == 0)
1475 return;
1476 if (WaitForSingleObject(tv->evStart, 0) != WAIT_OBJECT_0)
1477 return;
1478 pthread_mutex_unlock (&tv->p_clock);
1479 _pthread_invoke_cancel();
1480}
1481
1482int
1483pthread_setcancelstate (int state, int *oldstate)
1484{
1485 _pthread_v *t = __pthread_self_lite ();
1486
1487 if (!t || (state & PTHREAD_CANCEL_ENABLE) != state)
1488 return EINVAL;
1489
1490 pthread_mutex_lock (&t->p_clock);
1491 if (oldstate)
1492 *oldstate = t->p_state & PTHREAD_CANCEL_ENABLE;
1493 t->p_state &= ~PTHREAD_CANCEL_ENABLE;
1494 t->p_state |= state;
1495 test_cancel_locked (t->x);
1496 pthread_mutex_unlock (&t->p_clock);
1497
1498 return 0;
1499}
1500
1501int
1502pthread_setcanceltype (int type, int *oldtype)
1503{
1504 _pthread_v *t = __pthread_self_lite ();
1505
1506 if (!t || (type & PTHREAD_CANCEL_ASYNCHRONOUS) != type)
1507 return EINVAL;
1508
1509 pthread_mutex_lock (&t->p_clock);
1510 if (oldtype)
1511 *oldtype = t->p_state & PTHREAD_CANCEL_ASYNCHRONOUS;
1512 t->p_state &= ~PTHREAD_CANCEL_ASYNCHRONOUS;
1513 t->p_state |= type;
1514 test_cancel_locked (t->x);
1515 pthread_mutex_unlock (&t->p_clock);
1516
1517 return 0;
1518}
1519
1520void _fpreset (void);
1521
1522#if defined(__i386__)
1523/* Align ESP on 16-byte boundaries. */
1524# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
1525__attribute__((force_align_arg_pointer))
1526# endif
1527#endif
1528unsigned __stdcall
1529pthread_create_wrapper (void *args)
1530{
1531 unsigned rslt = 0;
1532 struct _pthread_v *tv = (struct _pthread_v *)args;
1533
1534 _fpreset();
1535
1536 pthread_mutex_lock (&mtx_pthr_locked);
1537 pthread_mutex_lock (&tv->p_clock);
1538 _pthread_once_raw(&_pthread_tls_once, pthread_tls_init);
1539 TlsSetValue(_pthread_tls, tv);
1540 tv->tid = GetCurrentThreadId();
1541 pthread_mutex_unlock (&tv->p_clock);
1542
1543
1544 if (!setjmp(tv->jb))
1545 {
1546 intptr_t trslt = (intptr_t) 128;
1547 /* Provide to this thread a default exception handler. */
1548 #ifdef __SEH__
1549 asm ("\t.tl_start:\n");
1550 #endif /* Call function and save return value */
1551 pthread_mutex_unlock (&mtx_pthr_locked);
1552 if (tv->func)
1553 trslt = (intptr_t) tv->func(tv->ret_arg);
1554 #ifdef __SEH__
1555 asm ("\tnop\n\t.tl_end: nop\n"
1556#ifdef __arm__
1557 "\t.seh_handler __C_specific_handler, %except\n"
1558#else
1559 "\t.seh_handler __C_specific_handler, @except\n"
1560#endif
1561 "\t.seh_handlerdata\n"
1562 "\t.long 1\n"
1563 "\t.rva .tl_start, .tl_end, _gnu_exception_handler ,.tl_end\n"
1564 "\t.text"
1565 );
1566 #endif
1567 pthread_mutex_lock (&mtx_pthr_locked);
1568 tv->ret_arg = (void*) trslt;
1569 /* Clean up destructors */
1570 _pthread_cleanup_dest(tv->x);
1571 }
1572 else
1573 pthread_mutex_lock (&mtx_pthr_locked);
1574
1575 pthread_mutex_lock (&tv->p_clock);
1576 rslt = (unsigned) (size_t) tv->ret_arg;
1577 /* Make sure we free ourselves if we are detached */
1578 if (tv->evStart)
1579 CloseHandle (tv->evStart);
1580 tv->evStart = NULL;
1581 if (!tv->h)
1582 {
1583 tv->valid = DEAD_THREAD;
1584 pthread_mutex_unlock (&tv->p_clock);
1585 pthread_mutex_destroy (&tv->p_clock);
1586 push_pthread_mem (tv);
1587 tv = NULL;
1588 TlsSetValue (_pthread_tls, tv);
1589 }
1590 else
1591 {
1592 pthread_mutex_unlock (&tv->p_clock);
1593 pthread_mutex_destroy (&tv->p_clock);
1594 /* Reinitialise p_clock, since there may be attempts at
1595 destroying it again in __dyn_tls_thread later on. */
1596 tv->p_clock = PTHREAD_MUTEX_INITIALIZER;
1597 tv->ended = 1;
1598 }
1599 while (pthread_mutex_unlock (&mtx_pthr_locked) == 0)
1600 Sleep (0);
1601 _endthreadex (rslt);
1602 return rslt;
1603}
1604
1605int
1606pthread_create (pthread_t *th, const pthread_attr_t *attr, void *(* func)(void *), void *arg)
1607{
1608 HANDLE thrd = NULL;
1609 int redo = 0;
1610 struct _pthread_v *tv;
1611 unsigned int ssize = 0;
1612 pthread_spinlock_t new_spin_keys = PTHREAD_SPINLOCK_INITIALIZER;
1613
1614 if (attr && attr->s_size > UINT_MAX)
1615 return EINVAL;
1616
1617 if ((tv = pop_pthread_mem ()) == NULL)
1618 return EAGAIN;
1619
1620 if (th)
1621 *th = tv->x;
1622
1623 /* Save data in pthread_t */
1624 tv->ended = 0;
1625 tv->ret_arg = arg;
1626 tv->func = func;
1627 tv->p_state = PTHREAD_DEFAULT_ATTR;
1628 tv->h = INVALID_HANDLE_VALUE;
1629 /* We retry it here a few times, as events are a limited resource ... */
1630 do
1631 {
1632 tv->evStart = CreateEvent (NULL, 1, 0, NULL);
1633 if (tv->evStart != NULL)
1634 break;
1635 Sleep ((!redo ? 0 : 20));
1636 }
1637 while (++redo <= 4);
1638
1639 tv->p_clock = PTHREAD_MUTEX_INITIALIZER;
1640 replace_spin_keys (&tv->spin_keys, new_spin_keys);
1641 tv->valid = LIFE_THREAD;
1642 tv->sched.sched_priority = THREAD_PRIORITY_NORMAL;
1643 tv->sched_pol = SCHED_OTHER;
1644 if (tv->evStart == NULL)
1645 {
1646 if (th)
1647 memset (th, 0, sizeof (pthread_t));
1648 push_pthread_mem (tv);
1649 return EAGAIN;
1650 }
1651
1652 if (attr)
1653 {
1654 int inh = 0;
1655 tv->p_state = attr->p_state;
1656 ssize = (unsigned int)attr->s_size;
1657 pthread_attr_getinheritsched (attr, &inh);
1658 if (inh)
1659 {
1660 tv->sched.sched_priority = __pthread_self_lite ()->sched.sched_priority;
1661 }
1662 else
1663 tv->sched.sched_priority = attr->param.sched_priority;
1664 }
1665
1666 /* Make sure tv->h has value of INVALID_HANDLE_VALUE */
1667 _ReadWriteBarrier();
1668
1669 thrd = (HANDLE) _beginthreadex(NULL, ssize, pthread_create_wrapper, tv, 0x4/*CREATE_SUSPEND*/, NULL);
1670 if (thrd == INVALID_HANDLE_VALUE)
1671 thrd = 0;
1672 /* Failed */
1673 if (!thrd)
1674 {
1675 if (tv->evStart)
1676 CloseHandle (tv->evStart);
1677 pthread_mutex_destroy (&tv->p_clock);
1678 replace_spin_keys (&tv->spin_keys, new_spin_keys);
1679 tv->evStart = NULL;
1680 tv->h = 0;
1681 if (th)
1682 memset (th, 0, sizeof (pthread_t));
1683 push_pthread_mem (tv);
1684 return EAGAIN;
1685 }
1686 {
1687 int pr = tv->sched.sched_priority;
1688 if (pr <= THREAD_PRIORITY_IDLE) {
1689 pr = THREAD_PRIORITY_IDLE;
1690 } else if (pr <= THREAD_PRIORITY_LOWEST) {
1691 pr = THREAD_PRIORITY_LOWEST;
1692 } else if (pr >= THREAD_PRIORITY_TIME_CRITICAL) {
1693 pr = THREAD_PRIORITY_TIME_CRITICAL;
1694 } else if (pr >= THREAD_PRIORITY_HIGHEST) {
1695 pr = THREAD_PRIORITY_HIGHEST;
1696 }
1697 SetThreadPriority (thrd, pr);
1698 }
1699 ResetEvent (tv->evStart);
1700 if ((tv->p_state & PTHREAD_CREATE_DETACHED) != 0)
1701 {
1702 tv->h = 0;
1703 ResumeThread (thrd);
1704 CloseHandle (thrd);
1705 }
1706 else
1707 {
1708 tv->h = thrd;
1709 ResumeThread (thrd);
1710 }
1711 Sleep (0);
1712 return 0;
1713}
1714
1715int
1716pthread_join (pthread_t t, void **res)
1717{
1718 DWORD dwFlags;
1719 struct _pthread_v *tv = __pth_gpointer_locked (t);
1720 pthread_spinlock_t new_spin_keys = PTHREAD_SPINLOCK_INITIALIZER;
1721
1722 if (!tv || tv->h == NULL || !GetHandleInformation(tv->h, &dwFlags))
1723 return ESRCH;
1724 if ((tv->p_state & PTHREAD_CREATE_DETACHED) != 0)
1725 return EINVAL;
1726 if (pthread_equal(pthread_self(), t))
1727 return EDEADLK;
1728
1729 /* pthread_testcancel (); */
1730 if (tv->ended == 0 || (tv->h != NULL && tv->h != INVALID_HANDLE_VALUE))
1731 WaitForSingleObject (tv->h, INFINITE);
1732 CloseHandle (tv->h);
1733 if (tv->evStart)
1734 CloseHandle (tv->evStart);
1735 tv->evStart = NULL;
1736 /* Obtain return value */
1737 if (res)
1738 *res = tv->ret_arg;
1739 pthread_mutex_destroy (&tv->p_clock);
1740 replace_spin_keys (&tv->spin_keys, new_spin_keys);
1741 push_pthread_mem (tv);
1742
1743 return 0;
1744}
1745
1746int
1747_pthread_tryjoin (pthread_t t, void **res)
1748{
1749 DWORD dwFlags;
1750 struct _pthread_v *tv;
1751 pthread_spinlock_t new_spin_keys = PTHREAD_SPINLOCK_INITIALIZER;
1752
1753 pthread_mutex_lock (&mtx_pthr_locked);
1754 tv = __pthread_get_pointer (t);
1755
1756 if (!tv || tv->h == NULL || !GetHandleInformation(tv->h, &dwFlags))
1757 {
1758 pthread_mutex_unlock (&mtx_pthr_locked);
1759 return ESRCH;
1760 }
1761
1762 if ((tv->p_state & PTHREAD_CREATE_DETACHED) != 0)
1763 {
1764 pthread_mutex_unlock (&mtx_pthr_locked);
1765 return EINVAL;
1766 }
1767 if (pthread_equal(pthread_self(), t))
1768 {
1769 pthread_mutex_unlock (&mtx_pthr_locked);
1770 return EDEADLK;
1771 }
1772 if(tv->ended == 0 && WaitForSingleObject(tv->h, 0))
1773 {
1774 if (tv->ended == 0)
1775 {
1776 pthread_mutex_unlock (&mtx_pthr_locked);
1777 /* pthread_testcancel (); */
1778 return EBUSY;
1779 }
1780 }
1781 CloseHandle (tv->h);
1782 if (tv->evStart)
1783 CloseHandle (tv->evStart);
1784 tv->evStart = NULL;
1785
1786 /* Obtain return value */
1787 if (res)
1788 *res = tv->ret_arg;
1789 pthread_mutex_destroy (&tv->p_clock);
1790 replace_spin_keys (&tv->spin_keys, new_spin_keys);
1791
1792 push_pthread_mem (tv);
1793
1794 pthread_mutex_unlock (&mtx_pthr_locked);
1795 /* pthread_testcancel (); */
1796 return 0;
1797}
1798
1799int
1800pthread_detach (pthread_t t)
1801{
1802 int r = 0;
1803 DWORD dwFlags;
1804 struct _pthread_v *tv = __pth_gpointer_locked (t);
1805 HANDLE dw;
1806 pthread_spinlock_t new_spin_keys = PTHREAD_SPINLOCK_INITIALIZER;
1807
1808 pthread_mutex_lock (&mtx_pthr_locked);
1809 if (!tv || tv->h == NULL || !GetHandleInformation(tv->h, &dwFlags))
1810 {
1811 pthread_mutex_unlock (&mtx_pthr_locked);
1812 return ESRCH;
1813 }
1814 if ((tv->p_state & PTHREAD_CREATE_DETACHED) != 0)
1815 {
1816 pthread_mutex_unlock (&mtx_pthr_locked);
1817 return EINVAL;
1818 }
1819 /* if (tv->ended) r = ESRCH; */
1820 dw = tv->h;
1821 tv->h = 0;
1822 tv->p_state |= PTHREAD_CREATE_DETACHED;
1823 _ReadWriteBarrier();
1824 if (dw)
1825 {
1826 CloseHandle (dw);
1827 if (tv->ended)
1828 {
1829 if (tv->evStart)
1830 CloseHandle (tv->evStart);
1831 tv->evStart = NULL;
1832 pthread_mutex_destroy (&tv->p_clock);
1833 replace_spin_keys (&tv->spin_keys, new_spin_keys);
1834 push_pthread_mem (tv);
1835 }
1836 }
1837 pthread_mutex_unlock (&mtx_pthr_locked);
1838
1839 return r;
1840}
1841
1842static int dummy_concurrency_level = 0;
1843
1844int
1845pthread_getconcurrency (void)
1846{
1847 return dummy_concurrency_level;
1848}
1849
1850int
1851pthread_setconcurrency (int new_level)
1852{
1853 dummy_concurrency_level = new_level;
1854 return 0;
1855}
1856
1857int
1858pthread_setname_np (pthread_t thread, const char *name)
1859{
1860 struct _pthread_v *tv;
1861 char *stored_name;
1862
1863 if (name == NULL)
1864 return EINVAL;
1865
1866 tv = __pth_gpointer_locked (thread);
1867 if (!tv || thread != tv->x || tv->in_cancel || tv->ended || tv->h == NULL
1868 || tv->h == INVALID_HANDLE_VALUE)
1869 return ESRCH;
1870
1871 stored_name = strdup (name);
1872 if (stored_name == NULL)
1873 return ENOMEM;
1874
1875 if (tv->thread_name != NULL)
1876 free (tv->thread_name);
1877
1878 tv->thread_name = stored_name;
1879 SetThreadName (tv->tid, name);
1880
1881 if (_pthread_set_thread_description != NULL)
1882 {
1883 size_t required_size = mbstowcs(NULL, name, 0);
1884 if (required_size != (size_t)-1)
1885 {
1886 wchar_t *wname = malloc((required_size + 1) * sizeof(wchar_t));
1887 if (wname != NULL)
1888 {
1889 mbstowcs(wname, name, required_size + 1);
1890 _pthread_set_thread_description(tv->h, wname);
1891 free(wname);
1892 }
1893 }
1894 }
1895 return 0;
1896}
1897
1898int
1899pthread_getname_np (pthread_t thread, char *name, size_t len)
1900{
1901 HRESULT result;
1902 struct _pthread_v *tv;
1903
1904 if (name == NULL)
1905 return EINVAL;
1906
1907 tv = __pth_gpointer_locked (thread);
1908 if (!tv || thread != tv->x || tv->in_cancel || tv->ended || tv->h == NULL
1909 || tv->h == INVALID_HANDLE_VALUE)
1910 return ESRCH;
1911
1912 if (len < 1)
1913 return ERANGE;
1914
1915 if (tv->thread_name == NULL)
1916 {
1917 name[0] = '\0';
1918 return 0;
1919 }
1920
1921 if (strlen (tv->thread_name) >= len)
1922 return ERANGE;
1923
1924 result = StringCchCopyNA (name, len, tv->thread_name, len - 1);
1925 if (SUCCEEDED (result))
1926 return 0;
1927
1928 return ERANGE;
1929}
lib/libc/mingw/winpthreads/thread.h created+79
......@@ -0,0 +1,79 @@
1/*
2 Copyright (c) 2011-2016 mingw-w64 project
3
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the "Software"),
6 to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 DEALINGS IN THE SOFTWARE.
21*/
22
23#ifndef WIN_PTHREAD_H
24#define WIN_PTHREAD_H
25
26#include <windows.h>
27#include <setjmp.h>
28#include "rwlock.h"
29
30#define LIFE_THREAD 0xBAB1F00D
31#define DEAD_THREAD 0xDEADBEEF
32#define EXCEPTION_SET_THREAD_NAME ((DWORD) 0x406D1388)
33
34typedef struct _pthread_v _pthread_v;
35struct _pthread_v
36{
37 unsigned int valid;
38 void *ret_arg;
39 void *(* func)(void *);
40 _pthread_cleanup *clean;
41 int nobreak;
42 HANDLE h;
43 HANDLE evStart;
44 pthread_mutex_t p_clock;
45 int cancelled : 2;
46 int in_cancel : 2;
47 int thread_noposix : 2;
48 unsigned int p_state;
49 unsigned int keymax;
50 void **keyval;
51 unsigned char *keyval_set;
52 char *thread_name;
53 pthread_spinlock_t spin_keys;
54 DWORD tid;
55 int rwlc;
56 pthread_rwlock_t rwlq[RWLS_PER_THREAD];
57 int sched_pol;
58 int ended;
59 struct sched_param sched;
60 jmp_buf jb;
61 struct _pthread_v *next;
62 pthread_t x; /* Internal posix handle. */
63};
64
65typedef struct __pthread_idlist {
66 struct _pthread_v *ptr;
67 pthread_t id;
68} __pthread_idlist;
69
70int _pthread_tryjoin(pthread_t t, void **res);
71void _pthread_setnobreak(int);
72#ifdef WINPTHREAD_DBG
73void thread_print_set(int state);
74void thread_print(volatile pthread_t t, char *txt);
75#endif
76int __pthread_shallcancel(void);
77struct _pthread_v *WINPTHREAD_API __pth_gpointer_locked (pthread_t id);
78
79#endif
lib/libc/mingw/winpthreads/winpthread_internal.h created+27
......@@ -0,0 +1,27 @@
1/*
2 Copyright (c) 2011-2016 mingw-w64 project
3
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the "Software"),
6 to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 DEALINGS IN THE SOFTWARE.
21*/
22
23#ifndef WINPTHREAD_INTERNAL_H
24#define WINPTHREAD_INTERNAL_H
25WINPTHREAD_API struct _pthread_v * __pth_gpointer_locked (pthread_t id);
26int pthread_delay_np_ms (DWORD to);
27#endif /*WINPTHREAD_INTERNAL_H*/
lib/libc/mingw/winpthreads/wpth_ver.h created+29
......@@ -0,0 +1,29 @@
1/*
2 Copyright (c) 2011-2016 mingw-w64 project
3
4 Permission is hereby granted, free of charge, to any person obtaining a
5 copy of this software and associated documentation files (the "Software"),
6 to deal in the Software without restriction, including without limitation
7 the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 and/or sell copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 DEALINGS IN THE SOFTWARE.
21*/
22
23#ifndef __WPTHREADS_VERSION__
24#define __WPTHREADS_VERSION__
25
26#define WPTH_VERSION 1,0,0,0
27#define WPTH_VERSION_STRING "1, 0, 0, 0\0"
28
29#endif