Skip to content

Commit 6671442

Browse files
committed
mingw: Update MinGW-w64 definitions to 38c8142f660b6ba11e7c408f2de1e9f8bfaf839e.
1 parent 4d79806 commit 6671442

18 files changed

+647
-2662
lines changed

lib/libc/mingw/def-include/crt-aliases.def.in

Lines changed: 56 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,11 @@ ADD_UNDERSCORE(spawnve)
137137
ADD_UNDERSCORE(spawnvp)
138138
ADD_UNDERSCORE(spawnvpe)
139139
#endif
140-
#ifndef CRTDLL
141-
; stat is provided by mingw to workaround trailing slash issue in _stat
140+
#ifdef UCRTBASE
141+
F32(stat == _stat32)
142+
F64(stat == _stat64i32)
143+
#else
144+
; stat for non-UCRT is provided by mingw to workaround trailing slash issue in _stat
142145
#endif
143146
#ifdef NO_STRCMPI_ALIAS
144147
; Symbol _strcmpi is natively present and defined in the library def file
@@ -208,7 +211,11 @@ ADD_UNDERSCORE(write)
208211
; This is list of symbol aliases added in the Visual C++ 2.0 oldnames.lib library
209212
; All these symbols with leading underscore are present also in pre-2.0 CRT versions: crtdll.dll and msvcrt10.dll
210213
; ADD_UNDERSCORE(control87)
214+
#if __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__
215+
ADD_UNDERSCORE(fpreset)
216+
#else
211217
; ADD_UNDERSCORE(fpreset) ; Alias fpreset is set in CRT_fp10.c and CRT_fp8.c
218+
#endif
212219
ADD_UNDERSCORE(wcsdup)
213220
ADD_UNDERSCORE(wcsicmp)
214221
ADD_UNDERSCORE(wcsicoll)
@@ -222,7 +229,11 @@ ADD_UNDERSCORE(wcsupr)
222229
; This is list of symbol aliases added in the Visual C++ 4.0 oldnames.lib library
223230
; All these symbols with leading underscore are present also in pre-4.0 CRT versions: crtdll.dll, msvcrt10.dll and msvcrt20.dll
224231
; ADD_UNDERSCORE(cabs)
232+
#ifdef UCRTBASE
233+
; hypot is natively exported from UCRT
234+
#else
225235
ADD_UNDERSCORE(hypot)
236+
#endif
226237
ADD_UNDERSCORE(j0)
227238
ADD_UNDERSCORE(j1)
228239
ADD_UNDERSCORE(jn)
@@ -247,27 +258,26 @@ wcstok == wcstok_s
247258
ADD_UNDERSCORE(nextafter)
248259
#endif
249260

250-
#if defined(DEF_ARM32) || defined(DEF_ARM64)
251261
; This is list of symbol aliases for C99 ARM long double functions
252262
; They are defined as aliases to regular double symbols as on ARM, long double is equal to regular double
253-
acosl == acos
254-
asinl == asin
255-
atan2l == atan2
256-
atanl == atan
257-
ceill == ceil
258-
cosl == cos
259-
expl == exp
260-
floorl == floor
261-
fmodl == fmod
262-
log10l == log10
263-
logl == log
263+
F_LD64(acosl == acos)
264+
F_LD64(asinl == asin)
265+
F_LD64(atan2l == atan2)
266+
F_LD64(atanl == atan)
267+
F_LD64(ceill == ceil)
268+
F_LD64(cosl == cos)
269+
F_LD64(expl == exp)
270+
F_LD64(floorl == floor)
271+
F_LD64(fmodl == fmod)
272+
F_LD64(log10l == log10)
273+
F_LD64(logl == log)
264274
; FIXME: Why is powl alias defined only for UCRT?
265275
#ifdef UCRTBASE
266-
powl == pow
267-
#endif
268-
sinl == sin
269-
tanl == tan
276+
F_LD64(powl == pow)
270277
#endif
278+
F_LD64(sinl == sin)
279+
F_LD64(tanl == tan)
280+
F_LD64(_chgsignl == _chgsign)
271281

272282
; This is list of symbol aliases for C11 functions
273283
#ifdef UCRTBASE
@@ -290,6 +300,22 @@ ADD_UNDERSCORE(popen)
290300
fgetpos64 == fgetpos
291301
fsetpos64 == fsetpos
292302
#endif
303+
#ifdef UCRTBASE
304+
stat32 == _stat32
305+
stat32i64 == _stat32i64
306+
stat64 == _stat64
307+
stat64i32 == _stat64i32
308+
#else
309+
; stat for non-UCRT is provided by mingw to workaround trailing slash issue in _stat
310+
#endif
311+
#ifdef FIXED_SIZE_SYMBOLS
312+
// NO_FIXED_SIZE_64_ALIAS means that DLL provides the native _fstat64 symbol
313+
#if defined(NO_FIXED_SIZE_64_ALIAS) && !defined(NO_FSTAT64_ALIAS)
314+
fstat64 == _fstat64
315+
#endif
316+
#else
317+
fstat64 == _fstat64
318+
#endif
293319

294320
; This is list of symbol aliases for GNU functions which are not part of POSIX or ISO C
295321
strcasecmp == _stricmp
@@ -545,19 +571,23 @@ __ms_vsprintf == vsprintf
545571
__ms_vwprintf == vwprintf
546572
__ms_wprintf == wprintf
547573
__ms_wscanf == wscanf
548-
#ifdef WITH_MS_VSCANF_ALIASES
549-
__ms_vfscanf == vfscanf
550-
__ms_vfwscanf == vfwscanf
551-
__ms_vscanf == vscanf
552-
__ms_vsscanf == vsscanf
553-
__ms_vswscanf == vswscanf
554-
__ms_vwscanf == vwscanf
555-
#endif
556574
#endif
557575

558576
; This is list of additional symbol aliases not available in any library as neither native symbols nor aliases
559577
; FIXME: check if these really are needed
560578

579+
; This is wstat and wstat64 symbol available only in mingw but for a long time
580+
#ifdef UCRTBASE
581+
F32(wstat == _wstat32)
582+
F64(wstat == _wstat64i32)
583+
wstat32 == _wstat32
584+
wstat32i64 == _wstat32i64
585+
wstat64 == _wstat64
586+
wstat64i32 == _wstat64i32
587+
#else
588+
; wstat for non-UCRT is provided by mingw to workaround trailing slash issue in _wstat
589+
#endif
590+
561591
; Origin of the symbol wcscmpi is unknown. This symbol is not present in
562592
; crtdll.dll and neither in any msvcr* version. The only source of wcscmpi is
563593
; wcstr.h header file from the Microsoft Visual C++ 1.0 (32-bit for NT) and

lib/libc/mingw/def-include/func.def.in

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,26 @@
1212
// F_NON_I386 - function available on everything but i386
1313
// F_NON_X64 - function available on everything but x86_64
1414
// F_NON_ARM64 - function available on everything but arm64
15-
#if defined(DEF_X64)
15+
#if defined(__x86_64__)
1616
#define F64(x) x
1717
#define F_X64(x) x
1818
#define F_X86_ANY(x) x
1919
#define F_NON_I386(x) x
2020
#define F_NON_ARM64(x) x
21-
#elif defined(DEF_I386)
21+
#elif defined(__i386__)
2222
#define F32(x) x
2323
#define F_I386(x) x
2424
#define F_X86_ANY(x) x
2525
#define F_NON_X64(x) x
2626
#define F_NON_ARM64(x) x
27-
#elif defined(DEF_ARM32)
27+
#elif defined(__arm__)
2828
#define F32(x) x
2929
#define F_ARM32(x) x
3030
#define F_ARM_ANY(x) x
3131
#define F_NON_I386(x) x
3232
#define F_NON_X64(x) x
3333
#define F_NON_ARM64(x) x
34-
#elif defined(DEF_ARM64)
34+
#elif defined(__aarch64__)
3535
#define F64(x) x
3636
#define F_ARM64(x) x
3737
#define F_ARM_ANY(x) x
@@ -75,9 +75,17 @@
7575
#define F_NON_ARM64(x)
7676
#endif
7777

78-
#if defined(DEF_I386)
78+
#if defined(__i386__)
7979
#define STDCALL_DECORATED_EXPORT(symbol) symbol == _ ## symbol
8080
#define FASTCALL_DECORATED_EXPORT(symbol) symbol == symbol
8181
#endif
8282

83+
#if __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__
84+
#define F_LD64(x) x
85+
#define F_LD80(x)
86+
#else
87+
#define F_LD64(x)
88+
#define F_LD80(x) x
89+
#endif
90+
8391
#endif // FUNC_DEF_IN

lib/libc/mingw/lib-common/api-ms-win-crt-convert-l1-1-0.def.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ _strtoi64
4747
_strtoi64_l
4848
_strtoimax_l
4949
_strtol_l
50-
F_ARM_ANY(_strtold_l) ; Can't use long double functions from the CRT on x86
50+
F_LD64(_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-
F_ARM_ANY(_wcstold_l) ; Can't use long double functions from the CRT on x86
71+
F_LD64(_wcstold_l) ; Can't use long double functions from the CRT on x86
7272
_wcstoll_l
7373
_wcstombs_l
7474
_wcstombs_s_l
@@ -108,7 +108,7 @@ strtod
108108
strtof
109109
strtoimax
110110
strtol
111-
F_ARM_ANY(strtold) ; Can't use long double functions from the CRT on x86
111+
F_LD64(strtold) ; Can't use long double functions from the CRT on x86
112112
strtoll
113113
strtoul
114114
strtoull
@@ -121,7 +121,7 @@ wcstod
121121
wcstof
122122
wcstoimax
123123
wcstol
124-
F_ARM_ANY(wcstold) ; Can't use long double functions from the CRT on x86
124+
F_LD64(wcstold) ; Can't use long double functions from the CRT on x86
125125
wcstoll
126126
wcstombs
127127
wcstombs_s

lib/libc/mingw/lib-common/api-ms-win-crt-filesystem-l1-1-0.def.in

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ F64(_fstati64 == _fstat64)
3939
_fstat32
4040
_fstat32i64
4141
_fstat64
42+
fstat64 == _fstat64
4243
_fstat64i32
4344
_fullpath
4445
_getdiskfree
@@ -53,14 +54,20 @@ _rmdir
5354
rmdir == _rmdir
5455
_splitpath
5556
_splitpath_s
57+
F32(stat == _stat32)
58+
F64(stat == _stat64i32)
5659
F32(_stat == _stat32)
5760
F64(_stat == _stat64i32)
5861
F32(_stati64 == _stat32i64)
5962
F64(_stati64 == _stat64)
6063
_stat32
64+
stat32 == _stat32
6165
_stat32i64
66+
stat32i64 == _stat32i64
6267
_stat64
68+
stat64 == _stat64
6369
_stat64i32
70+
stat64i32 == _stat64i32
6471
_umask
6572
umask == _umask
6673
_umask_s
@@ -96,14 +103,20 @@ _wrename
96103
_wrmdir
97104
_wsplitpath
98105
_wsplitpath_s
106+
F32(wstat == _wstat32)
107+
F64(wstat == _wstat64i32)
99108
F32(_wstat == _wstat32)
100109
F64(_wstat == _wstat64i32)
101110
F32(_wstati64 == _wstat32i64)
102111
F64(_wstati64 == _wstat64)
103112
_wstat32
113+
wstat32 == _wstat32
104114
_wstat32i64
115+
wstat32i64 == _wstat32i64
105116
_wstat64
117+
wstat64 == _wstat64
106118
_wstat64i32
119+
wstat64i32 == _wstat64i32
107120
_wunlink
108121
remove
109122
rename

0 commit comments

Comments
 (0)