authorgravatar for ypsvlq@gmail.comElaine Gibson <ypsvlq@gmail.com> 2024-01-16 22:23:57+00:00
committergravatar for ypsvlq@gmail.comElaine Gibson <ypsvlq@gmail.com> 2024-01-20 00:21:34+00:00
logb1269785557074ce249666ff922a47ae1d384769
tree40b7cac57206170fba51e358a3cbff84d2dec41e
parentbbecbaab0a3fd6b66bf45f720b9cb1471ea193c4

mingw-w64: remove msvcrt sources


198 files changed, 3 insertions(+), 11368 deletions(-)

lib/libc/mingw/lib-common/msvcrt.def.in deleted-1628
...@@ -1,1628 +0,0 @@
1LIBRARY "msvcrt.dll"
2EXPORTS
3
4#include "func.def.in"
5#include "msvcrt-common.def.in"
6
7#ifdef DEF_I386
8_CIacos
9_CIasin
10_CIatan
11_CIatan2
12_CIcos
13_CIcosh
14_CIexp
15_CIfmod
16_CIlog
17_CIlog10
18_CIpow
19_CIsin
20_CIsinh
21_CIsqrt
22_CItan
23_CItanh
24#endif
25
26#ifdef DEF_X64
27$I10_OUTPUT
28; public: __cdecl __non_rtti_object::__non_rtti_object(class __non_rtti_object const & __ptr64) __ptr64
29; GCC = __ZN17__non_rtti_objectC2ERKS_
30??0__non_rtti_object@@QEAA@AEBV0@@Z
31; public: __cdecl __non_rtti_object::__non_rtti_object(char const * __ptr64) __ptr64
32; GCC = __ZN17__non_rtti_objectC1ERKS_
33??0__non_rtti_object@@QEAA@PEBD@Z
34; private: __cdecl bad_cast::bad_cast(char const * __ptr64 const * __ptr64) __ptr64
35??0bad_cast@@AEAA@PEBQEBD@Z
36; public: __cdecl bad_cast::bad_cast(char const * __ptr64 const & __ptr64) __ptr64
37??0bad_cast@@QEAA@AEBQEBD@Z
38; public: __cdecl bad_cast::bad_cast(class bad_cast const & __ptr64) __ptr64
39??0bad_cast@@QEAA@AEBV0@@Z
40; public: __cdecl bad_cast::bad_cast(char const * __ptr64) __ptr64
41??0bad_cast@@QEAA@PEBD@Z
42; public: __cdecl bad_typeid::bad_typeid(class bad_typeid const & __ptr64) __ptr64
43??0bad_typeid@@QEAA@AEBV0@@Z
44; public: __cdecl bad_typeid::bad_typeid(char const * __ptr64) __ptr64
45??0bad_typeid@@QEAA@PEBD@Z
46; public: __cdecl exception::exception(char const * __ptr64 const & __ptr64) __ptr64
47??0exception@@QEAA@AEBQEBD@Z
48; public: __cdecl exception::exception(char const * __ptr64 const & __ptr64,int) __ptr64
49??0exception@@QEAA@AEBQEBDH@Z
50; public: __cdecl exception::exception(class exception const & __ptr64) __ptr64
51??0exception@@QEAA@AEBV0@@Z
52; public: __cdecl exception::exception(void) __ptr64
53??0exception@@QEAA@XZ
54; public: virtual __cdecl __non_rtti_object::~__non_rtti_object(void) __ptr64
55??1__non_rtti_object@@UEAA@XZ
56; public: virtual __cdecl bad_cast::~bad_cast(void) __ptr64
57??1bad_cast@@UEAA@XZ
58; public: virtual __cdecl bad_typeid::~bad_typeid(void) __ptr64
59??1bad_typeid@@UEAA@XZ
60; public: virtual __cdecl exception::~exception(void) __ptr64
61??1exception@@UEAA@XZ
62; public: virtual __cdecl type_info::~type_info(void) __ptr64
63??1type_info@@UEAA@XZ
64; void * __ptr64 __cdecl operator new(unsigned __int64)
65; GCC = __Znwy
66??2@YAPEAX_K@Z
67; void __cdecl operator delete(void * __ptr64)
68; GCC = __ZdlPv
69??3@YAXPEAX@Z
70; public: class __non_rtti_object & __ptr64 __cdecl __non_rtti_object::operator=(class __non_rtti_object const & __ptr64) __ptr64
71??4__non_rtti_object@@QEAAAEAV0@AEBV0@@Z
72; public: class bad_cast & __ptr64 __cdecl bad_cast::operator=(class bad_cast const & __ptr64) __ptr64
73??4bad_cast@@QEAAAEAV0@AEBV0@@Z
74; public: class bad_typeid & __ptr64 __cdecl bad_typeid::operator=(class bad_typeid const & __ptr64) __ptr64
75??4bad_typeid@@QEAAAEAV0@AEBV0@@Z
76; public: class exception & __ptr64 __cdecl exception::operator=(class exception const & __ptr64) __ptr64
77??4exception@@QEAAAEAV0@AEBV0@@Z
78; public: int __cdecl type_info::operator==(class type_info const & __ptr64)const __ptr64
79??8type_info@@QEBAHAEBV0@@Z
80; public: int __cdecl type_info::operator!=(class type_info const & __ptr64)const __ptr64
81??9type_info@@QEBAHAEBV0@@Z
82; const __non_rtti_object::`vftable'
83??_7__non_rtti_object@@6B@
84; const bad_cast::`vftable'
85??_7bad_cast@@6B@
86; const bad_typeid::`vftable'
87??_7bad_typeid@@6B@
88; const exception::`vftable'
89??_7exception@@6B@
90; public: void __cdecl bad_cast::`default constructor closure'(void) __ptr64
91??_Fbad_cast@@QEAAXXZ
92; public: void __cdecl bad_typeid::`default constructor closure'(void) __ptr64
93??_Fbad_typeid@@QEAAXXZ
94; void * __ptr64 __cdecl operator new[](unsigned __int64)
95; GNU = __Znay
96??_U@YAPEAX_K@Z
97; void __cdecl operator delete[](void * __ptr64)
98; GNU = __ZdaPv
99??_V@YAXPEAX@Z
100; int (__cdecl*__cdecl _query_new_handler(void))(unsigned __int64)
101; GNU = __Z18_query_new_handlerv
102?_query_new_handler@@YAP6AH_K@ZXZ
103; int __cdecl _query_new_mode(void)
104; GNU = __Z15_query_new_modev
105?_query_new_mode@@YAHXZ
106; int (__cdecl*__cdecl _set_new_handler(int (__cdecl*)(unsigned __int64)))(unsigned __int64)
107; GNU = __Z16_set_new_handlerPFiyE
108?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z
109; int __cdecl _set_new_mode(int)
110; GNU = __Z13_set_new_modei
111?_set_new_mode@@YAHH@Z
112; void (__cdecl*__cdecl _set_se_translator(void (__cdecl*)(unsigned int,struct _EXCEPTION_POINTERS * __ptr64)))(unsigned int,struct _EXCEPTION_POINTERS * __ptr64)
113; GNU = __Z18_set_se_translatorPFvjP19_EXCEPTION_POINTERSE
114?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z
115; public: int __cdecl type_info::before(class type_info const & __ptr64)const __ptr64
116?before@type_info@@QEBAHAEBV1@@Z
117; public: char const * __ptr64 __cdecl type_info::name(void)const __ptr64
118?name@type_info@@QEBAPEBDXZ
119; public: char const * __ptr64 __cdecl type_info::raw_name(void)const __ptr64
120?raw_name@type_info@@QEBAPEBDXZ
121; void (__cdecl*__cdecl set_new_handler(void (__cdecl*)(void)))(void)
122; GNU = __Z15set_new_handlerPFvvE
123?set_new_handler@@YAP6AXXZP6AXXZ@Z
124; void (__cdecl*__cdecl set_terminate(void (__cdecl*)(void)))(void)
125; GNU = __Z13set_terminatePFvvE
126?set_terminate@@YAP6AXXZP6AXXZ@Z
127; void (__cdecl*__cdecl set_unexpected(void (__cdecl*)(void)))(void)
128; GNU = __Z14set_unexpectedPFvvE
129?set_unexpected@@YAP6AXXZP6AXXZ@Z
130; void __cdecl terminate(void)
131; GNU = __Z9terminatev
132?terminate@@YAXXZ
133; void __cdecl unexpected(void)
134; GNU = __Z10unexpectedv
135?unexpected@@YAXXZ
136; public: virtual char const * __ptr64 __cdecl exception::what(void)const __ptr64
137?what@exception@@UEBAPEBDXZ
138#endif
139
140#ifdef DEF_ARM32
141??0__non_rtti_object@@QAA@ABV0@@Z
142??0__non_rtti_object@@QAA@PBD@Z
143??0bad_cast@@AAA@PBQBD@Z
144??0bad_cast@@QAA@ABV0@@Z
145??0bad_cast@@QAA@PBD@Z
146??0bad_typeid@@QAA@ABV0@@Z
147??0bad_typeid@@QAA@PBD@Z
148??0exception@@QAA@ABQBD@Z
149??0exception@@QAA@ABQBDH@Z
150??0exception@@QAA@ABV0@@Z
151??0exception@@QAA@XZ
152??1__non_rtti_object@@UAA@XZ
153??1bad_cast@@UAA@XZ
154??1bad_typeid@@UAA@XZ
155??1exception@@UAA@XZ
156??1type_info@@UAA@XZ
157??2@YAPAXI@Z
158??2@YAPAXIHPBDH@Z
159??3@YAXPAX@Z
160??4__non_rtti_object@@QAAAAV0@ABV0@@Z
161??4bad_cast@@QAAAAV0@ABV0@@Z
162??4bad_typeid@@QAAAAV0@ABV0@@Z
163??4exception@@QAAAAV0@ABV0@@Z
164??8type_info@@QBAHABV0@@Z
165??9type_info@@QBAHABV0@@Z
166??_7__non_rtti_object@@6B@ DATA
167??_7bad_cast@@6B@ DATA
168??_7bad_typeid@@6B@ DATA
169??_7exception@@6B@ DATA
170??_Fbad_cast@@QAAXXZ
171??_Fbad_typeid@@QAAXXZ
172??_U@YAPAXI@Z
173??_U@YAPAXIHPBDH@Z
174??_V@YAXPAX@Z
175_CallMemberFunction0
176_CallMemberFunction1
177_CallMemberFunction2
178__ExceptionPtrAssign
179__ExceptionPtrCompare
180__ExceptionPtrCopy
181__ExceptionPtrCopyException
182__ExceptionPtrCreate
183__ExceptionPtrCurrentException
184__ExceptionPtrDestroy
185__ExceptionPtrRethrow
186__ExceptionPtrSwap
187__ExceptionPtrToBool
188?_query_new_handler@@YAP6AHI@ZXZ
189?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z
190?_set_new_mode@@YAHH@Z
191?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z
192?before@type_info@@QBAHABV1@@Z
193?name@type_info@@QBAPBDXZ
194?raw_name@type_info@@QBAPBDXZ
195?set_terminate@@YAP6AXXZP6AXXZ@Z
196?set_unexpected@@YAP6AXXZP6AXXZ@Z
197?terminate@@YAXXZ
198?unexpected@@YAXXZ
199?what@exception@@UBAPBDXZ
200#endif
201
202#ifdef DEF_ARM32
203_CrtCheckMemory
204_CrtDbgBreak
205_CrtDbgReport
206_CrtDbgReportV
207_CrtDbgReportW
208_CrtDbgReportWV
209_CrtDoForAllClientObjects
210_CrtDumpMemoryLeaks
211_CrtIsMemoryBlock
212_CrtIsValidHeapPointer
213_CrtIsValidPointer
214_CrtMemCheckpoint
215_CrtMemDifference
216_CrtMemDumpAllObjectsSince
217_CrtMemDumpStatistics
218_CrtReportBlockType
219_CrtSetAllocHook
220_CrtSetBreakAlloc
221_CrtSetDbgBlockType
222_CrtSetDbgFlag
223_CrtSetDumpClient
224_CrtSetReportFile
225_CrtSetReportHook
226_CrtSetReportHook2
227_CrtSetReportMode
228#endif
229F_I386(_CxxThrowException@8)
230F_NON_I386(_CxxThrowException)
231F_I386(_EH_prolog)
232_Getdays
233_Getmonths
234_Gettnames
235_HUGE DATA
236_Strftime
237F_ARM_ANY(_W_Getdays)
238F_ARM_ANY(_W_Getmonths)
239F_ARM_ANY(_W_Gettnames)
240F_ARM_ANY(_Wcsftime)
241_XcptFilter
242F_ARM_ANY(__AdjustPointer)
243F_NON_I386(__C_specific_handler)
244__CppXcptFilter
245F_I386(__CxxCallUnwindDtor)
246F_I386(__CxxCallUnwindVecDtor)
247F_I386(__CxxDetectRethrow)
248F_I386(__CxxExceptionFilter)
249F_X86_ANY(__CxxFrameHandler)
250F_ARM_ANY(__CxxFrameHandler3)
251F_I386(__CxxLongjmpUnwind)
252F_I386(__CxxQueryExceptionSize)
253F_I386(__CxxRegisterExceptionObject)
254F_I386(__CxxUnregisterExceptionObject)
255__DestructExceptionObject
256__RTCastToVoid
257__RTDynamicCast
258__RTtypeid
259__STRINGTOLD
260F_NON_I386(___lc_codepage_func)
261___lc_collate_cp_func
262___lc_handle_func
263; ___mb_cur_max_func exists (on all archs) since XP. Earlier, this function
264; was never used, but the __mb_cur_max data symbol was accessed instead.
265; For i386 we provide this function as a statically linked helper, that uses
266; __mb_cur_max, to avoid forcing a dependency on XP here.
267F_NON_I386(___mb_cur_max_func)
268F_X86_ANY(___setlc_active_func)
269F_X86_ANY(___unguarded_readlc_active_add_func)
270__argc DATA
271__argv DATA
272__badioinfo DATA
273F_I386(__buffer_overrun)
274__crtCompareStringA
275__crtCompareStringW
276__crtGetLocaleInfoW
277__crtGetStringTypeW
278__crtLCMapStringA
279__crtLCMapStringW
280F_ARM_ANY(__daylight)
281__dllonexit
282__doserrno
283F_ARM_ANY(__dstbias)
284__fpecode
285__getmainargs
286F_X86_ANY(__initenv DATA)
287__iob_func
288__isascii
289__iscsym
290__iscsymf
291F_I386(__lc_clike)
292F_X86_ANY(__lc_codepage DATA)
293F_X86_ANY(__lc_collate_cp DATA)
294__lc_handle DATA
295__lconv_init
296__mb_cur_max DATA
297#ifdef DEF_I386
298__p___argc
299__p___argv
300__p___initenv
301__p___mb_cur_max
302__p___wargv
303__p___winitenv
304__p__acmdln
305__p__amblksiz
306__p__commode
307__p__daylight
308__p__dstbias
309__p__environ
310__p__fileinfo
311__p__fmode
312__p__iob
313__p__mbcasemap
314__p__mbctype
315__p__osver
316__p__pctype
317__p__pgmptr
318__p__pwctype
319__p__timezone
320__p__tzname
321__p__wcmdln
322__p__wenviron
323__p__winmajor
324__p__winminor
325__p__winver
326__p__wpgmptr
327#endif
328__pctype_func
329__pioinfo DATA
330__pwctype_func
331__pxcptinfoptrs
332F_I386(__security_error_handler)
333__set_app_type
334F_I386(__set_buffer_overrun_handler)
335F_X86_ANY(__setlc_active DATA)
336__setusermatherr
337F_ARM_ANY(__strncnt)
338F_X86_ANY(__threadhandle)
339F_X86_ANY(__threadid)
340__toascii
341__uncaught_exception
342__unDName
343__unDNameEx
344F_X86_ANY(__unguarded_readlc_active DATA)
345__wargv DATA
346__wcserror
347F_NON_I386(__wcserror_s)
348F_ARM_ANY(__wcsncnt)
349__wgetmainargs
350F_X86_ANY(__winitenv DATA)
351F_I386(_abnormal_termination)
352F_NON_I386(_abs64)
353F_NON_I386(llabs == _abs64)
354F_NON_I386(imaxabs == _abs64)
355_access
356; _access_s Replaced by emu
357_acmdln DATA
358#ifdef DEF_I386
359_adj_fdiv_m16i
360_adj_fdiv_m32
361_adj_fdiv_m32i
362_adj_fdiv_m64
363_adj_fdiv_r
364_adj_fdivr_m16i
365_adj_fdivr_m32
366_adj_fdivr_m32i
367_adj_fdivr_m64
368_adj_fpatan
369_adj_fprem
370_adj_fprem1
371_adj_fptan
372_adjust_fdiv DATA
373#endif
374_aexit_rtn DATA
375_aligned_free
376F_ARM_ANY(_aligned_free_dbg)
377_aligned_malloc
378F_ARM_ANY(_aligned_malloc_dbg)
379_aligned_offset_malloc
380F_ARM_ANY(_aligned_offset_malloc_dbg)
381_aligned_offset_realloc
382F_ARM_ANY(_aligned_offset_realloc_dbg)
383_aligned_realloc
384F_ARM_ANY(_aligned_realloc_dbg)
385_amsg_exit
386_assert
387_atodbl
388_atodbl_l
389_atof_l
390_atoflt_l
391_atoi64
392atoll == _atoi64
393_atoi64_l
394_atoll_l == _atoi64_l
395_atoi_l
396_atol_l
397_atoldbl
398F_NON_I386(_atoldbl_l)
399F_X86_ANY(_beep)
400_beginthread
401_beginthreadex
402_c_exit
403_cabs DATA
404_callnewh
405F_ARM_ANY(_calloc_dbg)
406_cexit
407_cgets
408; _cgets_s replaced by emu
409_cgetws
410; _cgetws_s replaced by emu
411_chdir
412_chdrive
413_chgsign
414F_NON_I386(_chgsignf)
415_chmod
416F_I386(_chkesp)
417_chsize
418; _chsize_s replaced by emu
419F_ARM_ANY(_chvalidator)
420F_ARM_ANY(_chvalidator_l)
421_clearfp
422_close
423_commit
424_commode DATA
425_control87
426_controlfp
427; _controlfp_s replaced by emu
428_copysign
429F_NON_I386(_copysignf)
430_cprintf
431_cprintf_l
432_cprintf_p
433_cprintf_p_l
434; _cprintf_s Replaced by emu
435; _cprintf_s_l likewise.
436_cputs
437_cputws
438F_I386(_CRT_RTC_INIT)
439_creat
440F_ARM_ANY(_create_locale)
441F_ARM32(_crtAssertBusy)
442F_ARM32(_crtBreakAlloc)
443F_ARM32(_crtDbgFlag)
444_cscanf
445_cscanf_l
446_cscanf_s
447_cscanf_s_l
448F_ARM_ANY(_ctime32)
449F_I386(_ctime32 == ctime)
450; _ctime32_s replaced by emu
451_ctime64
452; _ctime64_s replaced by emu
453_ctype F_I386(DATA)
454_cwait
455_cwprintf
456_cwprintf_l
457_cwprintf_p
458_cwprintf_p_l
459; _cwprintf_s Replaced by emu
460; _cwprintf_s_l Likewise.
461_cwscanf
462_cwscanf_l
463_cwscanf_s
464_cwscanf_s_l
465F_X86_ANY(_dstbias DATA)
466_daylight DATA
467_difftime32 F_I386(== difftime)
468_difftime64
469_dup
470_dup2
471_ecvt
472_ecvt_s
473_endthread
474_endthreadex
475F_X86_ANY(_environ DATA)
476_eof
477_errno
478F_I386(_except_handler2)
479F_I386(_except_handler3)
480_execl
481_execle
482_execlp
483_execlpe
484_execv
485_execve
486_execvp
487_execvpe
488_exit
489_expand
490F_ARM_ANY(_expand_dbg)
491_fcloseall
492_fcvt
493_fcvt_s
494_fdopen
495_fgetchar
496_fgetwchar
497_filbuf
498F_X86_ANY(_fileinfo DATA)
499_filelength
500_filelengthi64
501_fileno
502_findclose
503_findfirst
504F32(_findfirst32 == _findfirst)
505_findfirst64
506_findfirsti64
507F32(_findfirst32i64 == _findfirsti64)
508F64(_findfirst64i32 == _findfirst)
509_findnext
510F32(_findnext32 == _findnext)
511_findnext64
512_findnexti64
513F32(_findnext32i64 == _findnexti64)
514F64(_findnext64i32 == _findnext)
515_finite
516F_NON_I386(_finitef)
517_flsbuf
518_flushall
519_fmode DATA
520_fpclass
521F_X64(_fpclassf)
522F_I386(_fpieee_flt)
523F_ARM_ANY(_fpieee_flt)
524_fpreset DATA
525_fprintf_l
526_fprintf_p
527_fprintf_p_l
528_fprintf_s_l
529_fputchar
530_fputwchar
531F_ARM_ANY(_free_dbg)
532F_ARM_ANY(_free_locale)
533F_ARM_ANY(_freea)
534F_NON_I386(_fscanf_l)
535F_NON_I386(_fscanf_s_l)
536F_ARM_ANY(_fseeki64)
537_fsopen
538_fstat
539F32(_fstat32 == _fstat)
540_fstat64
541_fstati64
542F64(_fstat64i32 == _fstat)
543_ftime
544F_I386(_ftime32 == _ftime)
545F_NON_I386(_ftime32)
546_ftime32_s
547_ftime64
548_ftime64_s
549F32(_ftime_s == _ftime32_s)
550F64(_ftime_s == _ftime64_s)
551F_I386(_ftol)
552_fullpath
553F_ARM_ANY(_fullpath_dbg)
554_futime
555F_I386(_futime32 == _futime)
556F_NON_I386(_futime32)
557_futime64
558_fwprintf_l
559_fwprintf_p
560_fwprintf_p_l
561_fwprintf_s_l
562_fwscanf_l
563_fwscanf_s_l
564_gcvt
565_gcvt_s
566F_ARM_ANY(_get_current_locale)
567_get_doserrno
568F_ARM_ANY(_get_environ)
569F_ARM_ANY(_get_errno)
570F_ARM_ANY(_get_fileinfo)
571F_ARM_ANY(_get_fmode)
572F_X86_ANY(_get_heap_handle)
573_get_osfhandle
574;_get_output_format provided by emu
575F_X86_ANY(_get_sbh_threshold)
576F_ARM_ANY(_get_wenviron)
577_getch
578_getche
579_getcwd
580_getdcwd
581_getdiskfree
582_getdllprocaddr
583_getdrive
584F_X86_ANY(_getdrives)
585_getmaxstdio
586_getmbcp
587F_X86_ANY(_getpid)
588F_X86_ANY(_getsystime)
589_getw
590_getwch
591_getwche
592F_X86_ANY(_getws)
593F_I386(_global_unwind2)
594_gmtime32 F_I386(== gmtime)
595; _gmtime32_s replaced by emu
596_gmtime64
597; _gmtime64_s replaced by emu
598F_X86_ANY(_heapadd)
599_heapchk
600_heapmin
601F_X86_ANY(_heapset)
602F_X86_ANY(_heapused)
603_heapwalk
604_hypot
605F_NON_I386(_hypotf)
606_i64toa
607_i64toa_s
608_i64tow
609_i64tow_s
610_initterm
611F_ARM_ANY(_initterm_e)
612F_I386(_inp)
613F_I386(_inpd)
614F_I386(_inpw)
615F_ARM_ANY(_invalid_parameter)
616_iob DATA
617_isalnum_l
618_isalpha_l
619_isatty
620_iscntrl_l
621_isctype
622_isctype_l
623_isdigit_l
624_isgraph_l
625_isleadbyte_l
626_islower_l
627_ismbbalnum
628_ismbbalnum_l
629_ismbbalpha
630_ismbbalpha_l
631_ismbbgraph
632_ismbbgraph_l
633_ismbbkalnum
634_ismbbkalnum_l
635_ismbbkana
636_ismbbkana_l
637_ismbbkprint
638_ismbbkprint_l
639_ismbbkpunct
640_ismbbkpunct_l
641_ismbblead
642_ismbblead_l
643_ismbbprint
644_ismbbprint_l
645_ismbbpunct
646_ismbbpunct_l
647_ismbbtrail
648_ismbbtrail_l
649_ismbcalnum
650_ismbcalnum_l
651_ismbcalpha
652_ismbcalpha_l
653_ismbcdigit
654_ismbcdigit_l
655_ismbcgraph
656_ismbcgraph_l
657_ismbchira
658_ismbchira_l
659_ismbckata
660_ismbckata_l
661_ismbcl0
662_ismbcl0_l
663_ismbcl1
664_ismbcl1_l
665_ismbcl2
666_ismbcl2_l
667_ismbclegal
668_ismbclegal_l
669_ismbclower
670_ismbclower_l
671_ismbcprint
672_ismbcprint_l
673_ismbcpunct
674_ismbcpunct_l
675_ismbcspace
676_ismbcspace_l
677_ismbcsymbol
678_ismbcsymbol_l
679_ismbcupper
680_ismbcupper_l
681_ismbslead
682_ismbslead_l
683_ismbstrail
684_ismbstrail_l
685_isnan
686F_X64(_isnanf)
687_isprint_l
688_isspace_l
689_isupper_l
690_iswalnum_l
691_iswalpha_l
692_iswcntrl_l
693_iswctype_l
694_iswdigit_l
695_iswgraph_l
696_iswlower_l
697_iswprint_l
698_iswpunct_l
699_iswspace_l
700_iswupper_l
701_iswxdigit_l
702_isxdigit_l
703_itoa
704_itoa_s
705_itow
706_itow_s
707_j0
708_j1
709_jn
710_kbhit
711_lfind
712F_X86_ANY(_loaddll)
713F_NON_I386(_lfind_s)
714F_X64(_local_unwind)
715F_I386(_local_unwind2)
716_localtime32 F_I386(== localtime)
717; _localtime32_s replaced by emu
718_localtime64
719; _localtime64_s replaced by emu
720_lock
721_locking
722_logb
723F_NON_I386(_logbf)
724F_I386(_longjmpex)
725_lrotl
726_lrotr
727_lsearch
728F_NON_I386(_lsearch_s)
729_lseek
730_lseeki64
731_ltoa
732F_NON_I386(_ltoa_s)
733_ltow
734F_NON_I386(_ltow_s)
735_makepath
736_makepath_s
737F_ARM_ANY(_malloc_dbg)
738_mbbtombc
739_mbbtombc_l
740_mbbtype
741_mbcasemap F_NON_I386(DATA)
742_mbccpy
743_mbccpy_l
744_mbccpy_s
745_mbccpy_s_l
746_mbcjistojms
747_mbcjistojms_l
748_mbcjmstojis
749_mbcjmstojis_l
750_mbclen
751_mbclen_l
752_mbctohira
753_mbctohira_l
754_mbctokata
755_mbctokata_l
756_mbctolower
757_mbctolower_l
758_mbctombb
759_mbctombb_l
760_mbctoupper
761_mbctoupper_l
762_mbctype DATA
763_mblen_l
764_mbsbtype
765_mbsbtype_l
766_mbscat
767_mbscat_s
768_mbscat_s_l
769_mbschr
770_mbschr_l
771_mbscmp
772_mbscmp_l
773_mbscoll
774_mbscoll_l
775_mbscpy
776_mbscpy_s
777_mbscpy_s_l
778_mbscspn
779_mbscspn_l
780_mbsdec
781_mbsdec_l
782_mbsdup
783_mbsicmp
784_mbsicmp_l
785_mbsicoll
786_mbsicoll_l
787_mbsinc
788_mbsinc_l
789_mbslen
790_mbslen_l
791_mbslwr
792_mbslwr_l
793_mbslwr_s
794_mbslwr_s_l
795_mbsnbcat
796_mbsnbcat_l
797_mbsnbcat_s
798_mbsnbcat_s_l
799_mbsnbcmp
800_mbsnbcmp_l
801_mbsnbcnt
802_mbsnbcnt_l
803_mbsnbcoll
804_mbsnbcoll_l
805_mbsnbcpy
806_mbsnbcpy_l
807_mbsnbcpy_s
808_mbsnbcpy_s_l
809_mbsnbicmp
810_mbsnbicmp_l
811_mbsnbicoll
812_mbsnbicoll_l
813_mbsnbset
814_mbsnbset_l
815_mbsnbset_s
816_mbsnbset_s_l
817_mbsncat
818_mbsncat_l
819_mbsncat_s
820_mbsncat_s_l
821_mbsnccnt
822_mbsnccnt_l
823_mbsncmp
824_mbsncmp_l
825_mbsncoll
826_mbsncoll_l
827_mbsncpy
828_mbsncpy_l
829_mbsncpy_s
830_mbsncpy_s_l
831_mbsnextc
832_mbsnextc_l
833_mbsnicmp
834_mbsnicmp_l
835_mbsnicoll
836_mbsnicoll_l
837_mbsninc
838_mbsninc_l
839_mbsnlen
840_mbsnlen_l
841_mbsnset
842_mbsnset_l
843_mbsnset_s
844_mbsnset_s_l
845_mbspbrk
846_mbspbrk_l
847_mbsrchr
848_mbsrchr_l
849_mbsrev
850_mbsrev_l
851_mbsset
852_mbsset_l
853_mbsset_s
854_mbsset_s_l
855_mbsspn
856_mbsspn_l
857_mbsspnp
858_mbsspnp_l
859_mbsstr
860_mbsstr_l
861_mbstok
862_mbstok_l
863_mbstok_s
864_mbstok_s_l
865_mbstowcs_l
866_mbstowcs_s_l
867_mbstrlen
868_mbstrlen_l
869_mbstrnlen
870_mbstrnlen_l
871_mbsupr
872_mbsupr_l
873_mbsupr_s
874_mbsupr_s_l
875_mbtowc_l
876_memccpy
877F_ARM_ANY(_memcpy_strict_align)
878_memicmp
879_memicmp_l
880_mkdir
881_mkgmtime
882_mkgmtime32
883_mkgmtime64
884_mktemp
885; _mktemp_s replaced by emu
886F_I386(_mktime32 == mktime)
887F_ARM_ANY(_mktime32)
888_mktime64
889_msize
890F_ARM_ANY(_msize_dbg)
891_nextafter
892F_X64(_nextafterf)
893_onexit
894_open
895_open_osfhandle
896F_X86_ANY(_osplatform DATA)
897_osver DATA
898F_I386(_outp)
899F_I386(_outpd)
900F_I386(_outpw)
901_pclose
902_pctype DATA
903_pgmptr DATA
904_pipe
905_popen
906_printf_l
907_printf_p
908_printf_p_l
909_printf_s_l
910_purecall
911_putch
912_putenv
913_putenv_s
914_putw
915_putwch
916_putws
917_pwctype DATA
918_read
919F_ARM_ANY(_realloc_dbg)
920_resetstkoflw
921_rmdir
922_rmtmp
923_rotl
924F_NON_I386(_rotl64)
925_rotr
926F_NON_I386(_rotr64)
927#ifdef DEF_I386
928_safe_fdiv
929_safe_fdivr
930_safe_fprem
931_safe_fprem1
932#endif
933_scalb
934F_X64(_scalbf)
935_scanf_l
936_scanf_s_l
937F_NON_I386(_scprintf) ; i386 _scprintf replaced by emu
938_scprintf_l
939_scprintf_p_l
940_scwprintf
941_scwprintf_l
942_scwprintf_p_l
943_searchenv
944_searchenv_s
945F_I386(_seh_longjmp_unwind)
946_set_controlfp
947_set_doserrno
948F_ARM_ANY(_set_errno)
949_set_error_mode
950F_ARM_ANY(_set_fileinfo)
951F_ARM_ANY(_set_fmode)
952; Does not seem to present even on Win7 msvcrt
953;_set_purecall_handler
954F_X86_ANY(_set_sbh_threshold)
955; _set_output_format provided by emu
956F_I386(_set_SSE2_enable)
957F_I386(_set_security_error_handler)
958F_X86_ANY(_seterrormode)
959_setjmp
960F_I386(_setjmp3)
961F_NON_I386(_setjmpex)
962F_X86_ANY(_setmaxstdio)
963_setmbcp
964_setmode
965F_X86_ANY(_setsystime)
966F_X86_ANY(_sleep)
967_snprintf
968_snprintf_c
969_snprintf_c_l
970_snprintf_l
971_snprintf_s
972_snprintf_s_l
973_snscanf
974_snscanf_l
975_snscanf_s
976_snscanf_s_l
977_snwprintf
978snwprintf == _snwprintf
979_snwprintf_l
980_snwprintf_s
981_snwprintf_s_l
982_snwscanf
983_snwscanf_l
984_snwscanf_s
985_snwscanf_s_l
986_sopen
987; _sopen_s replaced by emu
988_spawnl
989_spawnle
990_spawnlp
991_spawnlpe
992_spawnv
993_spawnve
994_spawnvp
995_spawnvpe
996_splitpath
997_splitpath_s
998_sprintf_l
999_sprintf_p_l
1000_sprintf_s_l
1001_sscanf_l
1002_sscanf_s_l
1003_stat
1004_stat64
1005_stati64
1006F32(_stat32 == _stat)
1007F64(_stat64i32 == _stat)
1008_statusfp
1009_strcmpi
1010_strcoll_l
1011_strdate
1012; _strdate_s replaced by emu
1013_strdup
1014F_ARM_ANY(_strdup_dbg)
1015_strerror
1016_strerror_s
1017_stricmp
1018_stricmp_l
1019_stricoll
1020_stricoll_l
1021_strlwr
1022strlwr == _strlwr
1023_strlwr_l
1024_strlwr_s
1025_strlwr_s_l
1026_strncoll
1027_strncoll_l
1028_strnicmp
1029_strnicmp_l
1030_strnicoll
1031_strnicoll_l
1032_strnset
1033_strnset_s
1034_strrev
1035_strset
1036_strset_s
1037_strtime
1038; _strtime_s replaced by emu
1039_strtod_l
1040_strtoi64
1041strtoll == _strtoi64
1042strtoimax == _strtoi64
1043_strtoi64_l
1044_strtoll_l == _strtoi64_l
1045_strtoimax_l == _strtoi64_l
1046_strtol_l
1047_strtoui64
1048strtoull == _strtoui64
1049strtoumax == _strtoui64
1050_strtoui64_l
1051_strtoull_l == _strtoui64_l
1052_strtoumax_l == _strtoui64_l
1053_strtoul_l
1054_strupr
1055_strupr_l
1056_strupr_s
1057_strupr_s_l
1058_strxfrm_l
1059_swab
1060_swprintf == swprintf
1061F_NON_I386(_swprintf_c)
1062_swprintf_c_l
1063_swprintf_p_l
1064_swprintf_s_l
1065_swscanf_l
1066_swscanf_s_l
1067_sys_errlist DATA
1068_sys_nerr DATA
1069_tell
1070_telli64
1071_tempnam
1072F_ARM_ANY(_tempnam_dbg)
1073F_I386(_time32 == time)
1074F_ARM_ANY(_time32)
1075_time64
1076_timezone DATA
1077_tolower
1078_tolower_l
1079_toupper
1080_toupper_l
1081_towlower_l
1082_towupper_l
1083_tzname DATA
1084_tzset
1085_ui64toa
1086_ui64toa_s
1087_ui64tow
1088_ui64tow_s
1089_ultoa
1090_ultoa_s
1091_ultow
1092_ultow_s
1093_umask
1094; _umask_s replaced by emu
1095_ungetch
1096_ungetwch
1097_unlink
1098F_X86_ANY(_unloaddll)
1099_unlock
1100_utime
1101F_I386(_utime32 == _utime)
1102F_NON_I386(_utime32)
1103_utime64
1104_vcprintf
1105_vcprintf_l
1106_vcprintf_p
1107_vcprintf_p_l
1108; _vcprintf_s Replaced by emu
1109; _vcprintf_s_l Likewise.
1110_vcwprintf
1111_vcwprintf_l
1112_vcwprintf_p
1113_vcwprintf_p_l
1114; _vcwprintf_s Replaced by emu
1115; _vcwprintf_s_l Likewise.
1116_vfprintf_l
1117_vfprintf_p
1118_vfprintf_p_l
1119_vfprintf_s_l
1120_vfwprintf_l
1121_vfwprintf_p
1122_vfwprintf_p_l
1123_vfwprintf_s_l
1124_vprintf_l
1125_vprintf_p
1126_vprintf_p_l
1127_vprintf_s_l
1128F_NON_I386(_vscprintf) ; i386 _vscprintf replaced by emu
1129_vscprintf_l
1130_vscprintf_p_l
1131_vscwprintf
1132_vscwprintf_l
1133_vscwprintf_p_l
1134_vsnprintf
1135_vsnprintf_c
1136_vsnprintf_c_l
1137_vsnprintf_l
1138_vsnprintf_s
1139_vsnprintf_s_l
1140_vsnwprintf
1141vsnwprintf == _vsnwprintf
1142_vsnwprintf_l
1143_vsnwprintf_s
1144_vsnwprintf_s_l
1145_vsprintf_l
1146_vsprintf_p
1147_vsprintf_p_l
1148_vsprintf_s_l
1149_vswprintf F_I386(== vswprintf)
1150_vswprintf_c
1151_vswprintf_c_l
1152_vswprintf_l
1153_vswprintf_p_l
1154_vswprintf_s_l
1155_vwprintf_l
1156_vwprintf_p
1157_vwprintf_p_l
1158_vwprintf_s_l
1159_waccess
1160; _waccess_s Replaced by emu
1161_wasctime
1162; _wasctime_s Replaced by emu
1163F_NON_I386(_wassert)
1164_wchdir
1165_wchmod
1166_wcmdln DATA
1167_wcreat
1168_wcscoll_l
1169_wcsdup
1170F_ARM_ANY(_wcsdup_dbg)
1171_wcserror
1172_wcserror_s
1173_wcsftime_l
1174_wcsicmp
1175_wcsicmp_l
1176_wcsicoll
1177_wcsicoll_l
1178_wcslwr
1179wcslwr == _wcslwr
1180_wcslwr_l
1181_wcslwr_s
1182_wcslwr_s_l
1183_wcsncoll
1184_wcsncoll_l
1185_wcsnicmp
1186_wcsnicmp_l
1187_wcsnicoll
1188_wcsnicoll_l
1189_wcsnset
1190_wcsnset_s
1191_wcsrev
1192_wcsset
1193_wcsset_s
1194F_ARM_ANY(_wcstod_l)
1195_wcstoi64
1196_wcstoi64_l
1197_wcstol_l
1198_wcstombs_l
1199_wcstombs_s_l
1200_wcstoui64
1201_wcstoui64_l
1202_wcstoul_l
1203_wcsupr
1204_wcsupr_l
1205_wcsupr_s
1206_wcsupr_s_l
1207_wcsxfrm_l
1208_wctime
1209F_I386(_wctime32 == _wctime)
1210F_ARM_ANY(_wctime32)
1211; _wctime32_s replaced by emu
1212_wctime64
1213; _wctime64_s replaced by emu
1214_wctomb_l
1215_wctomb_s_l
1216_wctype
1217F_X86_ANY(_wenviron DATA)
1218_wexecl
1219_wexecle
1220_wexeclp
1221_wexeclpe
1222_wexecv
1223_wexecve
1224_wexecvp
1225_wexecvpe
1226_wfdopen
1227_wfindfirst
1228F32(_wfindfirst32 == _wfindfirst)
1229_wfindfirst64
1230_wfindfirsti64
1231F32(_wfindfirst32i64 == _wfindfirsti64)
1232F64(_wfindfirst64i32 == _wfindfirst)
1233_wfindnext
1234F32(_wfindnext32 == _wfindnext)
1235_wfindnext64
1236_wfindnexti64
1237F32(_wfindnext32i64 == _wfindnexti64)
1238F64(_wfindnext64i32 == _wfindnext)
1239_wfopen
1240_wfopen_s
1241_wfreopen
1242_wfreopen_s
1243_wfsopen
1244_wfullpath
1245F_ARM_ANY(_wfullpath_dbg)
1246_wgetcwd
1247_wgetdcwd
1248_wgetenv
1249_wgetenv_s
1250_winmajor DATA
1251_winminor DATA
1252_winput_s
1253F_X86_ANY(_winver DATA)
1254_wmakepath
1255_wmakepath_s
1256_wmkdir
1257_wmktemp
1258; _wmktemp_s replaced by emu
1259_wopen
1260_woutput_s
1261_wperror
1262_wpgmptr DATA
1263_wpopen
1264_wprintf_l
1265_wprintf_p
1266_wprintf_p_l
1267_wprintf_s_l
1268_wputenv
1269_wputenv_s
1270_wremove
1271_wrename
1272_write
1273_wrmdir
1274_wscanf_l
1275_wscanf_s_l
1276_wsearchenv
1277_wsearchenv_s
1278_wsetlocale
1279_wsopen
1280_wsopen_s
1281_wspawnl
1282_wspawnle
1283_wspawnlp
1284_wspawnlpe
1285_wspawnv
1286_wspawnve
1287_wspawnvp
1288_wspawnvpe
1289_wsplitpath
1290_wsplitpath_s
1291_wstat
1292_wstat64
1293_wstati64
1294F32(_wstat32 == _wstat)
1295F64(_wstat64i32 == _wstat)
1296_wstrdate
1297; _wstrdate_s replaced by emu
1298_wstrtime
1299; _wstrtime_s replaced by emu
1300_wsystem
1301_wtempnam
1302F_ARM_ANY(_wtempnam_dbg)
1303_wtmpnam
1304_wtmpnam_s
1305_wtof
1306_wtof_l
1307_wtoi
1308_wtoi64
1309_wtoi64_l
1310_wtoi_l
1311_wtol
1312_wtol_l
1313_wunlink
1314_wutime
1315F_I386(_wutime32 == _wutime)
1316F_NON_I386(_wutime32)
1317_wutime64
1318_y0
1319_y1
1320_yn
1321abort
1322abs
1323acos
1324F_NON_I386(acosf F_X86_ANY(DATA))
1325F_ARM_ANY(acosl == acos)
1326asctime
1327; asctime_s replaced by emu
1328asin
1329F_NON_I386(asinf F_X86_ANY(DATA))
1330F_ARM_ANY(asinl == asin)
1331atan
1332atan2 F_X86_ANY(DATA)
1333F_NON_I386(atan2f F_X86_ANY(DATA))
1334F_ARM_ANY(atan2l == atan2)
1335F_NON_I386(atanf F_X86_ANY(DATA))
1336F_ARM_ANY(atanl == atan)
1337atexit DATA
1338atof
1339atoi
1340atol
1341bsearch
1342bsearch_s
1343F_ARM_ANY(btowc)
1344calloc
1345ceil F_X86_ANY(DATA)
1346F_NON_I386(ceilf F_X86_ANY(DATA))
1347F_ARM_ANY(ceill == ceil)
1348clearerr
1349clearerr_s
1350clock
1351cos F_X86_ANY(DATA)
1352F_NON_I386(cosf F_X86_ANY(DATA))
1353F_ARM_ANY(cosl == cos)
1354cosh
1355F_NON_I386(coshf DATA)
1356ctime
1357difftime
1358div
1359exit
1360exp F_X86_ANY(DATA)
1361F_NON_I386(expf F_X86_ANY(DATA))
1362F_ARM_ANY(expl == exp)
1363fabs DATA
1364F_ARM_ANY(fabsf)
1365fclose
1366feof
1367ferror
1368fflush
1369fgetc
1370fgetpos
1371fgets
1372fgetwc
1373fgetws
1374floor F_X86_ANY(DATA)
1375F_NON_I386(floorf F_X86_ANY(DATA))
1376F_ARM_ANY(floorl == floor)
1377fmod F_X86_ANY(DATA)
1378F_NON_I386(fmodf F_X86_ANY(DATA))
1379F_ARM_ANY(fmodl == fmod)
1380fopen
1381fopen_s
1382fprintf
1383__ms_fprintf == fprintf
1384fprintf_s
1385fputc
1386fputs
1387fputwc
1388fputws
1389fread
1390free
1391freopen
1392freopen_s
1393frexp DATA
1394fscanf
1395__ms_fscanf == fscanf
1396fscanf_s
1397fseek
1398fsetpos
1399ftell
1400fwprintf
1401__ms_fwprintf == fwprintf
1402fwprintf_s
1403fwrite
1404fwscanf
1405__ms_fwscanf == fwscanf
1406fwscanf_s
1407getc
1408getchar
1409getenv
1410getenv_s
1411F_X86_ANY(gets)
1412getwc
1413getwchar
1414gmtime
1415is_wctype
1416isalnum
1417isalpha
1418iscntrl
1419isdigit
1420isgraph
1421isleadbyte
1422islower
1423isprint
1424ispunct
1425isspace
1426isupper
1427iswalnum
1428iswalpha
1429iswascii
1430iswcntrl
1431iswctype
1432iswdigit
1433iswgraph
1434iswlower
1435iswprint
1436iswpunct
1437iswspace
1438iswupper
1439iswxdigit
1440isxdigit
1441labs
1442ldexp F_X86_ANY(DATA)
1443ldiv
1444localeconv
1445localtime
1446log F_X86_ANY(DATA)
1447log10
1448F_NON_I386(log10f F_X86_ANY(DATA))
1449F_ARM_ANY(log10l == log10)
1450F_NON_I386(logf F_X86_ANY(DATA))
1451F_ARM_ANY(logl == log)
1452longjmp
1453malloc
1454mblen
1455F_ARM_ANY(mbrlen)
1456F_ARM_ANY(mbrtowc)
1457F_ARM_ANY(mbsdup_dbg)
1458F_ARM_ANY(mbsrtowcs)
1459mbsrtowcs_s
1460mbstowcs
1461mbstowcs_s
1462mbtowc
1463memchr
1464memcmp
1465memcpy
1466; memcpy_s replaced by emu
1467memmove
1468; memmove_s replaced by emu
1469memset
1470mktime
1471modf DATA
1472F_NON_I386(modff DATA)
1473perror
1474pow DATA
1475F_NON_I386(powf DATA)
1476printf
1477__ms_printf == printf
1478printf_s
1479putc
1480putchar
1481puts
1482putwc
1483putwchar
1484qsort
1485qsort_s
1486raise
1487rand
1488; rand_s replaced by emu
1489realloc
1490remove
1491rename
1492rewind
1493scanf
1494__ms_scanf == scanf
1495scanf_s
1496setbuf
1497F_NON_I386(setjmp)
1498setlocale
1499setvbuf
1500signal
1501sin F_X86_ANY(DATA)
1502F_NON_I386(sinf F_X86_ANY(DATA))
1503F_ARM_ANY(sinl == sin)
1504; if we implement sinh, we can set it DATA only.
1505sinh
1506F_NON_I386(sinhf DATA)
1507sprintf
1508__ms_sprintf == sprintf
1509; sprintf_s replaced by emu
1510sqrt DATA
1511F_NON_I386(sqrtf DATA)
1512srand
1513sscanf
1514__ms_sscanf == sscanf
1515sscanf_s
1516strcat
1517strcat_s
1518strchr
1519strcmp
1520strcoll
1521strcpy
1522strcpy_s
1523strcspn
1524strerror
1525; strerror_s replaced by emu
1526strftime
1527strlen
1528strncat
1529strncat_s
1530strncmp
1531strncpy
1532strncpy_s
1533; strnlen replaced by emu
1534strpbrk
1535strrchr
1536strspn
1537strstr
1538strtod
1539strtok
1540strtok_s
1541strtol
1542strtoul
1543strxfrm
1544swprintf
1545__ms_swprintf == swprintf
1546swprintf_s
1547swscanf
1548__ms_swscanf == swscanf
1549swscanf_s
1550system
1551tan
1552F_NON_I386(tanf F_X86_ANY(DATA))
1553F_ARM_ANY(tanl == tan)
1554; if we implement tanh, we can set it to DATA only.
1555tanh
1556F_ARM_ANY(tanhf)
1557time F_NON_I386(== _time64)
1558tmpfile
1559tmpfile_s
1560tmpnam
1561tmpnam_s
1562tolower
1563toupper
1564towlower
1565towupper
1566ungetc
1567ungetwc
1568F_ARM_ANY(utime)
1569vfprintf
1570__ms_vfprintf == vfprintf
1571vfprintf_s
1572vfwprintf
1573__ms_vfwprintf == vfwprintf
1574vfwprintf_s
1575vprintf
1576__ms_vprintf == vprintf
1577vprintf_s
1578vsprintf
1579__ms_vsprintf == vsprintf
1580; vsprintf_s replaced by emu
1581vswprintf
1582__ms_vswprintf == vswprintf
1583vswprintf_s
1584vwprintf
1585__ms_vwprintf == vwprintf
1586vwprintf_s
1587F_ARM_ANY(wcrtomb)
1588wcrtomb_s
1589wcscat
1590wcscat_s
1591wcschr
1592wcscmp
1593wcscoll
1594wcscpy
1595wcscpy_s
1596wcscspn
1597wcsftime
1598wcslen
1599wcsncat
1600wcsncat_s
1601wcsncmp
1602wcsncpy
1603wcsncpy_s
1604; We provide replacement implementation in libmingwex
1605wcsnlen DATA
1606wcspbrk
1607wcsrchr
1608F_ARM_ANY(wcsrtombs)
1609wcsrtombs_s
1610wcsspn
1611wcsstr
1612wcstod
1613wcstok
1614wcstok_s
1615wcstol
1616wcstombs
1617wcstombs_s
1618wcstoul
1619wcsxfrm
1620F_ARM_ANY(wctob)
1621wctomb
1622wctomb_s
1623wprintf
1624__ms_wprintf == wprintf
1625wprintf_s
1626wscanf
1627__ms_wscanf == wscanf
1628wscanf_s
lib/libc/mingw/lib32/crtdll.def.in deleted-726
...@@ -1,726 +0,0 @@
1;
2;* crtdll.def
3;* This file has no copyright assigned and is placed in the Public Domain.
4;* This file is part of the mingw-runtime package.
5;* No warranty is given; refer to the file DISCLAIMER.PD within the package.
6;
7; Exports from crtdll.dll from Windows 95 SYSTEM directory. Hopefully this
8; should also work with the crtdll provided with Windows NT.
9;
10; NOTE: The crtdll is OBSOLETE and msvcrt should be used instead. The msvcrt
11; is available for free download from Microsoft Corporation and will work on
12; Windows 95. Support for the crtdll is deprecated and this file may be
13; deleted in future versions.
14;
15; These three functions appear to be name mangled in some way, so GCC is
16; probably not going to be able to use them in any case.
17;
18; ??2@YAPAXI@Z
19; ??3@YAXPAX@Z
20; ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z
21;
22; These are functions for which I have not yet written prototypes or
23; otherwise set up (they are still included below though unlike those
24; first three).
25;
26; _CIacos
27; _CIasin
28; _CIatan
29; _CIatan2
30; _CIcos
31; _CIcosh
32; _CIexp
33; _CIfmod
34; _CIlog
35; _CIlog10
36; _CIpow
37; _CIsin
38; _CIsinh
39; _CIsqrt
40; _CItan
41; _CItanh
42; __dllonexit
43; __mb_cur_max_dll
44; __threadhandle
45; __threadid
46; _abnormal_termination
47; _acmdln_dll
48; _aexit_rtn_dll
49; _amsg_exit
50; _commit
51; _commode_dll
52; _cpumode_dll
53; _ctype
54; _expand
55; _fcloseall
56; _filbuf
57; _fileinfo_dll
58; _flsbuf
59; _flushall
60; _fmode_dll
61; _fpieee_flt
62; _fsopen
63; _ftol
64; _getdiskfree
65; _getdllprocaddr
66; _getdrive
67; _getdrives
68; _getsystime
69; _initterm
70; _ismbbalnum
71; _ismbbalpha
72; _ismbbgraph
73; _ismbbkalnum
74; _ismbbkana
75; _ismbbkpunct
76; _ismbblead
77; _ismbbprint
78; _ismbbpunct
79; _ismbbtrail
80; _ismbcalpha
81; _ismbcdigit
82; _ismbchira
83; _ismbckata
84; _ismbcl0
85; _ismbcl1
86; _ismbcl2
87; _ismbclegal
88; _ismbclower
89; _ismbcprint
90; _ismbcspace
91; _ismbcsymbol
92; _ismbcupper
93; _ismbslead
94; _ismbstrail
95; _lfind
96; _loaddll
97; _lrotl
98; _lrotr
99; _lsearch
100; _makepath
101; _matherr
102; _mbbtombc
103; _mbbtype
104; _mbccpy
105; _mbcjistojms
106; _mbcjmstojis
107; _mbclen
108; _mbctohira
109; _mbctokata
110; _mbctolower
111; _mbctombb
112; _mbctoupper
113; _mbctype
114; _mbsbtype
115; _mbscat
116; _mbscmp
117; _mbscpy
118; _mbscspn
119; _mbsdec
120; _mbsdup
121; _mbsicmp
122; _mbsinc
123; _mbslen
124; _mbslwr
125; _mbsnbcat
126; _mbsnbcmp
127; _mbsnbcnt
128; _mbsnbcpy
129; _mbsnbicmp
130; _mbsnbset
131; _mbsnccnt
132; _mbsncmp
133; _mbsncpy
134; _mbsnextc
135; _mbsnicmp
136; _mbsninc
137; _mbsnset
138; _mbspbrk
139; _mbsrchr
140; _mbsrev
141; _mbsset
142; _mbsspn
143; _mbsspnp
144; _mbsstr
145; _mbstrlen
146; _mbsupr
147; _onexit
148; _osversion_dll
149; _pctype_dll
150; _purecall
151; _pwctype_dll
152; _rmtmp
153; _rotl
154; _rotr
155; _setsystime
156; _snprintf
157; _snwprintf
158; _splitpath
159; _strdate
160; _strdec
161; _strinc
162; _strncnt
163; _strnextc
164; _strninc
165; _strspnp
166; _strtime
167; _tempnam
168; _ultoa
169; _unloaddll
170; _vsnprintf
171; _vsnwprintf
172; _wtoi
173; _wtol
174;
175LIBRARY "crtdll.dll"
176EXPORTS
177
178#include "msvcrt-common.def.in"
179
180_CIacos
181_CIasin
182_CIatan
183_CIatan2
184_CIcos
185_CIcosh
186_CIexp
187_CIfmod
188_CIlog
189_CIlog10
190_CIpow
191_CIsin
192_CIsinh
193_CIsqrt
194_CItan
195_CItanh
196_HUGE_dll DATA
197_HUGE DATA == _HUGE_dll
198_XcptFilter
199__GetMainArgs
200__argc_dll DATA
201__argc DATA == __argc_dll
202__argv_dll DATA
203__argv DATA == __argv_dll
204__dllonexit
205__doserrno
206__fpecode
207__isascii
208__iscsym
209__iscsymf
210__mb_cur_max_dll DATA
211__mb_cur_max DATA == __mb_cur_max_dll
212__pxcptinfoptrs
213__threadhandle
214__threadid
215__toascii
216_abnormal_termination
217_access
218_acmdln_dll DATA
219_acmdln DATA == _acmdln_dll
220_aexit_rtn_dll DATA
221_aexit_rtn DATA == _aexit_rtn_dll
222_amsg_exit
223_assert
224_basemajor_dll DATA
225_baseminor_dll DATA
226_baseversion_dll DATA
227_beep
228_beginthread
229_c_exit
230_cabs DATA
231_cexit
232_cgets
233_chdir
234_chdrive
235_chgsign
236_chmod
237_chsize
238_clearfp
239_close
240_commit
241_commode_dll DATA
242_commode DATA == _commode_dll
243_control87
244_controlfp
245_copysign
246_cprintf
247_cpumode_dll DATA
248_cputs
249_creat
250_cscanf
251_ctype DATA
252_cwait
253_daylight_dll DATA
254_daylight DATA == _daylight_dll
255_dup
256_dup2
257_ecvt
258_endthread
259_environ_dll DATA
260_environ DATA == _environ_dll
261_eof
262_errno
263_except_handler2
264_execl
265_execle
266_execlp
267_execlpe
268_execv
269_execve
270_execvp
271_execvpe
272_exit
273_expand
274_fcloseall
275_fcvt
276_fdopen
277_fgetchar
278_fgetwchar
279_filbuf
280_fileinfo_dll DATA
281_fileinfo DATA == _fileinfo_dll
282_filelength
283_fileno
284_findclose
285_findfirst
286_findnext
287_finite
288_flsbuf
289_flushall
290_fmode_dll DATA
291_fmode DATA == _fmode_dll
292_fpclass
293_fpieee_flt
294_fpreset DATA
295_fputchar
296_fputwchar
297_fsopen
298_fstat
299_ftime
300_ftol
301_fullpath
302_futime
303_gcvt
304_get_osfhandle
305_getch
306_getche
307_getcwd
308_getdcwd
309_getdiskfree
310_getdllprocaddr
311_getdrive
312_getdrives
313_getpid
314_getsystime
315_getw
316_global_unwind2
317_heapchk
318_heapmin
319_heapset
320_heapwalk
321_hypot
322_initterm
323_iob DATA
324_isatty
325_isctype
326_ismbbalnum
327_ismbbalpha
328_ismbbgraph
329_ismbbkalnum
330_ismbbkana
331_ismbbkpunct
332_ismbblead
333_ismbbprint
334_ismbbpunct
335_ismbbtrail
336_ismbcalpha
337_ismbcdigit
338_ismbchira
339_ismbckata
340_ismbcl0
341_ismbcl1
342_ismbcl2
343_ismbclegal
344_ismbclower
345_ismbcprint
346_ismbcspace
347_ismbcsymbol
348_ismbcupper
349_ismbslead
350_ismbstrail
351_isnan
352_itoa
353_j0
354_j1
355_jn
356_kbhit
357_lfind
358_loaddll
359_local_unwind2
360_locking
361_logb
362_lrotl
363_lrotr
364_lsearch
365_lseek
366_ltoa
367_makepath
368_matherr
369_mbbtombc
370_mbbtype
371_mbccpy
372_mbcjistojms
373_mbcjmstojis
374_mbclen
375_mbctohira
376_mbctokata
377_mbctolower
378_mbctombb
379_mbctoupper
380_mbctype DATA
381_mbsbtype
382_mbscat
383_mbschr
384_mbscmp
385_mbscpy
386_mbscspn
387_mbsdec
388_mbsdup
389_mbsicmp
390_mbsinc
391_mbslen
392_mbslwr
393_mbsnbcat
394_mbsnbcmp
395_mbsnbcnt
396_mbsnbcpy
397_mbsnbicmp
398_mbsnbset
399_mbsncat
400_mbsnccnt
401_mbsncmp
402_mbsncpy
403_mbsnextc
404_mbsnicmp
405_mbsninc
406_mbsnset
407_mbspbrk
408_mbsrchr
409_mbsrev
410_mbsset
411_mbsspn
412_mbsspnp
413_mbsstr
414_mbstok
415_mbstrlen
416_mbsupr
417_memccpy
418_memicmp
419_mkdir
420_mktemp
421_msize
422_nextafter
423_onexit
424_open
425_open_osfhandle
426_osmajor_dll DATA
427_osminor_dll DATA
428_osmode_dll DATA
429_osver_dll DATA
430_osver DATA == _osver_dll
431_osversion_dll DATA
432_pclose
433_pctype_dll DATA
434_pctype DATA == _pctype_dll
435_pgmptr_dll DATA
436_pgmptr DATA == _pgmptr_dll
437_pipe
438_popen
439_purecall
440_putch
441_putenv
442_putw
443_pwctype_dll DATA
444_pwctype DATA == _pwctype_dll
445_read
446_rmdir
447_rmtmp
448_rotl
449_rotr
450_scalb
451_searchenv
452_seterrormode
453_setjmp
454_setmode
455_setsystime
456_sleep
457_snprintf
458_snwprintf
459_sopen
460_spawnl
461_spawnle
462_spawnlp
463_spawnlpe
464_spawnv
465_spawnve
466_spawnvp
467_spawnvpe
468_splitpath
469_stat
470_statusfp
471_strcmpi
472_strdate
473_strdec
474_strdup
475_strerror
476_stricmp
477_stricoll
478_strinc
479_strlwr
480strlwr == _strlwr
481_strncnt
482_strnextc
483_strnicmp
484_strninc
485_strnset
486_strrev
487_strset
488_strspnp
489_strtime
490_strupr
491_swab
492_sys_errlist DATA
493_sys_nerr_dll DATA
494_sys_nerr DATA == _sys_nerr_dll
495_tell
496_tempnam
497_timezone_dll DATA
498_timezone DATA == _timezone_dll
499_tolower
500_toupper
501_tzname DATA
502_tzset
503_ultoa
504_umask
505_ungetch
506_unlink
507_unloaddll
508_utime
509_vsnprintf
510_vsnwprintf
511_wcsdup
512_wcsicmp
513_wcsicoll
514_wcslwr
515wcslwr == _wcslwr
516_wcsnicmp
517_wcsnset
518_wcsrev
519_wcsset
520_wcsupr
521_winmajor_dll DATA
522_winmajor DATA == _winmajor_dll
523_winminor_dll DATA
524_winminor DATA == _winminor_dll
525_winver_dll DATA
526_winver DATA == _winver_dll
527_write
528_wtoi
529_wtol
530_y0
531_y1
532_yn
533abort
534abs
535acos
536asctime
537asin DATA
538atan DATA
539atan2 DATA
540atexit DATA
541atof
542atoi
543atol
544bsearch
545calloc
546ceil
547clearerr
548clock
549cos DATA
550cosh
551ctime DATA
552;_ctime32 = ctime
553difftime
554div
555exit
556exp DATA
557fabs DATA
558fclose
559feof
560ferror
561fflush
562fgetc
563fgetpos
564fgets
565fgetwc
566floor
567fmod
568fopen
569fprintf
570fputc
571fputs
572fputwc
573fread
574free
575freopen
576frexp
577fscanf
578fseek
579fsetpos
580ftell
581fwprintf
582fwrite
583fwscanf
584getc
585getchar
586getenv
587gets
588gmtime DATA
589;_gmtime32 = gmtime
590is_wctype
591isalnum
592isalpha
593iscntrl
594isdigit
595isgraph
596isleadbyte
597islower
598isprint
599ispunct
600isspace
601isupper
602iswalnum
603iswalpha
604iswascii
605iswcntrl
606iswctype
607iswdigit
608iswgraph
609iswlower
610iswprint
611iswpunct
612iswspace
613iswupper
614iswxdigit
615isxdigit
616labs
617ldexp DATA
618ldiv
619localeconv
620localtime DATA
621;_localtime32 = localtime
622log
623log10
624longjmp
625malloc
626mblen
627mbstowcs
628mbtowc
629memchr
630memcmp
631memcpy
632memmove
633memset
634mktime DATA
635;_mktime32 = mktime
636modf
637perror
638pow
639printf
640putc
641putchar
642puts
643qsort
644raise
645rand
646realloc
647remove
648rename
649rewind
650scanf
651setbuf
652setlocale
653setvbuf
654signal
655sin
656sinh
657sprintf
658sqrt
659srand
660sscanf
661strcat
662strchr
663strcmp
664strcoll
665strcpy
666strcspn
667strerror
668strftime
669strlen
670strncat
671strncmp
672strncpy
673strpbrk
674strrchr
675strspn
676strstr
677strtod
678strtok
679strtol
680strtoul
681strxfrm
682swprintf
683swscanf
684system
685tan
686tanh
687time DATA
688;_time32 = time
689tmpfile
690tmpnam
691tolower
692toupper
693towlower
694towupper
695ungetc
696ungetwc
697vfprintf
698vfwprintf
699vprintf
700vsprintf
701vswprintf
702vwprintf
703wcscat
704wcschr
705wcscmp
706wcscoll
707wcscpy
708wcscspn
709wcsftime
710wcslen
711wcsncat
712wcsncmp
713wcsncpy
714wcspbrk
715wcsrchr
716wcsspn
717wcsstr
718wcstod
719wcstok
720wcstol
721wcstombs
722wcstoul
723wcsxfrm
724wctomb
725wprintf
726wscanf
lib/libc/mingw/lib32/msvcp60.def deleted-71
...@@ -1,71 +0,0 @@
1;Submitted by: Danny Smith <danny_r_smith_2001@yahoo.co.nz>
2;Only the C functions are listed. Most of these have been commented out since
3;I don't know what they are and can't test them. Some look like data exports
4;for C++ math functions (E.G.: _Xbig).
5LIBRARY MSVCP60.DLL
6EXPORTS
7;_Cosh
8;_Denorm
9;_Dnorm
10;_Dscale
11;_Dtest
12;_Eps
13;_Exp
14;_FCosh
15;_FDenorm
16;_FDnorm
17;_FDscale
18;_FDtest
19;_FEps
20;_FExp
21;_FInf
22;_FNan
23;_FRteps
24;_FSinh
25;_FSnan
26;_FXbig
27;_Getcoll
28;_Getctype
29;_Getcvt
30;_Hugeval
31;_Inf
32;_LCosh
33;_LDenorm
34;_LDscale
35;_LDtest
36;_LEps
37;_LExp
38;_LInf
39;_LNan
40;_LPoly
41;_LRteps
42;_LSinh
43;_LSnan
44;_LXbig
45;_Mbrtowc
46;_Nan
47;_Poly
48;_Rteps
49;_Sinh
50;_Snan
51;_Stod
52;_Stof
53;_Stold
54;_Strcoll
55;_Strxfrm
56;_Tolower
57;_Toupper
58;_Wcrtomb
59;__Wcrtomb_lk
60;_Xbig
61
62btowc
63mbrlen
64mbrtowc
65mbsrtowcs
66towctrans
67wcrtomb
68wcsrtombs
69wctob
70wctrans
71wctype
\ No newline at end of file
lib/libc/mingw/math/arm-common/acosh.c deleted-16
...@@ -1,16 +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 <math.h>
8
9double acosh(double x)
10{
11 if (x < 1.0)
12 return NAN;
13 if (isinf(x*x))
14 return log(2) + log(x);
15 return log(x + sqrt(x*x - 1));
16}
lib/libc/mingw/math/arm-common/acoshf.c deleted-16
...@@ -1,16 +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 <math.h>
8
9float acoshf(float x)
10{
11 if (x < 1.0)
12 return NAN;
13 if (isinf(x*x))
14 return logf(2) + logf(x);
15 return logf(x + sqrtf(x*x - 1));
16}
lib/libc/mingw/math/arm-common/acoshl.c deleted-16
...@@ -1,16 +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 <math.h>
8
9long double acoshl(long double x)
10{
11#if defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_)
12 return acosh(x);
13#else
14#error Not supported on your platform yet
15#endif
16}
lib/libc/mingw/math/arm-common/asinh.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 <math.h>
8
9double asinh(double x)
10{
11 if (isinf(x*x + 1)) {
12 if (x > 0)
13 return log(2) + log(x);
14 else
15 return -log(2) - log(-x);
16 }
17 return log(x + sqrt(x*x + 1));
18}
lib/libc/mingw/math/arm-common/asinhf.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 <math.h>
8
9float asinhf(float x)
10{
11 if (isinf(x*x + 1)) {
12 if (x > 0)
13 return logf(2) + logf(x);
14 else
15 return -logf(2) - logf(-x);
16 }
17 return logf(x + sqrtf(x*x + 1));
18}
lib/libc/mingw/math/arm-common/asinhl.c deleted-16
...@@ -1,16 +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 <math.h>
8
9long double asinhl(long double x)
10{
11#if defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_)
12 return asinh(x);
13#else
14#error Not supported on your platform yet
15#endif
16}
lib/libc/mingw/math/arm-common/atanh.c deleted-17
...@@ -1,17 +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 <math.h>
8
9double atanh(double x)
10{
11 if (x > 1 || x < -1)
12 return NAN;
13 if (-1e-6 < x && x < 1e-6)
14 return x + x*x*x/3;
15 else
16 return (log(1 + x) - log(1 - x)) / 2;
17}
lib/libc/mingw/math/arm-common/atanhf.c deleted-17
...@@ -1,17 +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 <math.h>
8
9float atanhf(float x)
10{
11 if (x > 1 || x < -1)
12 return NAN;
13 if (-1e-6 < x && x < 1e-6)
14 return x + x*x*x/3;
15 else
16 return (logf(1 + x) - logf(1 - x)) / 2;
17}
lib/libc/mingw/math/arm-common/atanhl.c deleted-16
...@@ -1,16 +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 <math.h>
8
9long double atanhl(long double x)
10{
11#if defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_)
12 return atanh(x);
13#else
14#error Not supported on your platform yet
15#endif
16}
lib/libc/mingw/math/arm-common/copysignl.c deleted-11
...@@ -1,11 +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#include <math.h>
7
8long double copysignl(long double x, long double y)
9{
10 return copysign(x, y);
11}
lib/libc/mingw/math/arm-common/expm1.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 <math.h>
8
9double expm1(double x)
10{
11 return exp(x) - 1.0;
12}
lib/libc/mingw/math/arm-common/expm1f.c deleted-15
...@@ -1,15 +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 <math.h>
8
9float expm1f(float x)
10{
11 // Intentionally using double version of exp() here in the float version of
12 // expm1, to preserve as much accuracy as possible in the intermediate
13 // result.
14 return exp(x) - 1.0;
15}
lib/libc/mingw/math/arm-common/expm1l.c deleted-16
...@@ -1,16 +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 <math.h>
8
9long double expm1l(long double x)
10{
11#if defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_)
12 return expm1(x);
13#else
14#error Not supported on your platform yet
15#endif
16}
lib/libc/mingw/math/arm-common/ilogb.c deleted-19
...@@ -1,19 +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 <math.h>
8#include <limits.h>
9
10int ilogb(double x)
11{
12 if (x == 0.0)
13 return FP_ILOGB0;
14 if (isinf(x))
15 return INT_MAX;
16 if (isnan(x))
17 return FP_ILOGBNAN;
18 return (int) logb(x);
19}
lib/libc/mingw/math/arm-common/ilogbf.c deleted-19
...@@ -1,19 +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 <math.h>
8#include <limits.h>
9
10int ilogbf(float x)
11{
12 if (x == 0.0)
13 return FP_ILOGB0;
14 if (isinf(x))
15 return INT_MAX;
16 if (isnan(x))
17 return FP_ILOGBNAN;
18 return (int) logbf(x);
19}
lib/libc/mingw/math/arm-common/ilogbl.c deleted-16
...@@ -1,16 +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 <math.h>
8
9int ilogbl(long double x)
10{
11#if defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_)
12 return ilogb(x);
13#else
14#error Not supported on your platform yet
15#endif
16}
lib/libc/mingw/math/arm-common/log1p.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 <math.h>
8
9double log1p(double x)
10{
11 return log(x + 1.0);
12}
lib/libc/mingw/math/arm-common/log1pf.c deleted-15
...@@ -1,15 +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 <math.h>
8
9float log1pf(float x)
10{
11 // Intentionally using double version of log() here in the float version of
12 // log1p, to preserve as much accuracy as possible in the intermediate
13 // parameter.
14 return log(x + 1.0);
15}
lib/libc/mingw/math/arm-common/log1pl.c deleted-16
...@@ -1,16 +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 <math.h>
8
9long double log1pl(long double x)
10{
11#if defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_)
12 return log1p(x);
13#else
14#error Not supported on your platform yet
15#endif
16}
lib/libc/mingw/math/arm-common/log2.c deleted-55
...@@ -1,55 +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 <math.h>
8#include <stdint.h>
9
10typedef union ieee754_double_ {
11 struct __attribute__((__packed__)) {
12 uint64_t f52 : 52;
13 uint64_t exp : 11;
14 uint64_t sgn : 1;
15 };
16 double f;
17} ieee754_double;
18
19typedef union ieee754_float_ {
20 struct __attribute__((__packed__)) {
21 uint32_t f23 : 23;
22 uint32_t exp : 8;
23 uint32_t sgn : 1;
24 };
25 float f;
26} ieee754_float;
27
28double log2(double x)
29{
30 ieee754_double u = { .f = x };
31 if (u.sgn == 0 && u.f52 == 0 && u.exp > 0 && u.exp < 0x7ff) {
32 // Handle exact powers of two exactly
33 return (int)u.exp - 1023;
34 }
35 return log(x) / 0.69314718246459960938;
36}
37
38float log2f(float x)
39{
40 ieee754_float u = { .f = x };
41 if (u.sgn == 0 && u.f23 == 0 && u.exp > 0 && u.exp < 0xff) {
42 // Handle exact powers of two exactly
43 return (int)u.exp - 127;
44 }
45 return logf(x) / 0.69314718246459960938f;
46}
47
48long double log2l(long double x)
49{
50#if defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_)
51 return log2(x);
52#else
53#error Not supported on your platform yet
54#endif
55}
lib/libc/mingw/math/arm-common/logb.c deleted-17
...@@ -1,17 +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 <math.h>
8#include <limits.h>
9
10extern double (* __MINGW_IMP_SYMBOL(_logb))(double);
11
12double logb(double x)
13{
14 if (isinf(x))
15 return INFINITY;
16 return __MINGW_IMP_SYMBOL(_logb)(x);
17}
lib/libc/mingw/math/arm-common/logbf.c deleted-17
...@@ -1,17 +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 <math.h>
8#include <limits.h>
9
10extern float (* __MINGW_IMP_SYMBOL(_logbf))(float);
11
12float logbf(float x)
13{
14 if (isinf(x))
15 return INFINITY;
16 return __MINGW_IMP_SYMBOL(_logbf)(x);
17}
lib/libc/mingw/math/arm-common/logbl.c deleted-16
...@@ -1,16 +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 <math.h>
8
9long double logbl(long double x)
10{
11#if defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_)
12 return logb(x);
13#else
14#error Not supported on your platform yet
15#endif
16}
lib/libc/mingw/math/arm-common/powf.c deleted-21
...@@ -1,21 +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 <math.h>
8#include <limits.h>
9
10extern float (* __MINGW_IMP_SYMBOL(powf))(float, float);
11
12float powf(float x, float y)
13{
14 if (x == 1.0f)
15 return 1.0f;
16 if (y == 0.0f)
17 return 1.0f;
18 if (x == -1.0f && isinf(y))
19 return 1.0f;
20 return __MINGW_IMP_SYMBOL(powf)(x, y);
21}
lib/libc/mingw/math/arm-common/powl.c deleted-16
...@@ -1,16 +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 <math.h>
8
9long double powl(long double x, long double y)
10{
11#if defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_)
12 return pow(x, y);
13#else
14#error Not supported on your platform yet
15#endif
16}
lib/libc/mingw/math/arm-common/remainder.c deleted-14
...@@ -1,14 +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 <math.h>
8#include <errno.h>
9
10double remainder(double x, double y)
11{
12 int iret;
13 return remquo(x, y, &iret);
14}
lib/libc/mingw/math/arm-common/remainderf.c deleted-14
...@@ -1,14 +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 <math.h>
8#include <errno.h>
9
10float remainderf(float x, float y)
11{
12 int iret;
13 return remquof(x, y, &iret);
14}
lib/libc/mingw/math/arm-common/remainderl.c deleted-17
...@@ -1,17 +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 <math.h>
8#include <errno.h>
9
10long double remainderl(long double x, long double y)
11{
12#if defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_)
13 return remainder(x, y);
14#else
15#error Not supported on your platform yet
16#endif
17}
lib/libc/mingw/math/arm-common/remquol.c deleted-17
...@@ -1,17 +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 <math.h>
8#include <errno.h>
9
10long double remquol(long double x, long double y, int *quo)
11{
12#if defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_)
13 return remquo(x, y, quo);
14#else
15#error Not supported on your platform yet
16#endif
17}
lib/libc/mingw/math/arm-common/s_remquo.c deleted-154
...@@ -1,154 +0,0 @@
1/* @(#)e_fmod.c 1.3 95/01/18 */
2/*-
3 * ====================================================
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
5 *
6 * Developed at SunSoft, a Sun Microsystems, Inc. business.
7 * Permission to use, copy, modify, and distribute this
8 * software is freely granted, provided that this notice
9 * is preserved.
10 * ====================================================
11 */
12
13#include <sys/cdefs.h>
14
15#include <float.h>
16
17#include <math.h>
18#include "../bsd_private_base.h"
19
20static const double Zero[] = {0.0, -0.0,};
21
22/*
23 * Return the IEEE remainder and set *quo to the last n bits of the
24 * quotient, rounded to the nearest integer. We choose n=31 because
25 * we wind up computing all the integer bits of the quotient anyway as
26 * a side-effect of computing the remainder by the shift and subtract
27 * method. In practice, this is far more bits than are needed to use
28 * remquo in reduction algorithms.
29 */
30double
31remquo(double x, double y, int *quo)
32{
33 int32_t n,hx,hy,hz,ix,iy,sx,i;
34 u_int32_t lx,ly,lz,q,sxy;
35
36 EXTRACT_WORDS(hx,lx,x);
37 EXTRACT_WORDS(hy,ly,y);
38 sxy = (hx ^ hy) & 0x80000000;
39 sx = hx&0x80000000; /* sign of x */
40 hx ^=sx; /* |x| */
41 hy &= 0x7fffffff; /* |y| */
42
43 /* purge off exception values */
44 if((hy|ly)==0||(hx>=0x7ff00000)|| /* y=0,or x not finite */
45 ((hy|((ly|-ly)>>31))>0x7ff00000)) /* or y is NaN */
46 return nan_mix_op(x, y, *)/nan_mix_op(x, y, *);
47 if(hx<=hy) {
48 if((hx<hy)||(lx<ly)) {
49 q = 0;
50 goto fixup; /* |x|<|y| return x or x-y */
51 }
52 if(lx==ly) {
53 *quo = (sxy ? -1 : 1);
54 return Zero[(u_int32_t)sx>>31]; /* |x|=|y| return x*0*/
55 }
56 }
57
58 /* determine ix = ilogb(x) */
59 if(hx<0x00100000) { /* subnormal x */
60 if(hx==0) {
61 for (ix = -1043, i=lx; i>0; i<<=1) ix -=1;
62 } else {
63 for (ix = -1022,i=(hx<<11); i>0; i<<=1) ix -=1;
64 }
65 } else ix = (hx>>20)-1023;
66
67 /* determine iy = ilogb(y) */
68 if(hy<0x00100000) { /* subnormal y */
69 if(hy==0) {
70 for (iy = -1043, i=ly; i>0; i<<=1) iy -=1;
71 } else {
72 for (iy = -1022,i=(hy<<11); i>0; i<<=1) iy -=1;
73 }
74 } else iy = (hy>>20)-1023;
75
76 /* set up {hx,lx}, {hy,ly} and align y to x */
77 if(ix >= -1022)
78 hx = 0x00100000|(0x000fffff&hx);
79 else { /* subnormal x, shift x to normal */
80 n = -1022-ix;
81 if(n<=31) {
82 hx = (hx<<n)|(lx>>(32-n));
83 lx <<= n;
84 } else {
85 hx = lx<<(n-32);
86 lx = 0;
87 }
88 }
89 if(iy >= -1022)
90 hy = 0x00100000|(0x000fffff&hy);
91 else { /* subnormal y, shift y to normal */
92 n = -1022-iy;
93 if(n<=31) {
94 hy = (hy<<n)|(ly>>(32-n));
95 ly <<= n;
96 } else {
97 hy = ly<<(n-32);
98 ly = 0;
99 }
100 }
101
102 /* fix point fmod */
103 n = ix - iy;
104 q = 0;
105 while(n--) {
106 hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1;
107 if(hz<0){hx = hx+hx+(lx>>31); lx = lx+lx;}
108 else {hx = hz+hz+(lz>>31); lx = lz+lz; q++;}
109 q <<= 1;
110 }
111 hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1;
112 if(hz>=0) {hx=hz;lx=lz;q++;}
113
114 /* convert back to floating value and restore the sign */
115 if((hx|lx)==0) { /* return sign(x)*0 */
116 q &= 0x7fffffff;
117 *quo = (sxy ? -q : q);
118 return Zero[(u_int32_t)sx>>31];
119 }
120 while(hx<0x00100000) { /* normalize x */
121 hx = hx+hx+(lx>>31); lx = lx+lx;
122 iy -= 1;
123 }
124 if(iy>= -1022) { /* normalize output */
125 hx = ((hx-0x00100000)|((iy+1023)<<20));
126 } else { /* subnormal output */
127 n = -1022 - iy;
128 if(n<=20) {
129 lx = (lx>>n)|((u_int32_t)hx<<(32-n));
130 hx >>= n;
131 } else if (n<=31) {
132 lx = (hx<<(32-n))|(lx>>n); hx = 0;
133 } else {
134 lx = hx>>(n-32); hx = 0;
135 }
136 }
137fixup:
138 INSERT_WORDS(x,hx,lx);
139 y = fabs(y);
140 if (y < 0x1p-1021) {
141 if (x+x>y || (x+x==y && (q & 1))) {
142 q++;
143 x-=y;
144 }
145 } else if (x>0.5*y || (x==0.5*y && (q & 1))) {
146 q++;
147 x-=y;
148 }
149 GET_HIGH_WORD(hx,x);
150 SET_HIGH_WORD(x,hx^sx);
151 q &= 0x7fffffff;
152 *quo = (sxy ? -q : q);
153 return x;
154}
lib/libc/mingw/math/arm-common/s_remquof.c deleted-121
...@@ -1,121 +0,0 @@
1/* @(#)e_fmod.c 1.3 95/01/18 */
2/*-
3 * ====================================================
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
5 *
6 * Developed at SunSoft, a Sun Microsystems, Inc. business.
7 * Permission to use, copy, modify, and distribute this
8 * software is freely granted, provided that this notice
9 * is preserved.
10 * ====================================================
11 */
12
13#include <sys/cdefs.h>
14
15#include <math.h>
16#include "../bsd_private_base.h"
17
18static const float Zero[] = {0.0, -0.0,};
19
20/*
21 * Return the IEEE remainder and set *quo to the last n bits of the
22 * quotient, rounded to the nearest integer. We choose n=31 because
23 * we wind up computing all the integer bits of the quotient anyway as
24 * a side-effect of computing the remainder by the shift and subtract
25 * method. In practice, this is far more bits than are needed to use
26 * remquo in reduction algorithms.
27 */
28float
29remquof(float x, float y, int *quo)
30{
31 int32_t n,hx,hy,hz,ix,iy,sx,i;
32 u_int32_t q,sxy;
33
34 GET_FLOAT_WORD(hx,x);
35 GET_FLOAT_WORD(hy,y);
36 sxy = (hx ^ hy) & 0x80000000;
37 sx = hx&0x80000000; /* sign of x */
38 hx ^=sx; /* |x| */
39 hy &= 0x7fffffff; /* |y| */
40
41 /* purge off exception values */
42 if(hy==0||hx>=0x7f800000||hy>0x7f800000) /* y=0,NaN;or x not finite */
43 return nan_mix_op(x, y, *)/nan_mix_op(x, y, *);
44 if(hx<hy) {
45 q = 0;
46 goto fixup; /* |x|<|y| return x or x-y */
47 } else if(hx==hy) {
48 *quo = (sxy ? -1 : 1);
49 return Zero[(u_int32_t)sx>>31]; /* |x|=|y| return x*0*/
50 }
51
52 /* determine ix = ilogb(x) */
53 if(hx<0x00800000) { /* subnormal x */
54 for (ix = -126,i=(hx<<8); i>0; i<<=1) ix -=1;
55 } else ix = (hx>>23)-127;
56
57 /* determine iy = ilogb(y) */
58 if(hy<0x00800000) { /* subnormal y */
59 for (iy = -126,i=(hy<<8); i>0; i<<=1) iy -=1;
60 } else iy = (hy>>23)-127;
61
62 /* set up {hx,lx}, {hy,ly} and align y to x */
63 if(ix >= -126)
64 hx = 0x00800000|(0x007fffff&hx);
65 else { /* subnormal x, shift x to normal */
66 n = -126-ix;
67 hx <<= n;
68 }
69 if(iy >= -126)
70 hy = 0x00800000|(0x007fffff&hy);
71 else { /* subnormal y, shift y to normal */
72 n = -126-iy;
73 hy <<= n;
74 }
75
76 /* fix point fmod */
77 n = ix - iy;
78 q = 0;
79 while(n--) {
80 hz=hx-hy;
81 if(hz<0) hx = hx << 1;
82 else {hx = hz << 1; q++;}
83 q <<= 1;
84 }
85 hz=hx-hy;
86 if(hz>=0) {hx=hz;q++;}
87
88 /* convert back to floating value and restore the sign */
89 if(hx==0) { /* return sign(x)*0 */
90 q &= 0x7fffffff;
91 *quo = (sxy ? -q : q);
92 return Zero[(u_int32_t)sx>>31];
93 }
94 while(hx<0x00800000) { /* normalize x */
95 hx <<= 1;
96 iy -= 1;
97 }
98 if(iy>= -126) { /* normalize output */
99 hx = ((hx-0x00800000)|((iy+127)<<23));
100 } else { /* subnormal output */
101 n = -126 - iy;
102 hx >>= n;
103 }
104fixup:
105 SET_FLOAT_WORD(x,hx);
106 y = fabsf(y);
107 if (y < 0x1p-125f) {
108 if (x+x>y || (x+x==y && (q & 1))) {
109 q++;
110 x-=y;
111 }
112 } else if (x>0.5f*y || (x==0.5f*y && (q & 1))) {
113 q++;
114 x-=y;
115 }
116 GET_FLOAT_WORD(hx,x);
117 SET_FLOAT_WORD(x,hx^sx);
118 q &= 0x7fffffff;
119 *quo = (sxy ? -q : q);
120 return x;
121}
lib/libc/mingw/math/arm-common/scalbn.c deleted-45
...@@ -1,45 +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 <math.h>
8
9double scalbn(double x, int exp)
10{
11 return x * exp2(exp);
12}
13
14float scalbnf(float x, int exp)
15{
16 return x * exp2f(exp);
17}
18
19long double scalbnl(long double x, int exp)
20{
21#if defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_)
22 return scalbn(x, exp);
23#else
24#error Not supported on your platform yet
25#endif
26}
27
28double scalbln(double x, long exp)
29{
30 return x * exp2(exp);
31}
32
33float scalblnf(float x, long exp)
34{
35 return x * exp2f(exp);
36}
37
38long double scalblnl(long double x, long exp)
39{
40#if defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_)
41 return scalbln(x, exp);
42#else
43#error Not supported on your platform yet
44#endif
45}
lib/libc/mingw/math/arm/exp2.S deleted-19
...@@ -1,19 +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#include <_mingw_mac.h>
7
8 .file "exp2.S"
9 .text
10 .align 2
11 .globl __MINGW_USYMBOL(exp2)
12 .globl __MINGW_USYMBOL(exp2l)
13 .def __MINGW_USYMBOL(exp2); .scl 2; .type 32; .endef
14 .def __MINGW_USYMBOL(exp2l); .scl 2; .type 32; .endef
15__MINGW_USYMBOL(exp2):
16__MINGW_USYMBOL(exp2l):
17 vmov.f64 d1, d0
18 vmov.f64 d0, #2.0
19 b pow
lib/libc/mingw/math/arm/exp2f.S deleted-16
...@@ -1,16 +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#include <_mingw_mac.h>
7
8 .file "exp2f.S"
9 .text
10 .align 2
11 .globl __MINGW_USYMBOL(exp2f)
12 .def __MINGW_USYMBOL(exp2f); .scl 2; .type 32; .endef
13__MINGW_USYMBOL(exp2f):
14 vmov s1, s0
15 vmov.f32 s0, #2.0
16 b powf
lib/libc/mingw/math/arm/nearbyint.S 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#include <_mingw_mac.h>
7
8 .file "nearbyint.S"
9 .text
10 .align 4
11 .globl __MINGW_USYMBOL(nearbyint)
12 .def __MINGW_USYMBOL(nearbyint); .scl 2; .type 32; .endef
13__MINGW_USYMBOL(nearbyint):
14 push {r4, lr}
15 vmrs r4, fpscr
16 bl rint
17 vmsr fpscr, r4
18 pop {r4, pc}
lib/libc/mingw/math/arm/nearbyintf.S 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#include <_mingw_mac.h>
7
8 .file "nearbyintf.S"
9 .text
10 .align 4
11 .globl __MINGW_USYMBOL(nearbyintf)
12 .def __MINGW_USYMBOL(nearbyintf); .scl 2; .type 32; .endef
13__MINGW_USYMBOL(nearbyintf):
14 push {r4, lr}
15 vmrs r4, fpscr
16 bl rintf
17 vmsr fpscr, r4
18 pop {r4, pc}
lib/libc/mingw/math/arm/nearbyintl.S 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#include <_mingw_mac.h>
7
8 .file "nearbyintl.S"
9 .text
10 .align 4
11 .globl __MINGW_USYMBOL(nearbyintl)
12 .def __MINGW_USYMBOL(nearbyintl); .scl 2; .type 32; .endef
13__MINGW_USYMBOL(nearbyintl):
14 push {r4, lr}
15 vmrs r4, fpscr
16 bl rintl
17 vmsr fpscr, r4
18 pop {r4, pc}
lib/libc/mingw/math/arm/s_trunc.c deleted-61
...@@ -1,61 +0,0 @@
1/* @(#)s_floor.c 5.1 93/09/24 */
2/*
3 * ====================================================
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
5 *
6 * Developed at SunPro, a Sun Microsystems, Inc. business.
7 * Permission to use, copy, modify, and distribute this
8 * software is freely granted, provided that this notice
9 * is preserved.
10 * ====================================================
11 */
12
13#include <sys/cdefs.h>
14
15/*
16 * trunc(x)
17 * Return x rounded toward 0 to integral value
18 * Method:
19 * Bit twiddling.
20 * Exception:
21 * Inexact flag raised if x not equal to trunc(x).
22 */
23
24#include <float.h>
25
26#include "../bsd_private_base.h"
27
28static const double huge = 1.0e300;
29
30double
31trunc(double x)
32{
33 int32_t i0,i1,j0;
34 u_int32_t i;
35 EXTRACT_WORDS(i0,i1,x);
36 j0 = ((i0>>20)&0x7ff)-0x3ff;
37 if(j0<20) {
38 if(j0<0) { /* raise inexact if x != 0 */
39 if(huge+x>0.0) {/* |x|<1, so return 0*sign(x) */
40 i0 &= 0x80000000U;
41 i1 = 0;
42 }
43 } else {
44 i = (0x000fffff)>>j0;
45 if(((i0&i)|i1)==0) return x; /* x is integral */
46 if(huge+x>0.0) { /* raise inexact flag */
47 i0 &= (~i); i1=0;
48 }
49 }
50 } else if (j0>51) {
51 if(j0==0x400) return x+x; /* inf or NaN */
52 else return x; /* x is integral */
53 } else {
54 i = ((u_int32_t)(0xffffffff))>>(j0-20);
55 if((i1&i)==0) return x; /* x is integral */
56 if(huge+x>0.0) /* raise inexact flag */
57 i1 &= (~i);
58 }
59 INSERT_WORDS(x,i0,i1);
60 return x;
61}
lib/libc/mingw/math/arm/s_truncf.c deleted-51
...@@ -1,51 +0,0 @@
1/* @(#)s_floor.c 5.1 93/09/24 */
2/*
3 * ====================================================
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
5 *
6 * Developed at SunPro, a Sun Microsystems, Inc. business.
7 * Permission to use, copy, modify, and distribute this
8 * software is freely granted, provided that this notice
9 * is preserved.
10 * ====================================================
11 */
12
13#include <sys/cdefs.h>
14
15/*
16 * truncf(x)
17 * Return x rounded toward 0 to integral value
18 * Method:
19 * Bit twiddling.
20 * Exception:
21 * Inexact flag raised if x not equal to truncf(x).
22 */
23
24#include "../bsd_private_base.h"
25
26static const float huge = 1.0e30F;
27
28float
29truncf(float x)
30{
31 int32_t i0,j0;
32 u_int32_t i;
33 GET_FLOAT_WORD(i0,x);
34 j0 = ((i0>>23)&0xff)-0x7f;
35 if(j0<23) {
36 if(j0<0) { /* raise inexact if x != 0 */
37 if(huge+x>0.0F) /* |x|<1, so return 0*sign(x) */
38 i0 &= 0x80000000;
39 } else {
40 i = (0x007fffff)>>j0;
41 if((i0&i)==0) return x; /* x is integral */
42 if(huge+x>0.0F) /* raise inexact flag */
43 i0 &= (~i);
44 }
45 } else {
46 if(j0==0x80) return x+x; /* inf or NaN */
47 else return x; /* x is integral */
48 }
49 SET_FLOAT_WORD(x,i0);
50 return x;
51}
lib/libc/mingw/math/arm64/exp2.S deleted-19
...@@ -1,19 +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#include <_mingw_mac.h>
7
8 .file "exp2.S"
9 .text
10 .align 2
11 .globl __MINGW_USYMBOL(exp2)
12 .globl __MINGW_USYMBOL(exp2l)
13 .def __MINGW_USYMBOL(exp2); .scl 2; .type 32; .endef
14 .def __MINGW_USYMBOL(exp2l); .scl 2; .type 32; .endef
15__MINGW_USYMBOL(exp2):
16__MINGW_USYMBOL(exp2l):
17 fmov d1, d0
18 fmov d0, #2.0
19 b pow
lib/libc/mingw/math/arm64/exp2f.S deleted-16
...@@ -1,16 +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#include <_mingw_mac.h>
7
8 .file "exp2f.S"
9 .text
10 .align 2
11 .globl __MINGW_USYMBOL(exp2f)
12 .def __MINGW_USYMBOL(exp2f); .scl 2; .type 32; .endef
13__MINGW_USYMBOL(exp2f):
14 fmov s1, s0
15 fmov s0, #2.0
16 b powf
lib/libc/mingw/math/arm64/nearbyint.S deleted-17
...@@ -1,17 +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#include <_mingw_mac.h>
7
8 .file "nearbyint.S"
9 .text
10 .align 2
11 .globl __MINGW_USYMBOL(nearbyint)
12 .def __MINGW_USYMBOL(nearbyint); .scl 2; .type 32; .endef
13__MINGW_USYMBOL(nearbyint):
14 mrs x1, fpcr
15 frintx d0, d0
16 msr fpcr, x1
17 ret
lib/libc/mingw/math/arm64/nearbyintf.S deleted-17
...@@ -1,17 +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#include <_mingw_mac.h>
7
8 .file "nearbyintf.S"
9 .text
10 .align 2
11 .globl __MINGW_USYMBOL(nearbyintf)
12 .def __MINGW_USYMBOL(nearbyintf); .scl 2; .type 32; .endef
13__MINGW_USYMBOL(nearbyintf):
14 mrs x1, fpcr
15 frintx s0, s0
16 msr fpcr, x1
17 ret
lib/libc/mingw/math/arm64/nearbyintl.S deleted-17
...@@ -1,17 +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#include <_mingw_mac.h>
7
8 .file "nearbyintl.S"
9 .text
10 .align 2
11 .globl __MINGW_USYMBOL(nearbyintl)
12 .def __MINGW_USYMBOL(nearbyintl); .scl 2; .type 32; .endef
13__MINGW_USYMBOL(nearbyintl):
14 mrs x1, fpcr
15 frintx d0, d0
16 msr fpcr, x1
17 ret
lib/libc/mingw/math/arm64/trunc.S deleted-16
...@@ -1,16 +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#include <_mingw_mac.h>
7
8 .file "trunc.S"
9 .text
10 .p2align 2
11 .globl __MINGW_USYMBOL(trunc)
12 .def __MINGW_USYMBOL(trunc); .scl 2; .type 32; .endef
13
14__MINGW_USYMBOL(trunc):
15 frintz d0, d0
16 ret
lib/libc/mingw/math/arm64/truncf.S deleted-16
...@@ -1,16 +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#include <_mingw_mac.h>
7
8 .file "truncf.S"
9 .text
10 .p2align 2
11 .globl __MINGW_USYMBOL(truncf)
12 .def __MINGW_USYMBOL(truncf); .scl 2; .type 32; .endef
13
14__MINGW_USYMBOL(truncf):
15 frintz s0, s0
16 ret
lib/libc/mingw/math/cbrt.c deleted-104
...@@ -1,104 +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#include <math.h>
7#include "cephes_mconf.h"
8
9static const double CBRT2 = 1.2599210498948731647672;
10static const double CBRT4 = 1.5874010519681994747517;
11static const double CBRT2I = 0.79370052598409973737585;
12static const double CBRT4I = 0.62996052494743658238361;
13
14#ifndef __MINGW32__
15extern double frexp ( double, int * );
16extern double ldexp ( double, int );
17extern int isnan ( double );
18extern int isfinite ( double );
19#endif
20
21double cbrt(double x)
22{
23 int e, rem, sign;
24 double z;
25
26#ifdef __MINGW32__
27 if (!isfinite (x) || x == 0)
28 return x;
29#else
30#ifdef NANS
31 if (isnan(x))
32 return x;
33#endif
34#ifdef INFINITIES
35 if (!isfinite(x))
36 return x;
37#endif
38 if (x == 0)
39 return (x);
40#endif /* __MINGW32__ */
41
42 if (x > 0)
43 sign = 1;
44 else
45 {
46 sign = -1;
47 x = -x;
48 }
49
50 z = x;
51 /* extract power of 2, leaving
52 * mantissa between 0.5 and 1
53 */
54 x = frexp(x, &e);
55
56 /* Approximate cube root of number between .5 and 1,
57 * peak relative error = 9.2e-6
58 */
59 x = (((-1.3466110473359520655053e-1 * x
60 + 5.4664601366395524503440e-1) * x
61 - 9.5438224771509446525043e-1) * x
62 + 1.1399983354717293273738e0 ) * x
63 + 4.0238979564544752126924e-1;
64
65 /* exponent divided by 3 */
66 if (e >= 0)
67 {
68 rem = e;
69 e /= 3;
70 rem -= 3*e;
71 if (rem == 1)
72 x *= CBRT2;
73 else if (rem == 2)
74 x *= CBRT4;
75 }
76 /* argument less than 1 */
77 else
78 {
79 e = -e;
80 rem = e;
81 e /= 3;
82 rem -= 3*e;
83 if (rem == 1)
84 x *= CBRT2I;
85 else if (rem == 2)
86 x *= CBRT4I;
87 e = -e;
88 }
89
90 /* multiply by power of 2 */
91 x = ldexp(x, e);
92
93 /* Newton iteration */
94 x -= ( x - (z/(x*x)) )*0.33333333333333333333;
95#ifdef DEC
96 x -= ( x - (z/(x*x)) )/3.0;
97#else
98 x -= ( x - (z/(x*x)) )*0.33333333333333333333;
99#endif
100
101 if (sign < 0)
102 x = -x;
103 return (x);
104}
lib/libc/mingw/math/cbrtf.c deleted-75
...@@ -1,75 +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#include <math.h>
7#include "cephes_mconf.h"
8
9static const float CBRT2 = 1.25992104989487316477;
10static const float CBRT4 = 1.58740105196819947475;
11
12float cbrtf (float x)
13{
14 int e, rem, sign;
15 float z;
16 if (!isfinite (x) || x == 0.0F)
17 return x;
18 if (x > 0)
19 sign = 1;
20 else
21 {
22 sign = -1;
23 x = -x;
24 }
25
26 z = x;
27 /* extract power of 2, leaving
28 * mantissa between 0.5 and 1
29 */
30 x = frexpf(x, &e);
31
32 /* Approximate cube root of number between .5 and 1,
33 * peak relative error = 9.2e-6
34 */
35 x = (((-0.13466110473359520655053 * x
36 + 0.54664601366395524503440 ) * x
37 - 0.95438224771509446525043 ) * x
38 + 1.1399983354717293273738 ) * x
39 + 0.40238979564544752126924;
40
41 /* exponent divided by 3 */
42 if (e >= 0)
43 {
44 rem = e;
45 e /= 3;
46 rem -= 3*e;
47 if (rem == 1)
48 x *= CBRT2;
49 else if (rem == 2)
50 x *= CBRT4;
51 }
52/* argument less than 1 */
53 else
54 {
55 e = -e;
56 rem = e;
57 e /= 3;
58 rem -= 3*e;
59 if (rem == 1)
60 x /= CBRT2;
61 else if (rem == 2)
62 x /= CBRT4;
63 e = -e;
64 }
65
66 /* multiply by power of 2 */
67 x = ldexpf(x, e);
68
69 /* Newton iteration */
70 x -= ( x - (z/(x*x)) ) * 0.333333333333;
71
72 if (sign < 0)
73 x = -x;
74 return (x);
75}
lib/libc/mingw/math/copysign.c deleted-21
...@@ -1,21 +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#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 deleted-19
...@@ -1,19 +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#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/math/fabs.c deleted-20
...@@ -1,20 +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#define __CRT__NO_INLINE
7#include <math.h>
8
9double
10fabs (double x)
11{
12#if defined(__x86_64__) || defined(_AMD64_) || defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_)
13 return __builtin_fabs (x);
14#elif defined(__i386__) || defined(_X86_)
15 double res = 0.0;
16
17 asm volatile ("fabs;" : "=t" (res) : "0" (x));
18 return res;
19#endif /* defined(__x86_64__) || defined(_AMD64_) || defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_) */
20}
lib/libc/mingw/math/fdim.c deleted-24
...@@ -1,24 +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#include <math.h>
7#include <errno.h>
8
9double
10fdim (double x, double y)
11{
12 int cx = fpclassify (x), cy = fpclassify (y);
13 double r;
14
15 if (cx == FP_NAN || cy == FP_NAN
16 || (y < 0 && cx == FP_INFINITE && cy == FP_INFINITE))
17 return x - y; /* Take care invalid flag is raised. */
18 if (x <= y)
19 return 0.0;
20 r = x - y;
21 if (fpclassify (r) == FP_INFINITE)
22 errno = ERANGE;
23 return r;
24}
lib/libc/mingw/math/fdimf.c deleted-24
...@@ -1,24 +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#include <errno.h>
7#include <math.h>
8
9float
10fdimf (float x, float y)
11{
12 int cx = fpclassify (x), cy = fpclassify (y);
13 float r;
14
15 if (cx == FP_NAN || cy == FP_NAN
16 || (y < 0 && cx == FP_INFINITE && cy == FP_INFINITE))
17 return x - y; /* Take care invalid flag is raised. */
18 if (x <= y)
19 return 0.0f;
20 r = x - y;
21 if (fpclassify (r) == FP_INFINITE)
22 errno = ERANGE;
23 return r;
24}
lib/libc/mingw/math/fma.c deleted-97
...@@ -1,97 +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 */
6double fma(double x, double y, double z);
7
8#if defined(_ARM_) || defined(__arm__)
9
10/* Use hardware FMA on ARM. */
11double fma(double x, double y, double z){
12 __asm__ (
13 "fmacd %0, %1, %2 \n"
14 : "+w"(z)
15 : "w"(x), "w"(y)
16 );
17 return z;
18}
19
20#elif defined(_ARM64_) || defined(__aarch64__)
21
22/* Use hardware FMA on ARM64. */
23double fma(double x, double y, double z){
24 __asm__ (
25 "fmadd %d0, %d1, %d2, %d0 \n"
26 : "+w"(z)
27 : "w"(x), "w"(y)
28 );
29 return z;
30}
31
32#elif defined(_AMD64_) || defined(__x86_64__) || defined(_X86_) || defined(__i386__)
33
34#include <math.h>
35#include <stdint.h>
36
37/* This is in accordance with the IEC 559 double-precision format.
38 * Be advised that due to the hidden bit, the higher half actually has 26 bits.
39 * Multiplying two 27-bit numbers will cause a 1-ULP error, which we cannot
40 * avoid. It is kept in the very last position.
41 */
42typedef union iec559_double_ {
43 struct __attribute__((__packed__)) {
44 uint64_t mlo : 27;
45 uint64_t mhi : 25;
46 uint64_t exp : 11;
47 uint64_t sgn : 1;
48 };
49 double f;
50} iec559_double;
51
52static inline void break_down(iec559_double *restrict lo, iec559_double *restrict hi, double x) {
53 hi->f = x;
54 /* Erase low-order significant bits. `hi->f` now has only 26 significant bits. */
55 hi->mlo = 0;
56 /* Store the low-order half. It will be normalized by the hardware. */
57 lo->f = x - hi->f;
58 /* Preserve signness in case of zero. */
59 lo->sgn = hi->sgn;
60}
61
62double fma(double x, double y, double z) {
63 /*
64 POSIX-2013:
65 1. If x or y are NaN, a NaN shall be returned.
66 2. If x multiplied by y is an exact infinity and z is also an infinity
67 but with the opposite sign, a domain error shall occur, and either a NaN
68 (if supported), or an implementation-defined value shall be returned.
69 3. If one of x and y is infinite, the other is zero, and z is not a NaN,
70 a domain error shall occur, and either a NaN (if supported), or an
71 implementation-defined value shall be returned.
72 4. If one of x and y is infinite, the other is zero, and z is a NaN, a NaN
73 shall be returned and a domain error may occur.
74 5. If x* y is not 0*Inf nor Inf*0 and z is a NaN, a NaN shall be returned.
75 */
76 /* Check whether the result is finite. */
77 double ret = x * y + z;
78 if(!isfinite(ret)) {
79 return ret; /* If this naive check doesn't yield a finite value, the FMA isn't
80 likely to return one either. Forward the value as is. */
81 }
82 iec559_double xlo, xhi, ylo, yhi;
83 break_down(&xlo, &xhi, x);
84 break_down(&ylo, &yhi, y);
85 /* The order of these four statements is essential. Don't move them around. */
86 ret = z;
87 ret += xhi.f * yhi.f; /* The most significant item comes first. */
88 ret += xhi.f * ylo.f + xlo.f * yhi.f; /* They are equally significant. */
89 ret += xlo.f * ylo.f; /* The least significant item comes last. */
90 return ret;
91}
92
93#else
94
95#error Please add FMA implementation for this platform.
96
97#endif
lib/libc/mingw/math/fmaf.c deleted-97
...@@ -1,97 +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 */
6float fmaf(float x, float y, float z);
7
8#if defined(_ARM_) || defined(__arm__)
9
10/* Use hardware FMA on ARM. */
11float fmaf(float x, float y, float z){
12 __asm__ (
13 "fmacs %0, %1, %2 \n"
14 : "+t"(z)
15 : "t"(x), "t"(y)
16 );
17 return z;
18}
19
20#elif defined(_ARM64_) || defined(__aarch64__)
21
22/* Use hardware FMA on ARM64. */
23float fmaf(float x, float y, float z){
24 __asm__ (
25 "fmadd %s0, %s1, %s2, %s0 \n"
26 : "+w"(z)
27 : "w"(x), "w"(y)
28 );
29 return z;
30}
31
32#elif defined(_AMD64_) || defined(__x86_64__) || defined(_X86_) || defined(__i386__)
33
34#include <math.h>
35#include <stdint.h>
36
37/* This is in accordance with the IEC 559 single-precision format.
38 * Be advised that due to the hidden bit, the higher half actually has 11 bits.
39 * Multiplying two 13-bit numbers will cause a 1-ULP error, which we cannot
40 * avoid. It is kept in the very last position.
41 */
42typedef union iec559_float_ {
43 struct __attribute__((__packed__)) {
44 uint32_t mlo : 13;
45 uint32_t mhi : 10;
46 uint32_t exp : 8;
47 uint32_t sgn : 1;
48 };
49 float f;
50} iec559_float;
51
52static inline void break_down(iec559_float *restrict lo, iec559_float *restrict hi, float x) {
53 hi->f = x;
54 /* Erase low-order significant bits. `hi->f` now has only 11 significant bits. */
55 hi->mlo = 0;
56 /* Store the low-order half. It will be normalized by the hardware. */
57 lo->f = x - hi->f;
58 /* Preserve signness in case of zero. */
59 lo->sgn = hi->sgn;
60}
61
62float fmaf(float x, float y, float z) {
63 /*
64 POSIX-2013:
65 1. If x or y are NaN, a NaN shall be returned.
66 2. If x multiplied by y is an exact infinity and z is also an infinity
67 but with the opposite sign, a domain error shall occur, and either a NaN
68 (if supported), or an implementation-defined value shall be returned.
69 3. If one of x and y is infinite, the other is zero, and z is not a NaN,
70 a domain error shall occur, and either a NaN (if supported), or an
71 implementation-defined value shall be returned.
72 4. If one of x and y is infinite, the other is zero, and z is a NaN, a NaN
73 shall be returned and a domain error may occur.
74 5. If x* y is not 0*Inf nor Inf*0 and z is a NaN, a NaN shall be returned.
75 */
76 /* Check whether the result is finite. */
77 float ret = x * y + z;
78 if(!isfinite(ret)) {
79 return ret; /* If this naive check doesn't yield a finite value, the FMA isn't
80 likely to return one either. Forward the value as is. */
81 }
82 iec559_float xlo, xhi, ylo, yhi;
83 break_down(&xlo, &xhi, x);
84 break_down(&ylo, &yhi, y);
85 /* The order of these four statements is essential. Don't move them around. */
86 ret = z;
87 ret += xhi.f * yhi.f; /* The most significant item comes first. */
88 ret += xhi.f * ylo.f + xlo.f * yhi.f; /* They are equally significant. */
89 ret += xlo.f * ylo.f; /* The least significant item comes last. */
90 return ret;
91}
92
93#else
94
95#error Please add FMA implementation for this platform.
96
97#endif
lib/libc/mingw/math/fmax.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#include <math.h>
7
8double
9fmax (double _x, double _y)
10{
11 return ( isgreaterequal (_x, _y)|| __isnan (_y) ? _x : _y );
12}
lib/libc/mingw/math/fmaxf.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#include <math.h>
7
8float
9fmaxf (float _x, float _y)
10{
11 return (( isgreaterequal(_x, _y) || __isnanf (_y)) ? _x : _y );
12}
lib/libc/mingw/math/fmin.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#include <math.h>
7
8double
9fmin (double _x, double _y)
10{
11 return ((islessequal(_x, _y) || __isnan (_y)) ? _x : _y );
12}
lib/libc/mingw/math/fminf.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#include <math.h>
7
8float
9fminf (float _x, float _y)
10{
11 return ((islessequal(_x, _y) || __isnanf (_y)) ? _x : _y );
12}
lib/libc/mingw/math/frexp.c deleted-64
...@@ -1,64 +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 */
6double frexp(double value, int* exp);
7
8#if defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__) || \
9 defined(_AMD64_) || defined(__x86_64__) || defined(_X86_) || defined(__i386__)
10
11#include <stdint.h>
12
13/* It is assumed that `double` conforms to IEEE 754 and is little-endian.
14 * This is true on x86 and ARM. */
15
16typedef union ieee754_double_ {
17 struct __attribute__((__packed__)) {
18 uint64_t f52 : 52;
19 uint64_t exp : 11;
20 uint64_t sgn : 1;
21 };
22 double f;
23} ieee754_double;
24
25double frexp(double value, int* exp)
26{
27 int n;
28 ieee754_double reg;
29 reg.f = value;
30 if(reg.exp == 0x7FF) {
31 /* The value is an infinity or NaN.
32 * Store zero in `*exp`. Return the value as is. */
33 *exp = 0;
34 return reg.f;
35 }
36 if(reg.exp != 0) {
37 /* The value is normalized.
38 * Extract and zero out the exponent. */
39 *exp = reg.exp - 0x3FE;
40 reg.exp = 0x3FE;
41 return reg.f;
42 }
43 if(reg.f52 == 0) {
44 /* The value is zero.
45 * Store zero in `*exp`. Return the value as is.
46 * Note the signness. */
47 *exp = 0;
48 return reg.f;
49 }
50 /* The value is denormalized.
51 * Extract the exponent, normalize the value, then zero out
52 * the exponent. Note that the hidden bit is removed. */
53 n = __builtin_clzll(reg.f52) - 11;
54 reg.f52 <<= n;
55 *exp = 1 - 0x3FE - n;
56 reg.exp = 0x3FE;
57 return reg.f;
58}
59
60#else
61
62#error Please add `frexp()` implementation for this platform.
63
64#endif
lib/libc/mingw/math/hypot.c deleted-23
...@@ -1,23 +0,0 @@
1/**
2 * This file is part of the mingw-w64 runtime package.
3 * No warranty is given; refer to the file DISCLAIMER within this package.
4 */
5#define _NEW_COMPLEX_DOUBLE 1
6
7#include "../complex/complex_internal.h"
8#include <errno.h>
9#include <math.h>
10
11double hypot (double x, double y)
12{
13 int x_class = fpclassify (x);
14 int y_class = fpclassify (y);
15
16 if (x_class == FP_INFINITE || y_class == FP_INFINITE)
17 return __FLT_HUGE_VAL;
18 else if (x_class == FP_NAN || y_class == FP_NAN)
19 return __FLT_NAN;
20
21 return _hypot (x, y);
22}
23
lib/libc/mingw/math/llrint.c deleted-42
...@@ -1,42 +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#include <math.h>
7#include <fenv.h>
8
9long long llrint (double x)
10{
11 long long retval = 0ll;
12#if defined(_AMD64_) || defined(__x86_64__) || defined(_X86_) || defined(__i386__)
13 __asm__ __volatile__ ("fistpll %0" : "=m" (retval) : "t" (x) : "st");
14#else
15 int mode = fegetround();
16 if (mode == FE_DOWNWARD)
17 retval = (long long)floor(x);
18 else if (mode == FE_UPWARD)
19 retval = (long long)ceil(x);
20 else if (mode == FE_TOWARDZERO)
21 retval = x >= 0 ? (long long)floor(x) : (long long)ceil(x);
22 else {
23 // Break `x` into integral and fractional parts.
24 double intg, frac;
25 frac = modf(x, &intg);
26 frac = fabs(frac);
27 // Convert the truncated integral part to an integer.
28 retval = intg;
29 if (frac < 0.5) {
30 // Round towards zero.
31 } else if (frac > 0.5) {
32 // Round towards infinities.
33 retval += signbit(x) ? -1 : 1;
34 } else {
35 // Round to the nearest even number.
36 retval += retval % 2;
37 }
38 }
39#endif
40 return retval;
41}
42
lib/libc/mingw/math/llrintf.c deleted-41
...@@ -1,41 +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#include <math.h>
7#include <fenv.h>
8
9long long llrintf (float x)
10{
11 long long retval = 0ll;
12#if defined(_AMD64_) || defined(__x86_64__) || defined(_X86_) || defined(__i386__)
13 __asm__ __volatile__ ("fistpll %0" : "=m" (retval) : "t" (x) : "st");
14#else
15 int mode = fegetround();
16 if (mode == FE_DOWNWARD)
17 retval = (long long)floorf(x);
18 else if (mode == FE_UPWARD)
19 retval = (long long)ceilf(x);
20 else if (mode == FE_TOWARDZERO)
21 retval = x >= 0 ? (long long)floorf(x) : (long long)ceilf(x);
22 else {
23 // Break `x` into integral and fractional parts.
24 float intg, frac;
25 frac = modff(x, &intg);
26 frac = fabsf(frac);
27 // Convert the truncated integral part to an integer.
28 retval = intg;
29 if (frac < 0.5) {
30 // Round towards zero.
31 } else if (frac > 0.5) {
32 // Round towards infinities.
33 retval += signbit(x) ? -1 : 1;
34 } else {
35 // Round to the nearest even number.
36 retval += retval % 2;
37 }
38 }
39#endif
40 return retval;
41}
lib/libc/mingw/math/llround.c deleted-38
...@@ -1,38 +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#include <math.h>
7#include <limits.h>
8#include <errno.h>
9
10long long
11llround (double x)
12{
13 double res;
14
15 if (x >= 0.0)
16 {
17 res = ceil (x);
18 if (res - x > 0.5)
19 res -= 1.0;
20 }
21 else
22 {
23 res = ceil (-x);
24 if (res + x > 0.5)
25 res -= 1.0;
26 res = -res;
27 }
28 if (!isfinite (res)
29 || res > (double) LONG_LONG_MAX
30 || res < (double) LONG_LONG_MIN)
31 {
32 errno = ERANGE;
33 /* Undefined behaviour, so we could return anything. */
34 /* return res > 0.0 ? LONG_LONG_MAX : LONG_LONG_MIN; */
35 }
36 return (long long) res;
37}
38
lib/libc/mingw/math/llroundf.c deleted-38
...@@ -1,38 +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#include <math.h>
7#include <limits.h>
8#include <errno.h>
9
10long long
11llroundf (float x)
12{
13 float res;
14
15 if (x >= 0.0F)
16 {
17 res = ceilf (x);
18 if (res - x > 0.5F)
19 res -= 1.0F;
20 }
21 else
22 {
23 res = ceilf (-x);
24 if (res + x > 0.5F)
25 res -= 1.0F;
26 res = -res;
27 }
28 if (!isfinite (res)
29 || res > (float) LONG_LONG_MAX
30 || res < (float) LONG_LONG_MIN)
31 {
32 errno = ERANGE;
33 /* Undefined behaviour, so we could return anything. */
34 /* return res > 0.0F ? LONG_LONG_MAX : LONG_LONG_MIN; */
35 }
36 return (long long) res;
37}
38
lib/libc/mingw/math/lrint.c deleted-32
...@@ -1,32 +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#include <math.h>
7
8#if defined(_AMD64_) || defined(__x86_64__)
9#include <xmmintrin.h>
10#endif
11
12long lrint (double x)
13{
14 long retval = 0L;
15#if defined(_AMD64_) || defined(__x86_64__)
16 retval = _mm_cvtsd_si32(_mm_load_sd(&x));
17#elif defined(_X86_) || defined(__i386__)
18 __asm__ __volatile__ ("fistpl %0" : "=m" (retval) : "t" (x) : "st");
19#elif defined(__arm__) || defined(_ARM_)
20 float temp;
21 __asm__ __volatile__ (
22 "vcvtr.s32.f64 %[tmp], %[src]\n\t"
23 "fmrs %[dst], %[tmp]\n\t"
24 : [dst] "=r" (retval), [tmp] "=t" (temp) : [src] "w" (x));
25#elif defined(__aarch64__) || defined(_ARM64_)
26 __asm__ __volatile__ (
27 "frintx %d1, %d1\n\t"
28 "fcvtzs %w0, %d1\n\t"
29 : "=r" (retval), "+w" (x));
30#endif
31 return retval;
32}
lib/libc/mingw/math/lrintf.c deleted-31
...@@ -1,31 +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#include <math.h>
7
8#if defined(_AMD64_) || defined(__x86_64__)
9#include <xmmintrin.h>
10#endif
11
12long lrintf (float x)
13{
14 long retval = 0l;
15#if defined(_AMD64_) || defined(__x86_64__)
16 retval = _mm_cvtss_si32(_mm_load_ss(&x));
17#elif defined(_X86_) || defined(__i386__)
18 __asm__ __volatile__ ("fistpl %0" : "=m" (retval) : "t" (x) : "st");
19#elif defined(__arm__) || defined(_ARM_)
20 __asm__ __volatile__ (
21 "vcvtr.s32.f32 %[src], %[src]\n\t"
22 "fmrs %[dst], %[src]\n\t"
23 : [dst] "=r" (retval), [src] "+w" (x));
24#elif defined(__aarch64__) || defined(_ARM64_)
25 __asm__ __volatile__ (
26 "frintx %s1, %s1\n\t"
27 "fcvtzs %w0, %s1\n\t"
28 : "=r" (retval), "+w" (x));
29#endif
30 return retval;
31}
lib/libc/mingw/math/lround.c deleted-37
...@@ -1,37 +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#include <math.h>
7#include <limits.h>
8#include <errno.h>
9
10long
11lround (double x)
12{
13 double res;
14
15 if (x >= 0.0)
16 {
17 res = ceil (x);
18 if (res - x > 0.5)
19 res -= 1.0;
20 }
21 else
22 {
23 res = ceil (-x);
24 if (res + x > 0.5)
25 res -= 1.0;
26 res = -res;
27 }
28 if (!isfinite (res)
29 || res > (double) LONG_MAX
30 || res < (double) LONG_MIN)
31 {
32 errno = ERANGE;
33 /* Undefined behaviour, so we could return anything. */
34 /* return res > 0.0 ? LONG_MAX : LONG_MIN; */
35 }
36 return (long) res;
37}
lib/libc/mingw/math/lroundf.c deleted-37
...@@ -1,37 +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#include <math.h>
7#include <limits.h>
8#include <errno.h>
9
10long
11lroundf (float x)
12{
13 float res;
14
15 if (x >= 0.0F)
16 {
17 res = ceilf (x);
18 if (res - x > 0.5F)
19 res -= 1.0F;
20 }
21 else
22 {
23 res = ceilf (-x);
24 if (res + x > 0.5F)
25 res -= 1.0F;
26 res = -res;
27 }
28 if (!isfinite (res)
29 || res > (float) LONG_MAX
30 || res < (float) LONG_MIN)
31 {
32 errno = ERANGE;
33 /* Undefined behaviour, so we could return anything. */
34 /* return res > 0.0F ? LONG_MAX : LONG_MIN; */
35 }
36 return (long) res;
37}
lib/libc/mingw/math/modf.c deleted-41
...@@ -1,41 +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#include <fenv.h>
7#include <math.h>
8#include <errno.h>
9
10double
11modf (double value, double* iptr)
12{
13 double int_part = 0.0;
14 /* truncate */
15#if defined(_AMD64_) || defined(__x86_64__)
16 asm volatile ("subq $8, %%rsp\n"
17 "fnstcw 4(%%rsp)\n"
18 "movzwl 4(%%rsp), %%eax\n"
19 "orb $12, %%ah\n"
20 "movw %%ax, (%%rsp)\n"
21 "fldcw (%%rsp)\n"
22 "frndint\n"
23 "fldcw 4(%%rsp)\n"
24 "addq $8, %%rsp\n" : "=t" (int_part) : "0" (value) : "eax"); /* round */
25#elif defined(_X86_) || defined(__i386__)
26 asm volatile ("push %%eax\n\tsubl $8, %%esp\n"
27 "fnstcw 4(%%esp)\n"
28 "movzwl 4(%%esp), %%eax\n"
29 "orb $12, %%ah\n"
30 "movw %%ax, (%%esp)\n"
31 "fldcw (%%esp)\n"
32 "frndint\n"
33 "fldcw 4(%%esp)\n"
34 "addl $8, %%esp\n\tpop %%eax\n" : "=t" (int_part) : "0" (value) : "eax"); /* round */
35#else
36 int_part = trunc(value);
37#endif
38 if (iptr)
39 *iptr = int_part;
40 return (isinf (value) ? 0.0 : value - int_part);
41}
lib/libc/mingw/math/nextafterf.c deleted-32
...@@ -1,32 +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#include <math.h>
7
8float
9nextafterf (float x, float y)
10{
11 union
12 {
13 float f;
14 unsigned int i;
15 } u;
16 if (isnan (y) || isnan (x))
17 return x + y;
18 if (x == y )
19 /* nextafter (0.0, -O.0) should return -0.0. */
20 return y;
21 u.f = x;
22 if (x == 0.0F)
23 {
24 u.i = 1;
25 return y > 0.0F ? u.f : -u.f;
26 }
27 if (((x > 0.0F) ^ (y > x)) == 0)
28 u.i++;
29 else
30 u.i--;
31 return u.f;
32}
lib/libc/mingw/math/round.c deleted-26
...@@ -1,26 +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#include <math.h>
7
8double
9round (double x)
10{
11 double res;
12 if (x >= 0.0)
13 {
14 res = ceil (x);
15 if (res - x > 0.5)
16 res -= 1.0;
17 }
18 else
19 {
20 res = ceil (-x);
21 if (res + x > 0.5)
22 res -= 1.0;
23 res = -res;
24 }
25 return res;
26}
lib/libc/mingw/math/roundf.c deleted-26
...@@ -1,26 +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#include <math.h>
7
8float
9roundf (float x)
10{
11 float res;
12 if (x >= 0.0F)
13 {
14 res = ceilf (x);
15 if (res - x > 0.5F)
16 res -= 1.0F;
17 }
18 else
19 {
20 res = ceilf (-x);
21 if (res + x > 0.5F)
22 res -= 1.0F;
23 res = -res;
24 }
25 return res;
26}
lib/libc/mingw/math/s_erf.c deleted-347
...@@ -1,347 +0,0 @@
1/* @(#)s_erf.c 1.3 95/01/18 */
2/*
3 * ====================================================
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
5 *
6 * Developed at SunSoft, a Sun Microsystems, Inc. business.
7 * Permission to use, copy, modify, and distribute this
8 * software is freely granted, provided that this notice
9 * is preserved.
10 * ====================================================
11 */
12
13/* double erf(double x)
14 * double erfc(double x)
15 * x
16 * 2 |\
17 * erf(x) = --------- | exp(-t*t)dt
18 * sqrt(pi) \|
19 * 0
20 *
21 * erfc(x) = 1-erf(x)
22 * Note that
23 * erf(-x) = -erf(x)
24 * erfc(-x) = 2 - erfc(x)
25 *
26 * Method:
27 * 1. For |x| in [0, 0.84375]
28 * erf(x) = x + x*R(x^2)
29 * erfc(x) = 1 - erf(x) if x in [-.84375,0.25]
30 * = 0.5 + ((0.5-x)-x*R) if x in [0.25,0.84375]
31 * where R = P/Q where P is an odd poly of degree 8 and
32 * Q is an odd poly of degree 10.
33 * -57.90
34 * | R - (erf(x)-x)/x | <= 2
35 *
36 * Remark. The formula is derived by noting
37 * erf(x) = (2/sqrt(pi))*(x - x^3/3 + x^5/10 - x^7/42 + ....)
38 * and that
39 * 2/sqrt(pi) = 1.128379167095512573896158903121545171688
40 * is close to one. The interval is chosen because the fix
41 * point of erf(x) is near 0.6174 (i.e., erf(x)=x when x is
42 * near 0.6174), and by some experiment, 0.84375 is chosen to
43 * guarantee the error is less than one ulp for erf.
44 *
45 * 2. For |x| in [0.84375,1.25], let s = |x| - 1, and
46 * c = 0.84506291151 rounded to single (24 bits)
47 * erf(x) = sign(x) * (c + P1(s)/Q1(s))
48 * erfc(x) = (1-c) - P1(s)/Q1(s) if x > 0
49 * 1+(c+P1(s)/Q1(s)) if x < 0
50 * |P1/Q1 - (erf(|x|)-c)| <= 2**-59.06
51 * Remark: here we use the taylor series expansion at x=1.
52 * erf(1+s) = erf(1) + s*Poly(s)
53 * = 0.845.. + P1(s)/Q1(s)
54 * That is, we use rational approximation to approximate
55 * erf(1+s) - (c = (single)0.84506291151)
56 * Note that |P1/Q1|< 0.078 for x in [0.84375,1.25]
57 * where
58 * P1(s) = degree 6 poly in s
59 * Q1(s) = degree 6 poly in s
60 *
61 * 3. For x in [1.25,1/0.35(~2.857143)],
62 * erfc(x) = (1/x)*exp(-x*x-0.5625+R1/S1)
63 * erf(x) = 1 - erfc(x)
64 * where
65 * R1(z) = degree 7 poly in z, (z=1/x^2)
66 * S1(z) = degree 8 poly in z
67 *
68 * 4. For x in [1/0.35,28]
69 * erfc(x) = (1/x)*exp(-x*x-0.5625+R2/S2) if x > 0
70 * = 2.0 - (1/x)*exp(-x*x-0.5625+R2/S2) if -6<x<0
71 * = 2.0 - tiny (if x <= -6)
72 * erf(x) = sign(x)*(1.0 - erfc(x)) if x < 6, else
73 * erf(x) = sign(x)*(1.0 - tiny)
74 * where
75 * R2(z) = degree 6 poly in z, (z=1/x^2)
76 * S2(z) = degree 7 poly in z
77 *
78 * Note1:
79 * To compute exp(-x*x-0.5625+R/S), let s be a single
80 * precision number and s := x; then
81 * -x*x = -s*s + (s-x)*(s+x)
82 * exp(-x*x-0.5626+R/S) =
83 * exp(-s*s-0.5625)*exp((s-x)*(s+x)+R/S);
84 * Note2:
85 * Here 4 and 5 make use of the asymptotic series
86 * exp(-x*x)
87 * erfc(x) ~ ---------- * ( 1 + Poly(1/x^2) )
88 * x*sqrt(pi)
89 * We use rational approximation to approximate
90 * g(s)=f(1/x^2) = log(erfc(x)*x) - x*x + 0.5625
91 * Here is the error bound for R1/S1 and R2/S2
92 * |R1/S1 - f(x)| < 2**(-62.57)
93 * |R2/S2 - f(x)| < 2**(-61.52)
94 *
95 * 5. For inf > x >= 28
96 * erf(x) = sign(x) *(1 - tiny) (raise inexact)
97 * erfc(x) = tiny*tiny (raise underflow) if x > 0
98 * = 2 - tiny if x<0
99 *
100 * 7. Special case:
101 * erf(0) = 0, erf(inf) = 1, erf(-inf) = -1,
102 * erfc(0) = 1, erfc(inf) = 0, erfc(-inf) = 2,
103 * erfc/erf(NaN) is NaN
104 */
105
106
107/* #include "fdlibm.h" */
108
109#include <math.h>
110#include <stdint.h>
111#include <errno.h>
112
113#define __ieee754_exp exp
114
115typedef union
116{
117 double value;
118 struct
119 {
120 uint32_t lsw;
121 uint32_t msw;
122 } parts;
123} ieee_double_shape_type;
124
125
126static inline int __get_hi_word(const double x)
127{
128 ieee_double_shape_type u;
129 u.value = x;
130 return u.parts.msw;
131}
132
133static inline void __trunc_lo_word(double *x)
134{
135 ieee_double_shape_type u;
136 u.value = *x;
137 u.parts.lsw = 0;
138 *x = u.value;
139}
140
141
142static const double
143 tiny= 1e-300,
144 half= 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */
145 one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
146 two = 2.00000000000000000000e+00, /* 0x40000000, 0x00000000 */
147 /* c = (float)0.84506291151 */
148 erx = 8.45062911510467529297e-01, /* 0x3FEB0AC1, 0x60000000 */
149 /*
150 * Coefficients for approximation to erf on [0,0.84375]
151 */
152 efx = 1.28379167095512586316e-01, /* 0x3FC06EBA, 0x8214DB69 */
153 efx8= 1.02703333676410069053e+00, /* 0x3FF06EBA, 0x8214DB69 */
154 pp0 = 1.28379167095512558561e-01, /* 0x3FC06EBA, 0x8214DB68 */
155 pp1 = -3.25042107247001499370e-01, /* 0xBFD4CD7D, 0x691CB913 */
156 pp2 = -2.84817495755985104766e-02, /* 0xBF9D2A51, 0xDBD7194F */
157 pp3 = -5.77027029648944159157e-03, /* 0xBF77A291, 0x236668E4 */
158 pp4 = -2.37630166566501626084e-05, /* 0xBEF8EAD6, 0x120016AC */
159 qq1 = 3.97917223959155352819e-01, /* 0x3FD97779, 0xCDDADC09 */
160 qq2 = 6.50222499887672944485e-02, /* 0x3FB0A54C, 0x5536CEBA */
161 qq3 = 5.08130628187576562776e-03, /* 0x3F74D022, 0xC4D36B0F */
162 qq4 = 1.32494738004321644526e-04, /* 0x3F215DC9, 0x221C1A10 */
163 qq5 = -3.96022827877536812320e-06, /* 0xBED09C43, 0x42A26120 */
164 /*
165 * Coefficients for approximation to erf in [0.84375,1.25]
166 */
167 pa0 = -2.36211856075265944077e-03, /* 0xBF6359B8, 0xBEF77538 */
168 pa1 = 4.14856118683748331666e-01, /* 0x3FDA8D00, 0xAD92B34D */
169 pa2 = -3.72207876035701323847e-01, /* 0xBFD7D240, 0xFBB8C3F1 */
170 pa3 = 3.18346619901161753674e-01, /* 0x3FD45FCA, 0x805120E4 */
171 pa4 = -1.10894694282396677476e-01, /* 0xBFBC6398, 0x3D3E28EC */
172 pa5 = 3.54783043256182359371e-02, /* 0x3FA22A36, 0x599795EB */
173 pa6 = -2.16637559486879084300e-03, /* 0xBF61BF38, 0x0A96073F */
174 qa1 = 1.06420880400844228286e-01, /* 0x3FBB3E66, 0x18EEE323 */
175 qa2 = 5.40397917702171048937e-01, /* 0x3FE14AF0, 0x92EB6F33 */
176 qa3 = 7.18286544141962662868e-02, /* 0x3FB2635C, 0xD99FE9A7 */
177 qa4 = 1.26171219808761642112e-01, /* 0x3FC02660, 0xE763351F */
178 qa5 = 1.36370839120290507362e-02, /* 0x3F8BEDC2, 0x6B51DD1C */
179 qa6 = 1.19844998467991074170e-02, /* 0x3F888B54, 0x5735151D */
180 /*
181 * Coefficients for approximation to erfc in [1.25,1/0.35]
182 */
183 ra0 = -9.86494403484714822705e-03, /* 0xBF843412, 0x600D6435 */
184 ra1 = -6.93858572707181764372e-01, /* 0xBFE63416, 0xE4BA7360 */
185 ra2 = -1.05586262253232909814e+01, /* 0xC0251E04, 0x41B0E726 */
186 ra3 = -6.23753324503260060396e+01, /* 0xC04F300A, 0xE4CBA38D */
187 ra4 = -1.62396669462573470355e+02, /* 0xC0644CB1, 0x84282266 */
188 ra5 = -1.84605092906711035994e+02, /* 0xC067135C, 0xEBCCABB2 */
189 ra6 = -8.12874355063065934246e+01, /* 0xC0545265, 0x57E4D2F2 */
190 ra7 = -9.81432934416914548592e+00, /* 0xC023A0EF, 0xC69AC25C */
191 sa1 = 1.96512716674392571292e+01, /* 0x4033A6B9, 0xBD707687 */
192 sa2 = 1.37657754143519042600e+02, /* 0x4061350C, 0x526AE721 */
193 sa3 = 4.34565877475229228821e+02, /* 0x407B290D, 0xD58A1A71 */
194 sa4 = 6.45387271733267880336e+02, /* 0x40842B19, 0x21EC2868 */
195 sa5 = 4.29008140027567833386e+02, /* 0x407AD021, 0x57700314 */
196 sa6 = 1.08635005541779435134e+02, /* 0x405B28A3, 0xEE48AE2C */
197 sa7 = 6.57024977031928170135e+00, /* 0x401A47EF, 0x8E484A93 */
198 sa8 = -6.04244152148580987438e-02, /* 0xBFAEEFF2, 0xEE749A62 */
199 /*
200 * Coefficients for approximation to erfc in [1/.35,28]
201 */
202 rb0 = -9.86494292470009928597e-03, /* 0xBF843412, 0x39E86F4A */
203 rb1 = -7.99283237680523006574e-01, /* 0xBFE993BA, 0x70C285DE */
204 rb2 = -1.77579549177547519889e+01, /* 0xC031C209, 0x555F995A */
205 rb3 = -1.60636384855821916062e+02, /* 0xC064145D, 0x43C5ED98 */
206 rb4 = -6.37566443368389627722e+02, /* 0xC083EC88, 0x1375F228 */
207 rb5 = -1.02509513161107724954e+03, /* 0xC0900461, 0x6A2E5992 */
208 rb6 = -4.83519191608651397019e+02, /* 0xC07E384E, 0x9BDC383F */
209 sb1 = 3.03380607434824582924e+01, /* 0x403E568B, 0x261D5190 */
210 sb2 = 3.25792512996573918826e+02, /* 0x40745CAE, 0x221B9F0A */
211 sb3 = 1.53672958608443695994e+03, /* 0x409802EB, 0x189D5118 */
212 sb4 = 3.19985821950859553908e+03, /* 0x40A8FFB7, 0x688C246A */
213 sb5 = 2.55305040643316442583e+03, /* 0x40A3F219, 0xCEDF3BE6 */
214 sb6 = 4.74528541206955367215e+02, /* 0x407DA874, 0xE79FE763 */
215 sb7 = -2.24409524465858183362e+01; /* 0xC03670E2, 0x42712D62 */
216
217
218double erf(double x)
219{
220 int hx, ix, i;
221 double R, S, P, Q, s, y, z, r;
222 hx = __get_hi_word(x);
223 ix = hx & 0x7fffffff;
224 if (ix >= 0x7ff00000) { /* erf(nan)=nan */
225 i = ((unsigned)hx>>31)<<1;
226 return (double)(1-i)+one/x; /* erf(+-inf)=+-1 */
227 }
228
229 if (ix < 0x3feb0000) { /* |x|<0.84375 */
230 if (ix < 0x3e300000) { /* |x|<2**-28 */
231 if (ix < 0x00800000)
232 return 0.125*(8.0*x+efx8*x); /*avoid underflow */
233 return x + efx*x;
234 }
235 z = x*x;
236 r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4)));
237 s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5))));
238 y = r/s;
239 return x + x*y;
240 }
241 if (ix < 0x3ff40000) { /* 0.84375 <= |x| < 1.25 */
242 s = fabs(x)-one;
243 P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6)))));
244 Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6)))));
245 if (hx >= 0)
246 return erx + P/Q;
247 else
248 return -erx - P/Q;
249 }
250 if (ix >= 0x40180000) { /* inf>|x|>=6 */
251 if (hx >= 0)
252 return one-tiny;
253 else
254 return tiny-one;
255 }
256 x = fabs(x);
257 s = one/(x*x);
258 if (ix < 0x4006DB6E) { /* |x| < 1/0.35 */
259 R = ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(
260 ra5+s*(ra6+s*ra7))))));
261 S = one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(
262 sa5+s*(sa6+s*(sa7+s*sa8)))))));
263 } else { /* |x| >= 1/0.35 */
264 R = rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(
265 rb5+s*rb6)))));
266 S = one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(
267 sb5+s*(sb6+s*sb7))))));
268 }
269 z = x;
270 __trunc_lo_word(&z);
271 r = __ieee754_exp(-z*z-0.5625)*__ieee754_exp((z-x)*(z+x)+R/S);
272 if (hx >= 0)
273 return one-r/x;
274 else
275 return r/x-one;
276}
277
278double erfc(double x)
279{
280 int hx,ix;
281 double R,S,P,Q,s,y,z,r;
282 hx = __get_hi_word(x);
283 ix = hx&0x7fffffff;
284 if (ix >= 0x7ff00000) { /* erfc(nan)=nan */
285 /* erfc(+-inf)=0,2 */
286 return (double)(((unsigned)hx>>31)<<1)+one/x;
287 }
288
289 if (ix < 0x3feb0000) { /* |x|<0.84375 */
290 if (ix < 0x3c700000) /* |x|<2**-56 */
291 return one-x;
292 z = x*x;
293 r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4)));
294 s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5))));
295 y = r/s;
296 if (hx < 0x3fd00000) { /* x<1/4 */
297 return one-(x+x*y);
298 } else {
299 r = x*y;
300 r += (x-half);
301 return half - r ;
302 }
303 }
304 if (ix < 0x3ff40000) { /* 0.84375 <= |x| < 1.25 */
305 s = fabs(x)-one;
306 P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6)))));
307 Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6)))));
308 if (hx >= 0) {
309 z = one-erx; return z - P/Q;
310 } else {
311 z = erx+P/Q; return one+z;
312 }
313 }
314 if (ix < 0x403c0000) { /* |x|<28 */
315 x = fabs(x);
316 s = one/(x*x);
317 if (ix < 0x4006DB6D) { /* |x| < 1/.35 ~ 2.857143*/
318 R = ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(
319 ra5+s*(ra6+s*ra7))))));
320 S = one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(
321 sa5+s*(sa6+s*(sa7+s*sa8)))))));
322 } else { /* |x| >= 1/.35 ~ 2.857143 */
323 if (hx < 0 && ix >= 0x40180000)
324 return two-tiny; /* x < -6 */
325 R = rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(
326 rb5+s*rb6)))));
327 S = one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(
328 sb5+s*(sb6+s*sb7))))));
329 }
330 z = x;
331 __trunc_lo_word(&z);
332 r = __ieee754_exp(-z*z-0.5625)*
333 __ieee754_exp((z-x)*(z+x)+R/S);
334 if (hx > 0)
335 return r/x;
336 else
337 return two-r/x;
338 } else {
339 /* set range error */
340 errno = ERANGE;
341 if (hx > 0)
342 return tiny*tiny;
343 else
344 return two-tiny;
345 }
346}
347
lib/libc/mingw/math/sf_erf.c deleted-268
...@@ -1,268 +0,0 @@
1/* sf_erf.c -- float version of s_erf.c.
2 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
3 */
4
5/*
6 * ====================================================
7 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
8 *
9 * Developed at SunPro, a Sun Microsystems, Inc. business.
10 * Permission to use, copy, modify, and distribute this
11 * software is freely granted, provided that this notice
12 * is preserved.
13 * ====================================================
14 */
15
16/*
17#include "fdlibm.h"
18*/
19#include <math.h>
20#include <stdint.h>
21#include <errno.h>
22
23#define __ieee754_expf expf
24
25typedef union
26{
27 float value;
28 uint32_t word;
29} ieee_float_shape_type;
30
31/* Get a 32 bit int from a float. */
32
33static inline int
34__get_float_word(float d)
35{
36 ieee_float_shape_type u;
37 u.value = d;
38 return u.word;
39}
40
41/* Set a float from a 32 bit int. */
42
43#define SET_FLOAT_WORD(d,i) \
44do { \
45 ieee_float_shape_type sf_u; \
46 sf_u.word = (i); \
47 (d) = sf_u.value; \
48} while (0)
49
50static inline void __trunc_float_word(float * x)
51{
52 ieee_float_shape_type u;
53 u.value = * x;
54 u.word &= 0xfffff000;
55}
56
57#ifdef __v810__
58#define const
59#endif
60
61static const float
62 tiny= 1e-30,
63 half= 5.0000000000e-01, /* 0x3F000000 */
64 one = 1.0000000000e+00, /* 0x3F800000 */
65 two = 2.0000000000e+00, /* 0x40000000 */
66 /* c = (subfloat)0.84506291151 */
67 erx = 8.4506291151e-01, /* 0x3f58560b */
68 /*
69 * Coefficients for approximation to erf on [0,0.84375]
70 */
71 efx = 1.2837916613e-01, /* 0x3e0375d4 */
72 efx8= 1.0270333290e+00, /* 0x3f8375d4 */
73 pp0 = 1.2837916613e-01, /* 0x3e0375d4 */
74 pp1 = -3.2504209876e-01, /* 0xbea66beb */
75 pp2 = -2.8481749818e-02, /* 0xbce9528f */
76 pp3 = -5.7702702470e-03, /* 0xbbbd1489 */
77 pp4 = -2.3763017452e-05, /* 0xb7c756b1 */
78 qq1 = 3.9791721106e-01, /* 0x3ecbbbce */
79 qq2 = 6.5022252500e-02, /* 0x3d852a63 */
80 qq3 = 5.0813062117e-03, /* 0x3ba68116 */
81 qq4 = 1.3249473704e-04, /* 0x390aee49 */
82 qq5 = -3.9602282413e-06, /* 0xb684e21a */
83 /*
84 * Coefficients for approximation to erf in [0.84375,1.25]
85 */
86 pa0 = -2.3621185683e-03, /* 0xbb1acdc6 */
87 pa1 = 4.1485610604e-01, /* 0x3ed46805 */
88 pa2 = -3.7220788002e-01, /* 0xbebe9208 */
89 pa3 = 3.1834661961e-01, /* 0x3ea2fe54 */
90 pa4 = -1.1089469492e-01, /* 0xbde31cc2 */
91 pa5 = 3.5478305072e-02, /* 0x3d1151b3 */
92 pa6 = -2.1663755178e-03, /* 0xbb0df9c0 */
93 qa1 = 1.0642088205e-01, /* 0x3dd9f331 */
94 qa2 = 5.4039794207e-01, /* 0x3f0a5785 */
95 qa3 = 7.1828655899e-02, /* 0x3d931ae7 */
96 qa4 = 1.2617121637e-01, /* 0x3e013307 */
97 qa5 = 1.3637083583e-02, /* 0x3c5f6e13 */
98 qa6 = 1.1984500103e-02, /* 0x3c445aa3 */
99 /*
100 * Coefficients for approximation to erfc in [1.25,1/0.35]
101 */
102 ra0 = -9.8649440333e-03, /* 0xbc21a093 */
103 ra1 = -6.9385856390e-01, /* 0xbf31a0b7 */
104 ra2 = -1.0558626175e+01, /* 0xc128f022 */
105 ra3 = -6.2375331879e+01, /* 0xc2798057 */
106 ra4 = -1.6239666748e+02, /* 0xc322658c */
107 ra5 = -1.8460508728e+02, /* 0xc3389ae7 */
108 ra6 = -8.1287437439e+01, /* 0xc2a2932b */
109 ra7 = -9.8143291473e+00, /* 0xc11d077e */
110 sa1 = 1.9651271820e+01, /* 0x419d35ce */
111 sa2 = 1.3765776062e+02, /* 0x4309a863 */
112 sa3 = 4.3456588745e+02, /* 0x43d9486f */
113 sa4 = 6.4538726807e+02, /* 0x442158c9 */
114 sa5 = 4.2900814819e+02, /* 0x43d6810b */
115 sa6 = 1.0863500214e+02, /* 0x42d9451f */
116 sa7 = 6.5702495575e+00, /* 0x40d23f7c */
117 sa8 = -6.0424413532e-02, /* 0xbd777f97 */
118 /*
119 * Coefficients for approximation to erfc in [1/.35,28]
120 */
121 rb0 = -9.8649431020e-03, /* 0xbc21a092 */
122 rb1 = -7.9928326607e-01, /* 0xbf4c9dd4 */
123 rb2 = -1.7757955551e+01, /* 0xc18e104b */
124 rb3 = -1.6063638306e+02, /* 0xc320a2ea */
125 rb4 = -6.3756646729e+02, /* 0xc41f6441 */
126 rb5 = -1.0250950928e+03, /* 0xc480230b */
127 rb6 = -4.8351919556e+02, /* 0xc3f1c275 */
128 sb1 = 3.0338060379e+01, /* 0x41f2b459 */
129 sb2 = 3.2579251099e+02, /* 0x43a2e571 */
130 sb3 = 1.5367296143e+03, /* 0x44c01759 */
131 sb4 = 3.1998581543e+03, /* 0x4547fdbb */
132 sb5 = 2.5530502930e+03, /* 0x451f90ce */
133 sb6 = 4.7452853394e+02, /* 0x43ed43a7 */
134 sb7 = -2.2440952301e+01; /* 0xc1b38712 */
135
136float erff(float x)
137{
138 int32_t hx, ix, i;
139 float R, S, P, Q, s, y, z, r;
140 hx = __get_float_word(x);
141 ix = hx & 0x7fffffff;
142 if (!(ix<0x7f800000L)) { /* erf(nan)=nan */
143 i = ((uint32_t)hx>>31)<<1;
144 return (float)(1-i)+one/x; /* erf(+-inf)=+-1 */
145 }
146
147 if (ix < 0x3f580000) { /* |x|<0.84375 */
148 if (ix < 0x31800000) { /* |x|<2**-28 */
149 if (ix < 0x04000000)
150 /*avoid underflow */
151 return (float)0.125*((float)8.0*x+efx8*x);
152 return x + efx*x;
153 }
154 z = x*x;
155 r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4)));
156 s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5))));
157 y = r/s;
158 return x + x*y;
159 }
160 if (ix < 0x3fa00000) { /* 0.84375 <= |x| < 1.25 */
161 s = fabsf(x)-one;
162 P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6)))));
163 Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6)))));
164 if (hx >= 0)
165 return erx + P/Q;
166 else
167 return -erx - P/Q;
168 }
169 if (ix >= 0x40c00000) { /* inf>|x|>=6 */
170 if (hx >= 0)
171 return one-tiny;
172 else
173 return tiny-one;
174 }
175 x = fabsf(x);
176 s = one/(x*x);
177 if (ix< 0x4036DB6E) { /* |x| < 1/0.35 */
178 R = ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(
179 ra5+s*(ra6+s*ra7))))));
180 S = one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(
181 sa5+s*(sa6+s*(sa7+s*sa8)))))));
182 } else { /* |x| >= 1/0.35 */
183 R = rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(
184 rb5+s*rb6)))));
185 S = one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(
186 sb5+s*(sb6+s*sb7))))));
187 }
188
189 z = x;
190 __trunc_float_word (&z);
191 r = __ieee754_expf(-z*z-(float)0.5625)*__ieee754_expf((z-x)*(z+x)+R/S);
192 if (hx >= 0)
193 return one-r/x;
194 else
195 return r/x-one;
196}
197
198float erfcf(float x)
199{
200 int32_t hx, ix;
201 float R, S, P, Q, s, y, z, r;
202 hx = __get_float_word(x);
203 ix = hx & 0x7fffffff;
204 if (!(ix < 0x7f800000L)) { /* erfc(nan)=nan */
205 /* erfc(+-inf)=0,2 */
206 return (float)(((uint32_t)hx>>31)<<1)+one/x;
207 }
208
209 if (ix < 0x3f580000) { /* |x|<0.84375 */
210 if (ix < 0x23800000) /* |x|<2**-56 */
211 return one-x;
212 z = x*x;
213 r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4)));
214 s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5))));
215 y = r/s;
216 if (hx < 0x3e800000) { /* x<1/4 */
217 return one-(x+x*y);
218 } else {
219 r = x*y;
220 r += (x-half);
221 return half - r ;
222 }
223 }
224 if (ix < 0x3fa00000) { /* 0.84375 <= |x| < 1.25 */
225 s = fabsf(x)-one;
226 P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6)))));
227 Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6)))));
228 if (hx >= 0) {
229 z = one-erx; return z - P/Q;
230 } else {
231 z = erx+P/Q; return one+z;
232 }
233 }
234
235 if (ix < 0x41e00000) { /* |x|<28 */
236 x = fabsf(x);
237 s = one/(x*x);
238 if (ix< 0x4036DB6D) { /* |x| < 1/.35 ~ 2.857143*/
239 R = ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(
240 ra5+s*(ra6+s*ra7))))));
241 S = one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(
242 sa5+s*(sa6+s*(sa7+s*sa8)))))));
243 } else { /* |x| >= 1/.35 ~ 2.857143 */
244 if (hx < 0 && ix >= 0x40c00000)
245 return two-tiny;/* x < -6 */
246 R = rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(
247 rb5+s*rb6)))));
248 S = one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(
249 sb5+s*(sb6+s*sb7))))));
250 }
251
252 z = x;
253 __trunc_float_word (&z);
254 r = __ieee754_expf(-z*z-(float)0.5625)*
255 __ieee754_expf((z-x)*(z+x)+R/S);
256 if (hx > 0)
257 return r/x;
258 else
259 return two-r/x;
260 } else {
261 /* set range error */
262 errno = ERANGE;
263 if (hx > 0)
264 return tiny*tiny;
265 else
266 return two-tiny;
267 }
268}
lib/libc/mingw/math/sqrt.c deleted-47
...@@ -1,47 +0,0 @@
1/*
2 This Software is provided under the Zope Public License (ZPL) Version 2.1.
3
4 Copyright (c) 2009, 2010 by the mingw-w64 project
5
6 See the AUTHORS file for the list of contributors to the mingw-w64 project.
7
8 This license has been certified as open source. It has also been designated
9 as GPL compatible by the Free Software Foundation (FSF).
10
11 Redistribution and use in source and binary forms, with or without
12 modification, are permitted provided that the following conditions are met:
13
14 1. Redistributions in source code must retain the accompanying copyright
15 notice, this list of conditions, and the following disclaimer.
16 2. Redistributions in binary form must reproduce the accompanying
17 copyright notice, this list of conditions, and the following disclaimer
18 in the documentation and/or other materials provided with the
19 distribution.
20 3. Names of the copyright holders must not be used to endorse or promote
21 products derived from this software without prior written permission
22 from the copyright holders.
23 4. The right to distribute this software or to use it for any purpose does
24 not give you the right to use Servicemarks (sm) or Trademarks (tm) of
25 the copyright holders. Use of them is covered by separate agreement
26 with the copyright holders.
27 5. If any files are modified, you must cause the modified files to carry
28 prominent notices stating that you changed the files and the date of
29 any change.
30
31 Disclaimer
32
33 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
34 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
35 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
36 EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
37 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
39 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
40 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
42 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43*/
44
45#define _NEW_COMPLEX_DOUBLE 1
46#define X64_ASM "sqrtsd"
47#include "sqrt.def.h"
lib/libc/mingw/math/tgamma.c deleted-268
...@@ -1,268 +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#include "cephes_mconf.h"
7
8#ifdef UNK
9static const uD P[7] = {
10 { { 1.60119522476751861407E-4 } },
11 { { 1.19135147006586384913E-3 } },
12 { { 1.04213797561761569935E-2 } },
13 { { 4.76367800457137231464E-2 } },
14 { { 2.07448227648435975150E-1 } },
15 { { 4.94214826801497100753E-1 } },
16 { { 9.99999999999999996796E-1 } }
17};
18static const uD Q[8] = {
19 { { -2.31581873324120129819E-5 } },
20 { { 5.39605580493303397842E-4 } },
21 { { -4.45641913851797240494E-3 } },
22 { { 1.18139785222060435552E-2 } },
23 { { 3.58236398605498653373E-2 } },
24 { { -2.34591795718243348568E-1 } },
25 { { 7.14304917030273074085E-2 } },
26 { { 1.00000000000000000320E0 } }
27};
28#define MAXGAM 171.624376956302725
29static const double LOGPI = 1.14472988584940017414;
30#endif
31
32#ifdef IBMPC
33static const uD P[7] = {
34 { { 0x2153,0x3998,0xfcb8,0x3f24 } },
35 { { 0xbfab,0xe686,0x84e3,0x3f53 } },
36 { { 0x14b0,0xe9db,0x57cd,0x3f85 } },
37 { { 0x23d3,0x18c4,0x63d9,0x3fa8 } },
38 { { 0x7d31,0xdcae,0x8da9,0x3fca } },
39 { { 0xe312,0x3993,0xa137,0x3fdf } },
40 { { 0x0000,0x0000,0x0000,0x3ff0 } }
41};
42static const uD Q[8] = {
43 { { 0xd3af,0x8400,0x487a,0xbef8 } },
44 { { 0x2573,0x2915,0xae8a,0x3f41 } },
45 { { 0xb44a,0xe750,0x40e4,0xbf72 } },
46 { { 0xb117,0x5b1b,0x31ed,0x3f88 } },
47 { { 0xde67,0xe33f,0x5779,0x3fa2 } },
48 { { 0x87c2,0x9d42,0x071a,0xbfce } },
49 { { 0x3c51,0xc9cd,0x4944,0x3fb2 } },
50 { { 0x0000,0x0000,0x0000,0x3ff0 } }
51};
52#define MAXGAM 171.624376956302725
53#endif
54
55#ifdef MIEEE
56static const uD P[7] = {
57 { { 0x3f24,0xfcb8,0x3998,0x2153 } },
58 { { 0x3f53,0x84e3,0xe686,0xbfab } },
59 { { 0x3f85,0x57cd,0xe9db,0x14b0 } },
60 { { 0x3fa8,0x63d9,0x18c4,0x23d3 } },
61 { { 0x3fca,0x8da9,0xdcae,0x7d31 } },
62 { { 0x3fdf,0xa137,0x3993,0xe312 } },
63 { { 0x3ff0,0x0000,0x0000,0x0000 } }
64};
65static const unsigned short Q[8] = {
66 { { 0xbef8,0x487a,0x8400,0xd3af } },
67 { { 0x3f41,0xae8a,0x2915,0x2573 } },
68 { { 0xbf72,0x40e4,0xe750,0xb44a } },
69 { { 0x3f88,0x31ed,0x5b1b,0xb117 } },
70 { { 0x3fa2,0x5779,0xe33f,0xde67 } },
71 { { 0xbfce,0x071a,0x9d42,0x87c2 } },
72 { { 0x3fb2,0x4944,0xc9cd,0x3c51 } },
73 { { 0x3ff0,0x0000,0x0000,0x0000 } }
74};
75#define MAXGAM 171.624376956302725
76#endif
77
78/* Stirling's formula for the gamma function */
79#if UNK
80static const uD STIR[5] = {
81 { { 7.87311395793093628397E-4 } },
82 { { -2.29549961613378126380E-4 } },
83 { { -2.68132617805781232825E-3 } },
84 { { 3.47222221605458667310E-3 } },
85 { { 8.33333333333482257126E-2 } }
86};
87#define MAXSTIR 143.01608
88static const double SQTPI = 2.50662827463100050242E0;
89#endif
90#if IBMPC
91static const uD STIR[5] = {
92 { { 0x7293,0x592d,0xcc72,0x3f49 } },
93 { { 0x1d7c,0x27e6,0x166b,0xbf2e } },
94 { { 0x4fd7,0x07d4,0xf726,0xbf65 } },
95 { { 0xc5fd,0x1b98,0x71c7,0x3f6c } },
96 { { 0x5986,0x5555,0x5555,0x3fb5 } }
97};
98#define MAXSTIR 143.01608
99
100static const union
101{
102 unsigned short s[4];
103 double d;
104} sqt = {{0x2706,0x1ff6,0x0d93,0x4004}};
105#define SQTPI (sqt.d)
106#endif
107#if MIEEE
108static const uD STIR[5] = {
109 { { 0x3f49,0xcc72,0x592d,0x7293 } },
110 { { 0xbf2e,0x166b,0x27e6,0x1d7c } },
111 { { 0xbf65,0xf726,0x07d4,0x4fd7 } },
112 { { 0x3f6c,0x71c7,0x1b98,0xc5fd } },
113 { { 0x3fb5,0x5555,0x5555,0x5986 } }
114};
115#define MAXSTIR 143.01608
116static const uD SQT = {
117 { { 0x4004,0x0d93,0x1ff6,0x2706 } }
118};
119#define SQTPI SQT.d
120#endif
121
122static double stirf (double);
123
124/* Gamma function computed by Stirling's formula.
125 * The polynomial STIR is valid for 33 <= x <= 172.
126 */
127static double stirf(double x)
128{
129 double y, w, v;
130
131 w = 1.0/x;
132 w = 1.0 + w * polevl(w, STIR, 4);
133 y = exp(x);
134 if (x > MAXSTIR)
135 { /* Avoid overflow in pow() */
136 v = pow(x, 0.5 * x - 0.25);
137 y = v * (v / y);
138 }
139 else
140 {
141 y = pow(x, x - 0.5) / y;
142 }
143 y = SQTPI * y * w;
144 return (y);
145}
146
147
148double __tgamma_r(double x, int *sgngam);
149
150double __tgamma_r(double x, int *sgngam)
151{
152 double p, q, z;
153 int i;
154
155 *sgngam = 1;
156#ifdef NANS
157 if (isnan(x))
158 return (x);
159#endif
160#ifdef INFINITIES
161#ifdef NANS
162 if (x == INFINITY)
163 return (x);
164 if (x == -INFINITY)
165 return (NAN);
166#else
167 if (!isfinite(x))
168 return (x);
169#endif
170#endif
171 if (x == 0.0)
172 return copysign(HUGE_VAL, x);
173
174 q = fabs(x);
175
176 if (q > 33.0)
177 {
178 if (x < 0.0)
179 {
180 p = floor(q);
181 if (p == q)
182 {
183gsing:
184 _SET_ERRNO(EDOM);
185 mtherr("tgamma", SING);
186#ifdef NANS
187 return (NAN);
188#else
189 return (MAXNUM);
190#endif
191 }
192 i = p;
193 if ((i & 1) == 0)
194 *sgngam = -1;
195 z = q - p;
196 if (z > 0.5)
197 {
198 p += 1.0;
199 z = q - p;
200 }
201 z = q * sin(PI * z);
202 if (z == 0.0)
203 {
204 _SET_ERRNO(ERANGE);
205 mtherr("tgamma", OVERFLOW);
206#ifdef INFINITIES
207 return (*sgngam * INFINITY);
208#else
209 return (*sgngam * MAXNUM);
210#endif
211 }
212 z = fabs(z);
213 z = PI/(z * stirf(q));
214 }
215 else
216 {
217 z = stirf(x);
218 }
219 return (*sgngam * z);
220 }
221
222 z = 1.0;
223 while (x >= 3.0)
224 {
225 x -= 1.0;
226 z *= x;
227 }
228
229 while (x < 0.0)
230 {
231 if (x > -1.E-9)
232 goto Small;
233 z /= x;
234 x += 1.0;
235 }
236
237 while (x < 2.0)
238 {
239 if (x < 1.e-9)
240 goto Small;
241 z /= x;
242 x += 1.0;
243 }
244
245 if (x == 2.0)
246 return (z);
247
248 x -= 2.0;
249 p = polevl( x, P, 6 );
250 q = polevl( x, Q, 7 );
251 return (z * p / q);
252
253Small:
254 if (x == 0.0)
255 {
256 goto gsing;
257 }
258 else
259 return (z/((1.0 + 0.5772156649015329 * x) * x));
260}
261
262/* This is the C99 version */
263double tgamma(double x)
264{
265 int local_sgngam = 0;
266 return (__tgamma_r(x, &local_sgngam));
267}
268
lib/libc/mingw/math/tgammaf.c deleted-196
...@@ -1,196 +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#include "cephes_mconf.h"
7
8/* define MAXGAM 34.84425627277176174 */
9
10/* Stirling's formula for the gamma function
11 * gamma(x) = sqrt(2 pi) x^(x-.5) exp(-x) ( 1 + 1/x P(1/x) )
12 * .028 < 1/x < .1
13 * relative error < 1.9e-11
14 */
15static const float STIR[] = {
16 -2.705194986674176E-003,
17 3.473255786154910E-003,
18 8.333331788340907E-002,
19};
20static const float MAXSTIR = 26.77;
21static const float SQTPIF = 2.50662827463100050242; /* sqrt( 2 pi ) */
22
23static float stirf(float);
24
25/* Gamma function computed by Stirling's formula,
26 * sqrt(2 pi) x^(x-.5) exp(-x) (1 + 1/x P(1/x))
27 * The polynomial STIR is valid for 33 <= x <= 172.
28 */
29static float stirf( float x )
30{
31 float y, w, v;
32
33 w = 1.0/x;
34 w = 1.0 + w * polevlf(w, STIR, 2);
35 y = expf(-x);
36 if (x > MAXSTIR)
37 { /* Avoid overflow in pow() */
38 v = powf(x, 0.5 * x - 0.25);
39 y *= v;
40 y *= v;
41 }
42 else
43 {
44 y = powf(x, x - 0.5) * y;
45 }
46 y = SQTPIF * y * w;
47 return (y);
48}
49
50
51/* gamma(x+2), 0 < x < 1 */
52static const float P[] = {
53 1.536830450601906E-003,
54 5.397581592950993E-003,
55 4.130370201859976E-003,
56 7.232307985516519E-002,
57 8.203960091619193E-002,
58 4.117857447645796E-001,
59 4.227867745131584E-001,
60 9.999999822945073E-001,
61};
62
63float __tgammaf_r( float x, int* sgngamf);
64
65float __tgammaf_r( float x, int* sgngamf)
66{
67 float p, q, z, nz;
68 int i, direction, negative;
69
70#ifdef NANS
71 if (isnan(x))
72 return (x);
73#endif
74#ifdef INFINITIES
75#ifdef NANS
76 if (x == INFINITYF)
77 return (x);
78 if (x == -INFINITYF)
79 return (NANF);
80#else
81 if (!isfinite(x))
82 return (x);
83#endif
84#endif
85 if (x == 0.0)
86 return copysignf(HUGE_VALF, x);
87
88 *sgngamf = 1;
89 negative = 0;
90 nz = 0.0;
91 if (x < 0.0)
92 {
93 negative = 1;
94 q = -x;
95 p = floorf(q);
96 if (p == q)
97 {
98gsing:
99 _SET_ERRNO(EDOM);
100 mtherr("tgammaf", SING);
101#ifdef NANS
102 return (NAN);
103#else
104 return (MAXNUMF);
105#endif
106 }
107 i = p;
108 if ((i & 1) == 0)
109 *sgngamf = -1;
110 nz = q - p;
111 if (nz > 0.5)
112 {
113 p += 1.0;
114 nz = q - p;
115 }
116 nz = q * sinf(PIF * nz);
117 if (nz == 0.0)
118 {
119 _SET_ERRNO(ERANGE);
120 mtherr("tgamma", OVERFLOW);
121#ifdef INFINITIES
122 return(*sgngamf * INFINITYF);
123#else
124 return(*sgngamf * MAXNUMF);
125#endif
126 }
127 if (nz < 0)
128 nz = -nz;
129 x = q;
130 }
131 if (x >= 10.0)
132 {
133 z = stirf(x);
134 }
135 if (x < 2.0)
136 direction = 1;
137 else
138 direction = 0;
139 z = 1.0;
140 while (x >= 3.0)
141 {
142 x -= 1.0;
143 z *= x;
144 }
145 /*
146 while (x < 0.0)
147 {
148 if (x > -1.E-4)
149 goto Small;
150 z *=x;
151 x += 1.0;
152 }
153 */
154 while (x < 2.0)
155 {
156 if (x < 1.e-4)
157 goto Small;
158 z *=x;
159 x += 1.0;
160 }
161
162 if (direction)
163 z = 1.0/z;
164
165 if (x == 2.0)
166 return (z);
167
168 x -= 2.0;
169 p = z * polevlf(x, P, 7);
170
171gdone:
172 if (negative)
173 {
174 p = *sgngamf * PIF/(nz * p );
175 }
176 return (p);
177
178Small:
179 if (x == 0.0)
180 {
181 goto gsing;
182 }
183 else
184 {
185 p = z / ((1.0 + 0.5772156649015329 * x) * x);
186 goto gdone;
187 }
188}
189
190/* This is the C99 version */
191float tgammaf(float x)
192{
193 int local_sgngamf = 0;
194 return (__tgammaf_r(x, &local_sgngamf));
195}
196
lib/libc/mingw/math/x86/acosh.c deleted-46
...@@ -1,46 +0,0 @@
1/*
2 This Software is provided under the Zope Public License (ZPL) Version 2.1.
3
4 Copyright (c) 2009, 2010 by the mingw-w64 project
5
6 See the AUTHORS file for the list of contributors to the mingw-w64 project.
7
8 This license has been certified as open source. It has also been designated
9 as GPL compatible by the Free Software Foundation (FSF).
10
11 Redistribution and use in source and binary forms, with or without
12 modification, are permitted provided that the following conditions are met:
13
14 1. Redistributions in source code must retain the accompanying copyright
15 notice, this list of conditions, and the following disclaimer.
16 2. Redistributions in binary form must reproduce the accompanying
17 copyright notice, this list of conditions, and the following disclaimer
18 in the documentation and/or other materials provided with the
19 distribution.
20 3. Names of the copyright holders must not be used to endorse or promote
21 products derived from this software without prior written permission
22 from the copyright holders.
23 4. The right to distribute this software or to use it for any purpose does
24 not give you the right to use Servicemarks (sm) or Trademarks (tm) of
25 the copyright holders. Use of them is covered by separate agreement
26 with the copyright holders.
27 5. If any files are modified, you must cause the modified files to carry
28 prominent notices stating that you changed the files and the date of
29 any change.
30
31 Disclaimer
32
33 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
34 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
35 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
36 EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
37 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
39 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
40 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
42 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43*/
44
45#define _NEW_COMPLEX_DOUBLE 1
46#include "acosh.def.h"
lib/libc/mingw/math/x86/acoshf.c deleted-46
...@@ -1,46 +0,0 @@
1/*
2 This Software is provided under the Zope Public License (ZPL) Version 2.1.
3
4 Copyright (c) 2009, 2010 by the mingw-w64 project
5
6 See the AUTHORS file for the list of contributors to the mingw-w64 project.
7
8 This license has been certified as open source. It has also been designated
9 as GPL compatible by the Free Software Foundation (FSF).
10
11 Redistribution and use in source and binary forms, with or without
12 modification, are permitted provided that the following conditions are met:
13
14 1. Redistributions in source code must retain the accompanying copyright
15 notice, this list of conditions, and the following disclaimer.
16 2. Redistributions in binary form must reproduce the accompanying
17 copyright notice, this list of conditions, and the following disclaimer
18 in the documentation and/or other materials provided with the
19 distribution.
20 3. Names of the copyright holders must not be used to endorse or promote
21 products derived from this software without prior written permission
22 from the copyright holders.
23 4. The right to distribute this software or to use it for any purpose does
24 not give you the right to use Servicemarks (sm) or Trademarks (tm) of
25 the copyright holders. Use of them is covered by separate agreement
26 with the copyright holders.
27 5. If any files are modified, you must cause the modified files to carry
28 prominent notices stating that you changed the files and the date of
29 any change.
30
31 Disclaimer
32
33 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
34 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
35 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
36 EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
37 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
39 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
40 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
42 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43*/
44
45#define _NEW_COMPLEX_FLOAT 1
46#include "acosh.def.h"
lib/libc/mingw/math/x86/asinh.c deleted-74
...@@ -1,74 +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#include <math.h>
7#include <errno.h>
8#include <float.h>
9#include "fastmath.h"
10
11 /* asinh(x) = copysign(log(fabs(x) + sqrt(x * x + 1.0)), x) */
12double asinh(double x)
13{
14 double z;
15 if (!isfinite (x))
16 return x;
17 z = fabs (x);
18
19 /* Avoid setting FPU underflow exception flag in x * x. */
20#if 0
21 if ( z < 0x1p-32)
22 return x;
23#endif
24
25 /* NB the previous formula
26 z = __fast_log1p (z + z * z / (__fast_sqrt (z * z + 1.0) + 1.0));
27 was defective in two ways:
28 1: It ommitted required brackets:
29 z = __fast_log1p (z + z * (z / (__fast_sqrt (z * z + 1.0) + 1.0)));
30 ^ ^
31 so would still overflow for large z.
32 2: Even with the brackets, it still degraded quickly for large z
33 (where z*z+1 == z*z).
34 e.g. asinh (sinh 356.0)) gave 355.30685281944005
35 */
36
37 const double asinhCutover = pow(2,DBL_MAX_EXP/2); // 1.3407807929943e+154
38
39 if (z < asinhCutover)
40 /* After excluding large values, the rearranged formula gives better results
41 the original formula log(z + sqrt(z * z + 1.0)) for very small z.
42 e.g. rearranged asinh(sinh 2e-301)) = 2e-301
43 original asinh(sinh 2e-301)) = 0.
44 asinh(z) = log (z + sqrt (z * z + 1.0))
45 = log1p (z + sqrt (z * z + 1.0) - 1.0)
46 = log1p (z + (sqrt (z * z + 1.0) - 1.0)
47 * (sqrt (z * z + 1.0) + 1.0)
48 / (sqrt (z * z + 1.0) + 1.0))
49 = log1p (z + ((z * z + 1.0) - 1.0)
50 / (sqrt (z * z + 1.0) + 1.0))
51 = log1p (z + z * z / (sqrt (z * z + 1.0) + 1.0))
52 */
53 z = __fast_log1p (z + z * (z / (__fast_sqrt (z * z + 1.0) + 1.0)));
54 else
55 /* above this, z*z+1 == z*z, so we can simplify
56 (and avoid z*z being infinity).
57 asinh(z) = log (z + sqrt (z * z + 1.0))
58 = log (z + sqrt (z * z ))
59 = log (2 * z)
60 = log 2 + log z
61 Choosing asinhCutover is a little tricky.
62 We'd like something that's based on the nature of
63 the numeric type (DBL_MAX_EXP, etc).
64 If c = asinhCutover, then we need:
65 (1) c*c == c*c + 1
66 (2) log (2*c) = log 2 + log c.
67 For float:
68 9.490626562425156e7 is the smallest value that
69 achieves (1), but it fails (2). (It only just fails,
70 but enough to make the function erroneously non-monotonic).
71 */
72 z = __fast_log(2) + __fast_log(z);
73 return copysign(z, x); //ensure 0.0 -> 0.0 and -0.0 -> -0.0.
74}
lib/libc/mingw/math/x86/asinhf.c deleted-34
...@@ -1,34 +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#include <math.h>
7#include <errno.h>
8#include <float.h>
9#include "fastmath.h"
10
11 /* asinh(x) = copysign(log(fabs(x) + sqrt(x * x + 1.0)), x) */
12float asinhf(float x)
13{
14 float z;
15 if (!isfinite (x))
16 return x;
17 z = fabsf (x);
18
19 /* Avoid setting FPU underflow exception flag in x * x. */
20#if 0
21 if ( z < 0x1p-32)
22 return x;
23#endif
24
25 /* See commentary in asinh */
26 const float asinhCutover = pow(2,FLT_MAX_EXP/2);
27
28 if (z < asinhCutover)
29 z = __fast_log1p (z + z * (z / (__fast_sqrt (z * z + 1.0) + 1.0)));
30 //z = __fast_log(z + __fast_sqrt(z * z + 1.0));
31 else
32 z = __fast_log(2) + __fast_log(z);
33 return copysignf(z, x); //ensure 0.0 -> 0.0 and -0.0 -> -0.0.
34}
lib/libc/mingw/math/x86/atan2.c deleted-15
...@@ -1,15 +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 <math.h>
8
9double
10atan2 (double y, double x)
11{
12 double res = 0.0;
13 asm volatile ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)");
14 return res;
15}
lib/libc/mingw/math/x86/atanh.c deleted-36
...@@ -1,36 +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#include <math.h>
7#include <errno.h>
8#include "fastmath.h"
9
10/* atanh (x) = 0.5 * log ((1.0 + x)/(1.0 - x)) */
11
12double atanh(double x)
13{
14 double z;
15 if (isnan (x))
16 return x;
17 z = fabs (x);
18 if (z == 1.0)
19 {
20 errno = ERANGE;
21 return (x > 0 ? INFINITY : -INFINITY);
22 }
23 if (z > 1.0)
24 {
25 errno = EDOM;
26 return nan("");
27 }
28 /* Rearrange formula to avoid precision loss for small x.
29
30 atanh(x) = 0.5 * log ((1.0 + x)/(1.0 - x))
31 = 0.5 * log1p ((1.0 + x)/(1.0 - x) - 1.0)
32 = 0.5 * log1p ((1.0 + x - 1.0 + x) /(1.0 - x))
33 = 0.5 * log1p ((2.0 * x ) / (1.0 - x)) */
34 z = 0.5 * __fast_log1p ((z + z) / (1.0 - z));
35 return copysign(z, x); //ensure 0.0 -> 0.0 and -0.0 -> -0.0.
36}
lib/libc/mingw/math/x86/atanhf.c deleted-35
...@@ -1,35 +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#include <math.h>
7#include <errno.h>
8#include "fastmath.h"
9
10/* atanh (x) = 0.5 * log ((1.0 + x)/(1.0 - x)) */
11float atanhf (float x)
12{
13 float z;
14 if (isnan (x))
15 return x;
16 z = fabsf (x);
17 if (z == 1.0)
18 {
19 errno = ERANGE;
20 return (x > 0 ? INFINITY : -INFINITY);
21 }
22 if ( z > 1.0)
23 {
24 errno = EDOM;
25 return nanf("");
26 }
27 /* Rearrange formula to avoid precision loss for small x.
28
29 atanh(x) = 0.5 * log ((1.0 + x)/(1.0 - x))
30 = 0.5 * log1p ((1.0 + x)/(1.0 - x) - 1.0)
31 = 0.5 * log1p ((1.0 + x - 1.0 + x) /(1.0 - x))
32 = 0.5 * log1p ((2.0 * x ) / (1.0 - x)) */
33 z = 0.5 * __fast_log1p ((z + z) / (1.0 - z));
34 return copysignf(z, x); //ensure 0.0 -> 0.0 and -0.0 -> -0.0.
35}
lib/libc/mingw/math/x86/ceil.S deleted-115
...@@ -1,115 +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#include <_mingw_mac.h>
7
8 .file "ceil.S"
9 .text
10 .align 4
11 .globl __MINGW_USYMBOL(ceil)
12 .def __MINGW_USYMBOL(ceil); .scl 2; .type 32; .endef
13#ifdef __x86_64__
14 .seh_proc __MINGW_USYMBOL(ceil)
15#endif
16
17__MINGW_USYMBOL(ceil):
18#if defined(_AMD64_) || defined(__x86_64__)
19 .seh_endprologue
20 movd %xmm0, %rax
21 movq %rax, %rcx
22 sarq $52, %rcx
23 andl $2047, %ecx
24 subl $1023, %ecx
25 cmpl $51, %ecx
26 jg .is_intnaninf
27 /* Is x zero? */
28 testq %rax, %rax
29 je .ret_org
30 /* Is x signed? */
31 testl %ecx, %ecx
32 js .signed_val
33 /* Is x integral? */
34 movabsq $4503599627370495, %rdx
35 sarq %cl, %rdx
36 testq %rax, %rdx
37 je .ret_org
38 addsd .huge(%rip), %xmm0
39 ucomisd .zero(%rip), %xmm0
40 jbe .doret
41 testq %rax, %rax
42 jle .l1
43 /* inexact ... */
44 movabsq $4503599627370496, %r8
45 shrq %cl, %r8
46 addq %r8, %rax
47.l1:
48 notq %rdx
49 andq %rdx, %rax
50.doret:
51 movd %rax, %xmm0
52 ret
53 .p2align 4,,10
54.signed_val:
55 addsd .huge(%rip), %xmm0
56 ucomisd .zero(%rip), %xmm0
57 jbe .doret2
58 testq %rax, %rax
59 movabsq $4607182418800017408, %rdx
60 movabsq $-9223372036854775808, %rax
61 cmovns %rdx, %rax
62 .p2align 4,,10
63.doret2:
64 movd %rax, %xmm0
65 ret
66
67 .p2align 4,,10
68.is_intnaninf:
69 /* Is Nan or Inf? */
70 cmpl $1024, %ecx
71 je .ret_naninf
72 .p2align 4,,10
73.ret_org:
74 /* return x. */
75 rep
76 ret
77 .p2align 4,,10
78.ret_naninf:
79 /* return x + x; */
80 addsd %xmm0, %xmm0
81 ret
82 .seh_endproc
83
84/* local data. */
85 .section .rdata,"dr"
86 .align 8
87.huge:
88 .long -2013235812
89 .long 2117592124
90 .align 8
91.zero:
92 .long 0
93 .long 0
94#elif defined(_X86_) || defined(__i386__)
95 fldl 4(%esp)
96 subl $8,%esp
97
98 fstcw 4(%esp) /* store fpu control word */
99
100 /* We use here %edx although only the low 1 bits are defined.
101 But none of the operations should care and they are faster
102 than the 16 bit operations. */
103 movl $0x0800,%edx /* round towards +oo */
104 orl 4(%esp),%edx
105 andl $0xfbff,%edx
106 movl %edx,(%esp)
107 fldcw (%esp) /* load modified control word */
108
109 frndint /* round */
110
111 fldcw 4(%esp) /* restore original control word */
112
113 addl $8,%esp
114 ret
115#endif
lib/libc/mingw/math/x86/cos.c deleted-46
...@@ -1,46 +0,0 @@
1/*
2 This Software is provided under the Zope Public License (ZPL) Version 2.1.
3
4 Copyright (c) 2009, 2010 by the mingw-w64 project
5
6 See the AUTHORS file for the list of contributors to the mingw-w64 project.
7
8 This license has been certified as open source. It has also been designated
9 as GPL compatible by the Free Software Foundation (FSF).
10
11 Redistribution and use in source and binary forms, with or without
12 modification, are permitted provided that the following conditions are met:
13
14 1. Redistributions in source code must retain the accompanying copyright
15 notice, this list of conditions, and the following disclaimer.
16 2. Redistributions in binary form must reproduce the accompanying
17 copyright notice, this list of conditions, and the following disclaimer
18 in the documentation and/or other materials provided with the
19 distribution.
20 3. Names of the copyright holders must not be used to endorse or promote
21 products derived from this software without prior written permission
22 from the copyright holders.
23 4. The right to distribute this software or to use it for any purpose does
24 not give you the right to use Servicemarks (sm) or Trademarks (tm) of
25 the copyright holders. Use of them is covered by separate agreement
26 with the copyright holders.
27 5. If any files are modified, you must cause the modified files to carry
28 prominent notices stating that you changed the files and the date of
29 any change.
30
31 Disclaimer
32
33 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
34 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
35 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
36 EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
37 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
39 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
40 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
42 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43*/
44
45#define _NEW_COMPLEX_DOUBLE 1
46#include "cos.def.h"
lib/libc/mingw/math/x86/exp.c deleted-46
...@@ -1,46 +0,0 @@
1/*
2 This Software is provided under the Zope Public License (ZPL) Version 2.1.
3
4 Copyright (c) 2009, 2010 by the mingw-w64 project
5
6 See the AUTHORS file for the list of contributors to the mingw-w64 project.
7
8 This license has been certified as open source. It has also been designated
9 as GPL compatible by the Free Software Foundation (FSF).
10
11 Redistribution and use in source and binary forms, with or without
12 modification, are permitted provided that the following conditions are met:
13
14 1. Redistributions in source code must retain the accompanying copyright
15 notice, this list of conditions, and the following disclaimer.
16 2. Redistributions in binary form must reproduce the accompanying
17 copyright notice, this list of conditions, and the following disclaimer
18 in the documentation and/or other materials provided with the
19 distribution.
20 3. Names of the copyright holders must not be used to endorse or promote
21 products derived from this software without prior written permission
22 from the copyright holders.
23 4. The right to distribute this software or to use it for any purpose does
24 not give you the right to use Servicemarks (sm) or Trademarks (tm) of
25 the copyright holders. Use of them is covered by separate agreement
26 with the copyright holders.
27 5. If any files are modified, you must cause the modified files to carry
28 prominent notices stating that you changed the files and the date of
29 any change.
30
31 Disclaimer
32
33 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
34 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
35 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
36 EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
37 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
39 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
40 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
42 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43*/
44
45#define _NEW_COMPLEX_DOUBLE 1
46#include "exp.def.h"
lib/libc/mingw/math/x86/exp2.S deleted-94
...@@ -1,94 +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#include <_mingw_mac.h>
7
8 .file "exp2.S"
9 .text
10#ifdef __x86_64__
11 .align 8
12#else
13 .align 4
14#endif
15.globl __MINGW_USYMBOL(exp2)
16 .def __MINGW_USYMBOL(exp2); .scl 2; .type 32; .endef
17__MINGW_USYMBOL(exp2):
18#ifdef __x86_64__
19 subq $24, %rsp
20 movsd %xmm0,(%rsp)
21 fldl (%rsp)
22 fxam /* Is NaN or +-Inf? */
23 fstsw %ax
24 movb $0x45, %dh
25 andb %ah, %dh
26 cmpb $0x05, %dh
27 je 1f /* Is +-Inf, jump. */
28 fld %st
29 subq $8, %rsp /* int(x) */
30 fnstcw 4(%rsp)
31 movzwl 4(%rsp), %eax
32 orb $12, %ah
33 movw %ax, (%rsp)
34 fldcw (%rsp)
35 frndint
36 fldcw 4(%rsp)
37 addq $8, %rsp
38 fsubr %st,%st(1) /* fract(x) */
39 fxch
40 f2xm1 /* 2^(fract(x)) - 1 */
41 fld1
42 faddp /* 2^(fract(x)) */
43 fscale /* e^x */
44 fstp %st(1)
45 fstpl (%rsp)
46 movsd (%rsp),%xmm0
47 addq $24, %rsp
48 ret
49
501: testl $0x200, %eax /* Test sign. */
51 jz 2f /* If positive, jump. */
52 fstp %st
53 fldz /* Set result to 0. */
542: fstpl (%rsp)
55 movsd (%rsp),%xmm0
56 addq $24,%rsp
57 ret
58#else
59 fldl 4(%esp)
60/* I added the following ugly construct because exp(+-Inf) resulted
61 in NaN. The ugliness results from the bright minds at Intel.
62 For the i686 the code can be written better.
63 -- drepper@cygnus.com. */
64 fxam /* Is NaN or +-Inf? */
65 fstsw %ax
66 movb $0x45, %dh
67 andb %ah, %dh
68 cmpb $0x05, %dh
69 je 1f /* Is +-Inf, jump. */
70 fld %st
71 subl $8, %esp /* int(x) */
72 fnstcw 4(%esp)
73 movzwl 4(%esp), %eax
74 orb $12, %ah
75 movw %ax, (%esp)
76 fldcw (%esp)
77 frndint
78 fldcw 4(%esp)
79 addl $8, %esp
80 fsubr %st,%st(1) /* fract(x) */
81 fxch
82 f2xm1 /* 2^(fract(x)) - 1 */
83 fld1
84 faddp /* 2^(fract(x)) */
85 fscale /* e^x */
86 fstp %st(1)
87 ret
88
891: testl $0x200, %eax /* Test sign. */
90 jz 2f /* If positive, jump. */
91 fstp %st
92 fldz /* Set result to 0. */
932: ret
94#endif
lib/libc/mingw/math/x86/exp2f.S deleted-94
...@@ -1,94 +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#include <_mingw_mac.h>
7
8 .file "exp2f.S"
9 .text
10#ifdef __x86_64__
11 .align 8
12#else
13 .align 4
14#endif
15.globl __MINGW_USYMBOL(exp2f)
16 .def __MINGW_USYMBOL(exp2f); .scl 2; .type 32; .endef
17__MINGW_USYMBOL(exp2f):
18#ifdef __x86_64__
19 subq $24, %rsp
20 movss %xmm0,(%rsp)
21 flds (%rsp)
22 fxam /* Is NaN or +-Inf? */
23 fstsw %ax
24 movb $0x45, %dh
25 andb %ah, %dh
26 cmpb $0x05, %dh
27 je 1f /* Is +-Inf, jump. */
28 fld %st
29 subq $8, %rsp /* int(x) */
30 fnstcw 4(%rsp)
31 movzwl 4(%rsp), %eax
32 orb $12, %ah
33 movw %ax, (%rsp)
34 fldcw (%rsp)
35 frndint
36 fldcw 4(%rsp)
37 addq $8, %rsp
38 fsubr %st,%st(1) /* fract(x) */
39 fxch
40 f2xm1 /* 2^(fract(x)) - 1 */
41 fld1
42 faddp /* 2^(fract(x)) */
43 fscale /* e^x */
44 fstp %st(1)
45 fstps (%rsp)
46 movss (%rsp),%xmm0
47 addq $24, %rsp
48 ret
49
501: testl $0x200, %eax /* Test sign. */
51 jz 2f /* If positive, jump. */
52 fstp %st
53 fldz /* Set result to 0. */
542: fstps (%rsp)
55 movss (%rsp),%xmm0
56 addq $24, %rsp
57 ret
58#else
59 flds 4(%esp)
60/* I added the following ugly construct because exp(+-Inf) resulted
61 in NaN. The ugliness results from the bright minds at Intel.
62 For the i686 the code can be written better.
63 -- drepper@cygnus.com. */
64 fxam /* Is NaN or +-Inf? */
65 fstsw %ax
66 movb $0x45, %dh
67 andb %ah, %dh
68 cmpb $0x05, %dh
69 je 1f /* Is +-Inf, jump. */
70 fld %st
71 subl $8, %esp /* int(x) */
72 fnstcw 4(%esp)
73 movzwl 4(%esp), %eax
74 orb $12, %ah
75 movw %ax, (%esp)
76 fldcw (%esp)
77 frndint
78 fldcw 4(%esp)
79 addl $8, %esp
80 fsubr %st,%st(1) /* fract(x) */
81 fxch
82 f2xm1 /* 2^(fract(x)) - 1 */
83 fld1
84 faddp /* 2^(fract(x)) */
85 fscale /* e^x */
86 fstp %st(1)
87 ret
88
891: testl $0x200, %eax /* Test sign. */
90 jz 2f /* If positive, jump. */
91 fstp %st
92 fldz /* Set result to 0. */
932: ret
94#endif
lib/libc/mingw/math/x86/expm1.c deleted-46
...@@ -1,46 +0,0 @@
1/*
2 This Software is provided under the Zope Public License (ZPL) Version 2.1.
3
4 Copyright (c) 2009, 2010 by the mingw-w64 project
5
6 See the AUTHORS file for the list of contributors to the mingw-w64 project.
7
8 This license has been certified as open source. It has also been designated
9 as GPL compatible by the Free Software Foundation (FSF).
10
11 Redistribution and use in source and binary forms, with or without
12 modification, are permitted provided that the following conditions are met:
13
14 1. Redistributions in source code must retain the accompanying copyright
15 notice, this list of conditions, and the following disclaimer.
16 2. Redistributions in binary form must reproduce the accompanying
17 copyright notice, this list of conditions, and the following disclaimer
18 in the documentation and/or other materials provided with the
19 distribution.
20 3. Names of the copyright holders must not be used to endorse or promote
21 products derived from this software without prior written permission
22 from the copyright holders.
23 4. The right to distribute this software or to use it for any purpose does
24 not give you the right to use Servicemarks (sm) or Trademarks (tm) of
25 the copyright holders. Use of them is covered by separate agreement
26 with the copyright holders.
27 5. If any files are modified, you must cause the modified files to carry
28 prominent notices stating that you changed the files and the date of
29 any change.
30
31 Disclaimer
32
33 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
34 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
35 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
36 EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
37 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
39 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
40 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
42 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43*/
44
45#define _NEW_COMPLEX_DOUBLE 1
46#include "expm1.def.h"
lib/libc/mingw/math/x86/expm1f.c deleted-46
...@@ -1,46 +0,0 @@
1/*
2 This Software is provided under the Zope Public License (ZPL) Version 2.1.
3
4 Copyright (c) 2009, 2010 by the mingw-w64 project
5
6 See the AUTHORS file for the list of contributors to the mingw-w64 project.
7
8 This license has been certified as open source. It has also been designated
9 as GPL compatible by the Free Software Foundation (FSF).
10
11 Redistribution and use in source and binary forms, with or without
12 modification, are permitted provided that the following conditions are met:
13
14 1. Redistributions in source code must retain the accompanying copyright
15 notice, this list of conditions, and the following disclaimer.
16 2. Redistributions in binary form must reproduce the accompanying
17 copyright notice, this list of conditions, and the following disclaimer
18 in the documentation and/or other materials provided with the
19 distribution.
20 3. Names of the copyright holders must not be used to endorse or promote
21 products derived from this software without prior written permission
22 from the copyright holders.
23 4. The right to distribute this software or to use it for any purpose does
24 not give you the right to use Servicemarks (sm) or Trademarks (tm) of
25 the copyright holders. Use of them is covered by separate agreement
26 with the copyright holders.
27 5. If any files are modified, you must cause the modified files to carry
28 prominent notices stating that you changed the files and the date of
29 any change.
30
31 Disclaimer
32
33 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
34 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
35 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
36 EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
37 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
39 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
40 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
42 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43*/
44
45#define _NEW_COMPLEX_FLOAT 1
46#include "expm1.def.h"
lib/libc/mingw/math/x86/floor.S deleted-167
...@@ -1,167 +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#include <_mingw_mac.h>
7
8 .file "floor.S"
9 .text
10 .p2align 4,,15
11 .globl __MINGW_USYMBOL(floor)
12 .def __MINGW_USYMBOL(floor); .scl 2; .type 32; .endef
13#ifdef __x86_64__
14 .seh_proc __MINGW_USYMBOL(floor)
15#endif
16__MINGW_USYMBOL(floor):
17#if defined(_AMD64_) || defined(__x86_64__)
18 pushq %rbx
19 .seh_pushreg %rbx
20 subq $16, %rsp
21 .seh_stackalloc 16
22 .seh_endprologue
23 movsd %xmm0, 8(%rsp)
24 movq 8(%rsp), %r9
25 movq %r9, %rdx
26 movl %r9d, %r10d
27 shrq $32, %rdx
28 movl %edx, %eax
29 movl %edx, %r11d
30 sarl $20, %eax
31 andl $2047, %eax
32 leal -1023(%rax), %r8d
33 cmpl $51, %r8d
34 jle .L2
35 cmpl $1024, %r8d
36 je .L27
37.L3:
38 addq $16, %rsp
39 popq %rbx
40 ret
41 .p2align 4,,10
42.L2:
43 cmpl $19, %r8d
44 jg .L4
45 testl %r8d, %r8d
46 js .L28
47 movl $1048575, %eax
48 movl %r8d, %ecx
49 shrl %cl, %eax
50 testl %r9d, %r9d
51 jne .L8
52 testl %edx, %eax
53 je .L3
54.L8:
55 movsd .hugeval(%rip), %xmm1
56 xorpd %xmm2, %xmm2
57 addsd %xmm0, %xmm1
58 ucomisd %xmm1, %xmm2
59 jae .L3
60 xorl %r9d, %r9d
61 testl %edx, %edx
62 jns .L9
63 movl $1048576, %r9d
64 movl %r8d, %ecx
65 sarl %cl, %r9d
66.L9:
67 addl %r9d, %edx
68 notl %eax
69 andl %edx, %eax
70 salq $32, %rax
71 movq %rax, 8(%rsp)
72 movsd 8(%rsp), %xmm0
73 addq $16, %rsp
74 popq %rbx
75 ret
76 .p2align 4,,10
77.L4:
78 leal -1043(%rax), %ecx
79 movl $-1, %ebx
80 shrl %cl, %ebx
81 testl %r9d, %ebx
82 je .L3
83 movsd .hugeval(%rip), %xmm1
84 xorpd %xmm2, %xmm2
85 addsd %xmm0, %xmm1
86 ucomisd %xmm1, %xmm2
87 jae .L3
88 testl %edx, %edx
89 js .L29
90.L11:
91 notl %ebx
92 salq $32, %r11
93 andl %ebx, %r10d
94 orq %r10, %r11
95 movq %r11, 8(%rsp)
96 movsd 8(%rsp), %xmm0
97 addq $16, %rsp
98 popq %rbx
99 ret
100 .p2align 4,,10
101.L27:
102 addsd %xmm0, %xmm0
103 addq $16, %rsp
104 popq %rbx
105 ret
106 .p2align 4,,10
107.L28:
108 movsd .hugeval(%rip), %xmm2
109 xorpd %xmm1, %xmm1
110 addsd %xmm0, %xmm2
111 ucomisd %xmm1, %xmm2
112 jbe .L3
113 testl %edx, %edx
114 js .L7
115 movapd %xmm1, %xmm0
116 jmp .L3
117 .p2align 4,,10
118.L7:
119 andl $2147483647, %edx
120 orl %r9d, %edx
121 je .L3
122 movabsq $-4616189618054758400, %rax
123 movq %rax, 8(%rsp)
124 movsd 8(%rsp), %xmm0
125 jmp .L3
126 .p2align 4,,10
127.L29:
128 cmpl $20, %r8d
129 je .L25
130 movl $1075, %ecx
131 movl $1, %r10d
132 subl %eax, %ecx
133 sall %cl, %r10d
134 addl %r9d, %r10d
135 jae .L11
136.L25:
137 leal 1(%rdx), %r11d
138 jmp .L11
139 .seh_endproc
140
141 .section .rdata,"dr"
142 .align 8
143.hugeval:
144 .long -2013235812
145 .long 2117592124
146#elif defined(_X86_) || defined(__i386__)
147 fldl 4(%esp)
148 subl $8,%esp
149
150 fstcw 4(%esp) /* store fpu control word */
151
152 /* We use here %edx although only the low 1 bits are defined.
153 But none of the operations should care and they are faster
154 than the 16 bit operations. */
155 movl $0x400,%edx /* round towards -oo */
156 orl 4(%esp),%edx
157 andl $0xf7ff,%edx
158 movl %edx,(%esp)
159 fldcw (%esp) /* load modified control word */
160
161 frndint /* round */
162
163 fldcw 4(%esp) /* restore original control word */
164
165 addl $8,%esp
166 ret
167#endif
lib/libc/mingw/math/x86/fmod.c deleted-21
...@@ -1,21 +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 */
6double fmod (double x, double y);
7
8double
9fmod (double x, double y)
10{
11 double res = 0.0;
12
13 asm volatile (
14 "1:\tfprem\n\t"
15 "fstsw %%ax\n\t"
16 "sahf\n\t"
17 "jp 1b\n\t"
18 "fstp %%st(1)"
19 : "=t" (res) : "0" (x), "u" (y) : "ax", "st(1)");
20 return res;
21}
lib/libc/mingw/math/x86/ilogb.S deleted-137
...@@ -1,137 +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#include <_mingw_mac.h>
7
8 .file "ilogb.S"
9 .text
10 .p2align 4,,15
11.globl __MINGW_USYMBOL(ilogb)
12 .def __MINGW_USYMBOL(ilogb); .scl 2; .type 32; .endef
13#ifdef __x86_64__
14 .seh_proc __MINGW_USYMBOL(ilogb)
15#endif
16__MINGW_USYMBOL(ilogb):
17#ifdef __x86_64__
18/* Generated code by:
19int
20ilogb (double x)
21{
22 __mingw_dbl_type_t hlp;
23 int hx, lx, ix;
24
25 hlp.x = x;
26 hx = hpl.lh.high & 0x7fffffff;
27 if (hx < 0x100000)
28 {
29 lx = hlp.lh.low;
30 if ((hx | lx) == 0)
31 return 0x80000000; // ilogb(0) = FP_ILOGB0
32 // subnormal x
33 if (hx == 0)
34 {
35 for (ix = -1043; lx > 0; lx <<= 1)
36 ix -=1;
37 }
38 else
39 {
40 for (ix = -1022,hx <<= 11; hx > 0; hx <<= 1)
41 ix -=1;
42 }
43 return ix;
44 }
45 if (hx < 0x7ff00000)
46 return (hx >> 20) - 1023;
47 lx = hlp.lh.low;
48 return 0x7fffffff;
49} */
50 subq $24, %rsp
51 .seh_stackalloc 24
52 .seh_endprologue
53 movsd %xmm0, 8(%rsp)
54 movq 8(%rsp), %rdx
55 shrq $32, %rdx
56 andl $2147483647, %edx
57 cmpl $1048575, %edx
58 jg .L2
59 movq 8(%rsp), %rcx
60 movl %edx, %eax
61 orl %ecx, %eax
62 je .L8
63 testl %edx, %edx
64 jne .L4
65 testl %ecx, %ecx
66 movl %ecx, %edx
67 movl $-1043, %eax
68 jle .L3
69 .p2align 4,,10
70.L5:
71 addl %edx, %edx
72 subl $1, %eax
73 testl %edx, %edx
74 jg .L5
75 addq $24, %rsp
76 ret
77 .p2align 4,,10
78.L2:
79 cmpl $2146435071, %edx
80 jle .L13
81 movl $2147483647, %eax
82.L3:
83 addq $24, %rsp
84 ret
85 .p2align 4,,10
86.L4:
87 sall $11, %edx
88 movl $-1022, %eax
89 testl %edx, %edx
90 jle .L3
91 .p2align 4,,10
92.L6:
93 addl %edx, %edx
94 subl $1, %eax
95 testl %edx, %edx
96 jg .L6
97 addq $24, %rsp
98 ret
99 .p2align 4,,10
100.L13:
101 sarl $20, %edx
102 leal -1023(%rdx), %eax
103 addq $24, %rsp
104 ret
105.L8:
106 movl $-2147483648, %eax
107 jmp .L3
108 .seh_endproc
109#else
110
111 fldl 4(%esp)
112/* I added the following ugly construct because ilogb(+-Inf) is
113 required to return INT_MAX in ISO C99.
114 -- jakub@redhat.com. */
115 fxam /* Is NaN or +-Inf? */
116 fstsw %ax
117 movb $0x45, %dh
118 andb %ah, %dh
119 cmpb $0x05, %dh
120 je 1f /* Is +-Inf, jump. */
121 cmpb $0x01, %dh
122 je 1f /* Is NaN, jump. */
123
124 fxtract
125 pushl %eax
126 fstp %st
127
128 fistpl (%esp)
129 fwait
130 popl %eax
131
132 ret
133
1341: fstp %st
135 movl $0x7fffffff, %eax
136 ret
137#endif
lib/libc/mingw/math/x86/ilogbf.S deleted-106
...@@ -1,106 +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#include <_mingw_mac.h>
7
8 .file "ilogbf.S"
9 .text
10 .p2align 4,,15
11.globl __MINGW_USYMBOL(ilogbf)
12 .def __MINGW_USYMBOL(ilogbf); .scl 2; .type 32; .endef
13#ifdef __x86_64__
14 .seh_proc __MINGW_USYMBOL(ilogbf)
15#endif
16__MINGW_USYMBOL(ilogbf):
17#ifdef __x86_64__
18/* generated code for:
19int
20ilogbf (float x)
21{
22 __mingw_flt_type_t hlp;
23 int hx, ix;
24
25 hlp.x = x;
26 hx = (int) hlp.val & 0x7fffffff;
27 if (hx < 0x800000)
28 {
29 if (hx == 0)
30 return 0x80000000; // ilogb(0) = FP_ILOGB0
31 for (ix = -126, hx <<= 8; hx > 0; hx <<= 1)
32 ix -= 1;
33 return ix;
34 }
35 if (hx < 0x7f800000)
36 return (hx >> 23) - 127;
37 return 0x7fffffff;
38} */
39 subq $24, %rsp
40 .seh_stackalloc 24
41 .seh_endprologue
42 movss %xmm0, 12(%rsp)
43 movl 12(%rsp), %edx
44 andl $2147483647, %edx
45 cmpl $8388607, %edx
46 jg .L2
47 testl %edx, %edx
48 je .L6
49 sall $8, %edx
50 movl $-126, %eax
51 testl %edx, %edx
52 jle .L3
53 .p2align 4,,10
54.L4:
55 addl %edx, %edx
56 subl $1, %eax
57 testl %edx, %edx
58 jg .L4
59.L3:
60 addq $24, %rsp
61 ret
62 .p2align 4,,10
63.L2:
64 cmpl $2139095039, %edx
65 jle .L10
66 movl $2147483647, %eax
67 addq $24, %rsp
68 ret
69 .p2align 4,,10
70.L10:
71 sarl $23, %edx
72 leal -127(%rdx), %eax
73 addq $24, %rsp
74 ret
75.L6:
76 movl $-2147483648, %eax
77 jmp .L3
78 .seh_endproc
79#else
80 flds 4(%esp)
81/* I added the following ugly construct because ilogb(+-Inf) is
82 required to return INT_MAX in ISO C99.
83 -- jakub@redhat.com. */
84 fxam /* Is NaN or +-Inf? */
85 fstsw %ax
86 movb $0x45, %dh
87 andb %ah, %dh
88 cmpb $0x05, %dh
89 je 1f /* Is +-Inf, jump. */
90 cmpb $0x01, %dh
91 je 1f /* Is Nan, jump. */
92
93 fxtract
94 pushl %eax
95 fstp %st
96
97 fistpl (%esp)
98 fwait
99 popl %eax
100
101 ret
102
1031: fstp %st
104 movl $0x7fffffff, %eax
105 ret
106#endif
lib/libc/mingw/math/x86/log1p.S deleted-85
...@@ -1,85 +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#include <_mingw_mac.h>
7
8 .file "log1p.S"
9 .text
10#ifdef __x86_64__
11 .align 8
12#else
13 .align 4
14#endif
15 /* The fyl2xp1 can only be used for values in
16 -1 + sqrt(2) / 2 <= x <= 1 - sqrt(2) / 2
17 0.29 is a safe value.
18 */
19limit: .double 0.29
20one: .double 1.0
21/*
22 * Use the fyl2xp1 function when the argument is in the range -0.29 to 0.29,
23 * otherwise fyl2x with the needed extra computation.
24 */
25.globl __MINGW_USYMBOL(log1p)
26 .def __MINGW_USYMBOL(log1p); .scl 2; .type 32; .endef
27__MINGW_USYMBOL(log1p):
28#ifdef __x86_64__
29 movsd %xmm0,-16(%rsp)
30 fldln2
31 fldl -16(%rsp)
32 fxam
33 fnstsw
34 fld %st
35 sahf
36 jc 3f // in case x is NaN or �Inf
37
384: fabs
39 fcompl limit(%rip)
40 fnstsw
41 sahf
42 jc 2f
43 faddl one(%rip)
44 fyl2x
45 fstpl -16(%rsp)
46 movsd -16(%rsp),%xmm0
47 ret
48
492: fyl2xp1
50 fstpl -16(%rsp)
51 movsd -16(%rsp),%xmm0
52 ret
53
543: jp 4b // in case x is �Inf
55 fstp %st(1)
56 fstp %st(1)
57 fstpl -16(%rsp)
58 movsd -16(%rsp),%xmm0
59 ret
60#else
61 fldln2
62 fldl 4(%esp)
63 fxam
64 fnstsw
65 fld %st
66 sahf
67 jc 3f // in case x is NaN or �Inf
68
694: fabs
70 fcompl limit
71 fnstsw
72 sahf
73 jc 2f
74 faddl one
75 fyl2x
76 ret
77
782: fyl2xp1
79 ret
80
813: jp 4b // in case x is �Inf
82 fstp %st(1)
83 fstp %st(1)
84 ret
85#endif
lib/libc/mingw/math/x86/log1pf.S deleted-85
...@@ -1,85 +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#include <_mingw_mac.h>
7
8 .file "log1pf.S"
9 .text
10#ifdef __x86_64__
11 .align 8
12#else
13 .align 4
14#endif
15 /* The fyl2xp1 can only be used for values in
16 -1 + sqrt(2) / 2 <= x <= 1 - sqrt(2) / 2
17 0.29 is a safe value.
18 */
19limit: .float 0.29
20one: .float 1.0
21/*
22 * Use the fyl2xp1 function when the argument is in the range -0.29 to 0.29,
23 * otherwise fyl2x with the needed extra computation.
24 */
25.globl __MINGW_USYMBOL(log1pf)
26 .def __MINGW_USYMBOL(log1pf); .scl 2; .type 32; .endef
27__MINGW_USYMBOL(log1pf):
28#ifdef __x86_64__
29 movss %xmm0,-12(%rsp)
30 fldln2
31 flds -12(%rsp)
32 fxam
33 fnstsw
34 fld %st
35 sahf
36 jc 3f // in case x is NaN or �Inf
37
384: fabs
39 fcomps limit(%rip)
40 fnstsw
41 sahf
42 jc 2f
43 fadds one(%rip)
44 fyl2x
45 fstps -12(%rsp)
46 movss -12(%rsp),%xmm0
47 ret
48
492: fyl2xp1
50 fstps -12(%rsp)
51 movss -12(%rsp),%xmm0
52 ret
53
543: jp 4b // in case x is �Inf
55 fstp %st(1)
56 fstp %st(1)
57 fstps -12(%rsp)
58 movss -12(%rsp),%xmm0
59 ret
60#else
61 fldln2
62 flds 4(%esp)
63 fxam
64 fnstsw
65 fld %st
66 sahf
67 jc 3f // in case x is NaN or �Inf
68
694: fabs
70 fcomps limit
71 fnstsw
72 sahf
73 jc 2f
74 fadds one
75 fyl2x
76 ret
77
782: fyl2xp1
79 ret
80
813: jp 4b // in case x is �Inf
82 fstp %st(1)
83 fstp %st(1)
84 ret
85#endif
lib/libc/mingw/math/x86/log2.S deleted-85
...@@ -1,85 +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#include <_mingw_mac.h>
7
8 .file "log2.S"
9 .text
10#ifdef __x86_64__
11 .align 8
12#else
13 .align 4
14#endif
15one: .double 1.0
16 /* It is not important that this constant is precise. It is only
17 a value which is known to be on the safe side for using the
18 fyl2xp1 instruction. */
19limit: .double 0.29
20
21.globl __MINGW_USYMBOL(log2)
22 .def __MINGW_USYMBOL(log2); .scl 2; .type 32; .endef
23__MINGW_USYMBOL(log2):
24#ifdef __x86_64__
25 movsd %xmm0,-16(%rsp)
26 fldl one(%rip)
27 fldl -16(%rsp) // x : 1
28 fxam
29 fnstsw
30 fld %st // x : x : 1
31 sahf
32 jc 3f // in case x is NaN or �Inf
334: fsub %st(2), %st // x-1 : x : 1
34 fld %st // x-1 : x-1 : x : 1
35 fabs // |x-1| : x-1 : x : 1
36 fcompl limit(%rip) // x-1 : x : 1
37 fnstsw // x-1 : x : 1
38 andb $0x45, %ah
39 jz 2f
40 fstp %st(1) // x-1 : 1
41 fyl2xp1 // log(x)
42 fstpl -16(%rsp)
43 movsd -16(%rsp),%xmm0
44 ret
45
462: fstp %st(0) // x : 1
47 fyl2x // log(x)
48 fstpl -16(%rsp)
49 movsd -16(%rsp),%xmm0
50 ret
51
523: jp 4b // in case x is �Inf
53 fstp %st(1)
54 fstp %st(1)
55 fstpl -16(%rsp)
56 movsd -16(%rsp),%xmm0
57 ret
58#else
59 fldl one
60 fldl 4(%esp) // x : 1
61 fxam
62 fnstsw
63 fld %st // x : x : 1
64 sahf
65 jc 3f // in case x is NaN or �Inf
664: fsub %st(2), %st // x-1 : x : 1
67 fld %st // x-1 : x-1 : x : 1
68 fabs // |x-1| : x-1 : x : 1
69 fcompl limit // x-1 : x : 1
70 fnstsw // x-1 : x : 1
71 andb $0x45, %ah
72 jz 2f
73 fstp %st(1) // x-1 : 1
74 fyl2xp1 // log(x)
75 ret
76
772: fstp %st(0) // x : 1
78 fyl2x // log(x)
79 ret
80
813: jp 4b // in case x is �Inf
82 fstp %st(1)
83 fstp %st(1)
84 ret
85#endif
lib/libc/mingw/math/x86/logb.c deleted-40
...@@ -1,40 +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 * Written by J.T. Conklin <jtc@netbsd.org>.
8 * Changes for long double by Ulrich Drepper <drepper@cygnus.com>
9 * Public domain.
10 */
11
12#include <math.h>
13
14double
15logb (double x)
16{
17#ifdef __x86_64__
18 __mingw_dbl_type_t hlp;
19 int lx, hx;
20
21 hlp.x = x;
22 lx = hlp.lh.low;
23 hx = hlp.lh.high & 0x7fffffff; /* high |x| */
24 if ((hx | lx) == 0)
25 return -1.0 / fabs (x);
26 if (hx >= 0x7ff00000)
27 return x * x;
28 if ((hx >>= 20) == 0) {
29 unsigned long long mantissa = hlp.val & 0xfffffffffffffULL;
30 return -1023.0 - (__builtin_clzll(mantissa) - 12);
31 }
32 return (double) (hx - 1023);
33#else
34 double res = 0.0;
35 asm volatile (
36 "fxtract\n\t"
37 "fstp %%st" : "=t" (res) : "0" (x));
38 return res;
39#endif
40}
lib/libc/mingw/math/x86/logbf.c deleted-37
...@@ -1,37 +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 * Written by J.T. Conklin <jtc@netbsd.org>.
8 * Changes for long double by Ulrich Drepper <drepper@cygnus.com>
9 * Public domain.
10 */
11
12#include <math.h>
13
14float
15logbf (float x)
16{
17#ifdef __x86_64__
18 int v;
19 __mingw_flt_type_t hlp;
20
21 hlp.x = x;
22 v = hlp.val & 0x7fffffff; /* high |x| */
23 if (!v)
24 return (float)-1.0 / fabsf (x);
25 if (v >= 0x7f800000)
26 return x * x;
27 if ((v >>= 23) == 0)
28 return -127.0 - (__builtin_clzl(hlp.val & 0x7fffff) - 9);
29 return (float) (v - 127);
30#else
31 float res = 0.0F;
32 asm volatile (
33 "fxtract\n\t"
34 "fstp %%st" : "=t" (res) : "0" (x));
35 return res;
36#endif
37}
lib/libc/mingw/math/x86/nearbyint.S deleted-51
...@@ -1,51 +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#include <_mingw_mac.h>
7
8 .file "nearbyint.S"
9 .text
10#ifdef __x86_64__
11 .align 8
12#else
13 .align 4
14#endif
15 .globl __MINGW_USYMBOL(nearbyint)
16 .def __MINGW_USYMBOL(nearbyint); .scl 2; .type 32; .endef
17__MINGW_USYMBOL(nearbyint):
18#if defined(_AMD64_) || defined(__x86_64__)
19 movsd %xmm0,-16(%rsp)
20 fldl -16(%rsp)
21 pushq %rax
22 pushq %rcx
23 fnstcw (%rsp)
24 movq (%rsp), %rax
25 orq $0x20, %rax
26 movq %rax, 8(%rsp)
27 fldcw 8(%rsp)
28 frndint
29 fclex
30 fldcw (%rsp)
31 popq %rcx
32 popq %rax
33 fstpl -16(%rsp)
34 movsd -16(%rsp),%xmm0
35 ret
36#elif defined(_X86_) || defined(__i386__)
37 fldl 4(%esp)
38 pushl %eax
39 pushl %ecx
40 fnstcw (%esp)
41 movl (%esp), %eax
42 orl $0x20, %eax
43 movl %eax, 4(%esp)
44 fldcw 4(%esp)
45 frndint
46 fclex
47 fldcw (%esp)
48 popl %ecx
49 popl %eax
50 ret
51#endif
lib/libc/mingw/math/x86/nearbyintf.S deleted-51
...@@ -1,51 +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#include <_mingw_mac.h>
7
8 .file "nearbyintf.S"
9 .text
10#ifdef __x86_64__
11 .align 8
12#else
13 .align 4
14#endif
15 .globl __MINGW_USYMBOL(nearbyintf)
16 .def __MINGW_USYMBOL(nearbyintf); .scl 2; .type 32; .endef
17__MINGW_USYMBOL(nearbyintf):
18#if defined(_AMD64_) || defined(__x86_64__)
19 movss %xmm0,-12(%rsp)
20 flds -12(%rsp)
21 pushq %rax
22 pushq %rcx
23 fnstcw (%rsp)
24 movq (%rsp), %rax
25 orq $0x20, %rax
26 movq %rax, 8(%rsp)
27 fldcw 8(%rsp)
28 frndint
29 fclex
30 fldcw (%rsp)
31 popq %rcx
32 popq %rax
33 fstps -12(%rsp)
34 movss -12(%rsp),%xmm0
35 ret
36#elif defined(_X86_) || defined(__i386__)
37 flds 4(%esp)
38 pushl %eax
39 pushl %ecx
40 fnstcw (%esp)
41 movl (%esp), %eax
42 orl $0x20, %eax
43 movl %eax, 4(%esp)
44 fldcw 4(%esp)
45 frndint
46 fclex
47 fldcw (%esp)
48 popl %ecx
49 popl %eax
50 ret
51#endif
lib/libc/mingw/math/x86/pow.c deleted-46
...@@ -1,46 +0,0 @@
1/*
2 This Software is provided under the Zope Public License (ZPL) Version 2.1.
3
4 Copyright (c) 2009, 2010 by the mingw-w64 project
5
6 See the AUTHORS file for the list of contributors to the mingw-w64 project.
7
8 This license has been certified as open source. It has also been designated
9 as GPL compatible by the Free Software Foundation (FSF).
10
11 Redistribution and use in source and binary forms, with or without
12 modification, are permitted provided that the following conditions are met:
13
14 1. Redistributions in source code must retain the accompanying copyright
15 notice, this list of conditions, and the following disclaimer.
16 2. Redistributions in binary form must reproduce the accompanying
17 copyright notice, this list of conditions, and the following disclaimer
18 in the documentation and/or other materials provided with the
19 distribution.
20 3. Names of the copyright holders must not be used to endorse or promote
21 products derived from this software without prior written permission
22 from the copyright holders.
23 4. The right to distribute this software or to use it for any purpose does
24 not give you the right to use Servicemarks (sm) or Trademarks (tm) of
25 the copyright holders. Use of them is covered by separate agreement
26 with the copyright holders.
27 5. If any files are modified, you must cause the modified files to carry
28 prominent notices stating that you changed the files and the date of
29 any change.
30
31 Disclaimer
32
33 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
34 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
35 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
36 EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
37 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
39 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
40 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
42 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43*/
44
45#define _NEW_COMPLEX_DOUBLE 1
46#include "pow.def.h"
lib/libc/mingw/math/x86/remainder.S deleted-40
...@@ -1,40 +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#include <_mingw_mac.h>
7
8 .file "remainder.S"
9 .text
10#ifdef __x86_64__
11 .align 8
12#else
13 .align 4
14#endif
15.globl __MINGW_USYMBOL(remainder)
16 .def __MINGW_USYMBOL(remainder); .scl 2; .type 32; .endef
17__MINGW_USYMBOL(remainder):
18#ifdef __x86_64__
19 movsd %xmm0,-16(%rsp)
20 movsd %xmm1,-32(%rsp)
21 fldl -32(%rsp)
22 fldl -16(%rsp)
231: fprem1
24 fstsw %ax
25 sahf
26 jp 1b
27 fstp %st(1)
28 fstpl -16(%rsp)
29 movsd -16(%rsp),%xmm0
30 ret
31#else
32 fldl 12(%esp)
33 fldl 4(%esp)
341: fprem1
35 fstsw %ax
36 sahf
37 jp 1b
38 fstp %st(1)
39 ret
40#endif
lib/libc/mingw/math/x86/remainderf.S deleted-40
...@@ -1,40 +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#include <_mingw_mac.h>
7
8 .file "remainderf.S"
9 .text
10#ifdef __x86_64__
11 .align 8
12#else
13 .align 4
14#endif
15.globl __MINGW_USYMBOL(remainder)
16 .def __MINGW_USYMBOL(remainderf); .scl 2; .type 32; .endef
17__MINGW_USYMBOL(remainderf):
18#ifdef __x86_64__
19 movss %xmm1,-12(%rsp)
20 flds -12(%rsp)
21 movss %xmm0,-12(%rsp)
22 flds -12(%rsp)
231: fprem1
24 fstsw %ax
25 sahf
26 jp 1b
27 fstp %st(1)
28 fstps -12(%rsp)
29 movss -12(%rsp),%xmm0
30 ret
31#else
32 flds 8(%esp)
33 flds 4(%esp)
341: fprem1
35 fstsw %ax
36 sahf
37 jp 1b
38 fstp %st(1)
39 ret
40#endif
lib/libc/mingw/math/x86/remquo.S deleted-75
...@@ -1,75 +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#include <_mingw_mac.h>
7
8 .file "remquo.S"
9 .text
10#ifdef __x86_64__
11 .align 8
12#else
13 .align 4
14#endif
15.globl __MINGW_USYMBOL(remquo)
16__MINGW_USYMBOL(remquo):
17#ifdef __x86_64__
18 movsd %xmm1,-16(%rsp)
19 fldl -16(%rsp)
20 movsd %xmm0,-16(%rsp)
21 fldl -16(%rsp)
221: fprem1
23 fstsw %ax
24 sahf
25 jp 1b
26 fstp %st(1)
27 movl %eax, %ecx
28 shrl $8, %eax
29 shrl $12, %ecx
30 andl $4, %ecx
31 andl $3, %eax
32 orl %eax, %ecx
33 leal (%ecx,%ecx,2),%ecx
34 movl $0xef2a60, %eax
35 shrl %cl, %eax
36 andl $7, %eax
37 movl -12(%rsp), %edx
38 movsd %xmm1,-16(%rsp)
39 xorl -12(%rsp), %edx
40 testl $0x80000000, %edx
41 jz 1f
42 negl %eax
431: movl %eax, (%r8)
44
45 fstpl -16(%rsp)
46 movsd -16(%rsp),%xmm0
47 ret
48#else
49 fldl 4 +8(%esp)
50 fldl 4(%esp)
511: fprem1
52 fstsw %ax
53 sahf
54 jp 1b
55 fstp %st(1)
56 movl %eax, %ecx
57 shrl $8, %eax
58 shrl $12, %ecx
59 andl $4, %ecx
60 andl $3, %eax
61 orl %eax, %ecx
62 leal (%ecx,%ecx,2),%ecx
63 movl $0xef2a60, %eax
64 shrl %cl, %eax
65 andl $7, %eax
66 movl 4 +8 +8(%esp), %ecx
67 movl 4 +4(%esp), %edx
68 xorl 4 +8 +4(%esp), %edx
69 testl $0x80000000, %edx
70 jz 1f
71 negl %eax
721: movl %eax, (%ecx)
73
74 ret
75#endif
lib/libc/mingw/math/x86/remquof.S deleted-76
...@@ -1,76 +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#include <_mingw_mac.h>
7
8 .file "remquof.S"
9 .text
10#ifdef __x86_64__
11 .align 8
12#else
13 .align 4
14#endif
15.globl __MINGW_USYMBOL(remquof)
16__MINGW_USYMBOL(remquof):
17#ifdef __x86_64__
18 movss %xmm1,-12(%rsp)
19 flds -12(%rsp)
20 movss %xmm0,-12(%rsp)
21 flds -12(%rsp)
221: fprem1
23 fstsw %ax
24 sahf
25 jp 1b
26 fstp %st(1)
27 movl %eax, %ecx
28 shrl $8, %eax
29 shrl $12, %ecx
30 andl $4, %ecx
31 andl $3, %eax
32 orl %eax, %ecx
33 movl $0xef2a60, %eax
34 leal (%ecx,%ecx,2),%ecx
35 shrl %cl, %eax
36 andl $7, %eax
37 movss %xmm0,-12(%rsp)
38 movl -12(%rsp), %edx
39 movss %xmm1,-12(%rsp)
40 xorl -12(%rsp), %edx
41 testl $0x80000000, %edx
42 jz 1f
43 negl %eax
441: movl %eax, (%r8)
45
46 fstps -12(%rsp)
47 movss -12(%rsp),%xmm0
48 ret
49#else
50 flds 4 +4(%esp)
51 flds 4(%esp)
521: fprem1
53 fstsw %ax
54 sahf
55 jp 1b
56 fstp %st(1)
57 movl %eax, %ecx
58 shrl $8, %eax
59 shrl $12, %ecx
60 andl $4, %ecx
61 andl $3, %eax
62 orl %eax, %ecx
63 movl $0xef2a60, %eax
64 leal (%ecx,%ecx,2),%ecx
65 shrl %cl, %eax
66 andl $7, %eax
67 movl 4 +4 +4(%esp), %ecx
68 movl 4(%esp), %edx
69 xorl 4 +4(%esp), %edx
70 testl $0x80000000, %edx
71 jz 1f
72 negl %eax
731: movl %eax, (%ecx)
74
75 ret
76#endif
lib/libc/mingw/math/x86/rint.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#include <math.h>
7
8double rint (double x) {
9 double retval = 0.0;
10 __asm__ __volatile__ ("frndint;" : "=t" (retval) : "0" (x));
11 return retval;
12}
lib/libc/mingw/math/x86/rintf.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#include <math.h>
7
8float rintf (float x) {
9 float retval = 0.0F;
10 __asm__ __volatile__ ("frndint;": "=t" (retval) : "0" (x));
11 return retval;
12}
lib/libc/mingw/math/x86/sin.c deleted-46
...@@ -1,46 +0,0 @@
1/*
2 This Software is provided under the Zope Public License (ZPL) Version 2.1.
3
4 Copyright (c) 2009, 2010 by the mingw-w64 project
5
6 See the AUTHORS file for the list of contributors to the mingw-w64 project.
7
8 This license has been certified as open source. It has also been designated
9 as GPL compatible by the Free Software Foundation (FSF).
10
11 Redistribution and use in source and binary forms, with or without
12 modification, are permitted provided that the following conditions are met:
13
14 1. Redistributions in source code must retain the accompanying copyright
15 notice, this list of conditions, and the following disclaimer.
16 2. Redistributions in binary form must reproduce the accompanying
17 copyright notice, this list of conditions, and the following disclaimer
18 in the documentation and/or other materials provided with the
19 distribution.
20 3. Names of the copyright holders must not be used to endorse or promote
21 products derived from this software without prior written permission
22 from the copyright holders.
23 4. The right to distribute this software or to use it for any purpose does
24 not give you the right to use Servicemarks (sm) or Trademarks (tm) of
25 the copyright holders. Use of them is covered by separate agreement
26 with the copyright holders.
27 5. If any files are modified, you must cause the modified files to carry
28 prominent notices stating that you changed the files and the date of
29 any change.
30
31 Disclaimer
32
33 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
34 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
35 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
36 EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
37 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
39 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
40 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
42 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43*/
44
45#define _NEW_COMPLEX_DOUBLE 1
46#include "sin.def.h"
lib/libc/mingw/math/x86/trunc.S deleted-91
...@@ -1,91 +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#include <_mingw_mac.h>
7
8 .file "trunc.S"
9 .text
10 .p2align 4,,15
11 .globl __MINGW_USYMBOL(trunc)
12 .def __MINGW_USYMBOL(trunc); .scl 2; .type 32; .endef
13
14#ifdef __x86_64__
15 .seh_proc __MINGW_USYMBOL(trunc)
16#endif
17__MINGW_USYMBOL(trunc):
18#if defined(_AMD64_) || defined(__x86_64__)
19 subq $24, %rsp
20 .seh_stackalloc 24
21 .seh_endprologue
22 movsd %xmm0, 8(%rsp)
23 movq 8(%rsp), %r8
24 movq %r8, %rdx
25 shrq $32, %rdx
26 movl %edx, %eax
27 sarl $20, %eax
28 andl $2047, %eax
29 leal -1023(%rax), %ecx
30 cmpl $19, %ecx
31 jg .l1
32 movl %edx, %r8d
33 andl $-2147483648, %r8d
34 testl %ecx, %ecx
35 js .l3
36 movl $1048575, %eax
37 sarl %cl, %eax
38 notl %eax
39 andl %edx, %eax
40 orl %r8d, %eax
41 salq $32, %rax
42 movq %rax, 8(%rsp)
43 movsd 8(%rsp), %xmm0
44 addq $24, %rsp
45 ret
46 .p2align 4,,10
47.l1:
48 cmpl $51, %ecx
49 jle .l2
50 /* Is x inf/nan? */
51 cmpl $1024, %ecx
52 jne .noinfnan
53 addsd %xmm0, %xmm0
54.noinfnan:
55 addq $24, %rsp
56 ret
57 .p2align 4,,10
58.l2:
59 leal -1043(%rax), %ecx
60 movl $-1, %r9d
61 salq $32, %rdx
62 shrl %cl, %r9d
63 notl %r9d
64 andl %r9d, %r8d
65 orq %r8, %rdx
66 movq %rdx, 8(%rsp)
67 movsd 8(%rsp), %xmm0
68 addq $24, %rsp
69 ret
70 .p2align 4,,10
71.l3:
72 salq $32, %r8
73 movq %r8, 8(%rsp)
74 movsd 8(%rsp), %xmm0
75 addq $24, %rsp
76 ret
77 .seh_endproc
78#elif defined(_X86_) || defined(__i386__)
79 fldl 4(%esp)
80 subl $8, %esp
81 fstcw (%esp)
82 /* FE_TOWARDZERO */
83 movzwl (%esp), %eax
84 orb $0xc, %ah
85 movw %ax, 4(%esp)
86 fldcw 4(%esp)
87 frndint
88 fldcw (%esp)
89 addl $8, %esp
90 ret
91#endif
lib/libc/mingw/math/x86/truncf.S deleted-71
...@@ -1,71 +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#include <_mingw_mac.h>
7
8 .file "truncf.S"
9 .text
10 .p2align 4,,15
11 .globl __MINGW_USYMBOL(truncf)
12 .def __MINGW_USYMBOL(truncf); .scl 2; .type 32; .endef
13
14#ifdef __x86_64__
15 .seh_proc __MINGW_USYMBOL(truncf)
16#endif
17__MINGW_USYMBOL(truncf):
18#if defined(_AMD64_) || defined(__x86_64__)
19 subq $24, %rsp
20 .seh_stackalloc 24
21 .seh_endprologue
22 movd %xmm0, 12(%rsp)
23 movl 12(%rsp), %edx
24 movl %edx, %ecx
25 sarl $23, %ecx
26 andl $255, %ecx
27 subl $127, %ecx
28 cmpl $22, %ecx
29 jg .l1
30 movl %edx, %r8d
31 andl $-2147483648, %r8d
32 testl %ecx, %ecx
33 js .l2
34 movl $8388607, %eax
35 sarl %cl, %eax
36 notl %eax
37 andl %edx, %eax
38 orl %r8d, %eax
39 movl %eax, 8(%rsp)
40 movss 8(%rsp), %xmm0
41 addq $24, %rsp
42 ret
43 .p2align 4,,10
44.l1:
45 addl $-128, %ecx
46 jne .noinfnan
47 addss %xmm0, %xmm0
48.noinfnan:
49 addq $24, %rsp
50 ret
51 .p2align 4,,10
52.l2:
53 movl %r8d, 8(%rsp)
54 movss 8(%rsp), %xmm0
55 addq $24, %rsp
56 ret
57 .seh_endproc
58#elif defined(_X86_) || defined(__i386__)
59 flds 4(%esp)
60 subl $8, %esp
61 fstcw (%esp)
62 /* FE_TOWARDZERO */
63 movzwl (%esp), %eax
64 orb $0xc, %ah
65 movw %ax, 4(%esp)
66 fldcw 4(%esp)
67 frndint
68 fldcw (%esp)
69 addl $8, %esp
70 ret
71#endif
lib/libc/mingw/misc/___mb_cur_max_func.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 <_mingw.h>
8
9extern int* __MINGW_IMP_SYMBOL(__mb_cur_max);
10
11int __cdecl ___mb_cur_max_func(void);
12int __cdecl ___mb_cur_max_func(void)
13{
14 return *__MINGW_IMP_SYMBOL(__mb_cur_max);
15}
16
17typedef int __cdecl (*_f___mb_cur_max_func)(void);
18_f___mb_cur_max_func __MINGW_IMP_SYMBOL(___mb_cur_max_func) = ___mb_cur_max_func;
lib/libc/mingw/misc/__p___argv.c deleted-15
...@@ -1,15 +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 <stdlib.h>
8
9char ***__cdecl __p___argv(void)
10{
11 return __MINGW_IMP_SYMBOL(__argv);
12}
13
14typedef char ***__cdecl (*_f__p___argv)(void);
15_f__p___argv __MINGW_IMP_SYMBOL(__p___argv) = __p___argv;
lib/libc/mingw/misc/__p__acmdln.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 <_mingw.h>
8
9extern char ** __MINGW_IMP_SYMBOL(_acmdln);
10
11char **__cdecl __p__acmdln(void);
12char **__cdecl __p__acmdln(void)
13{
14 return __MINGW_IMP_SYMBOL(_acmdln);
15}
16
17typedef char **__cdecl (*_f__p__acmdln)(void);
18_f__p__acmdln __MINGW_IMP_SYMBOL(__p__acmdln) = __p__acmdln;
lib/libc/mingw/misc/__p__commode.c deleted-17
...@@ -1,17 +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 <_mingw.h>
8
9extern int * __MINGW_IMP_SYMBOL(_commode);
10
11int *__cdecl __p__commode(void);
12int *__cdecl __p__commode(void)
13{
14 return __MINGW_IMP_SYMBOL(_commode);
15}
16
17typeof(__p__commode) *__MINGW_IMP_SYMBOL(__p__commode) = __p__commode;
lib/libc/mingw/misc/__p__fmode.c deleted-17
...@@ -1,17 +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 <_mingw.h>
8
9extern int * __MINGW_IMP_SYMBOL(_fmode);
10
11int *__cdecl __p__fmode(void);
12int *__cdecl __p__fmode(void)
13{
14 return __MINGW_IMP_SYMBOL(_fmode);
15}
16
17typeof(__p__fmode) *__MINGW_IMP_SYMBOL(__p__fmode) = __p__fmode;
lib/libc/mingw/misc/__p__wcmdln.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 <wchar.h>
8
9extern wchar_t ** __MINGW_IMP_SYMBOL(_wcmdln);
10
11wchar_t **__cdecl __p__wcmdln(void);
12wchar_t **__cdecl __p__wcmdln(void)
13{
14 return __MINGW_IMP_SYMBOL(_wcmdln);
15}
16
17typedef wchar_t **__cdecl (*_f__p__wcmdln)(void);
18_f__p__wcmdln __MINGW_IMP_SYMBOL(__p__wcmdln) = __p__wcmdln;
lib/libc/mingw/misc/_configthreadlocale.c deleted-16
...@@ -1,16 +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 <locale.h>
8
9int __cdecl _configthreadlocale(int flag)
10{
11 /* _ENABLE_PER_THREAD_LOCALE can't work on msvcrt.dll. */
12 return flag == _ENABLE_PER_THREAD_LOCALE ? -1 : _DISABLE_PER_THREAD_LOCALE;
13}
14
15void *__MINGW_IMP_SYMBOL(_configthreadlocale) = _configthreadlocale;
16
lib/libc/mingw/misc/_create_locale.c deleted-33
...@@ -1,33 +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 <windows.h>
8#include <locale.h>
9#include <msvcrt.h>
10
11static _locale_t __cdecl init_func(int category, const char *locale);
12_locale_t (__cdecl *__MINGW_IMP_SYMBOL(_create_locale))(int, const char *) = init_func;
13
14static _locale_t __cdecl null_func(int category, const char *locale)
15{
16 (void)category;
17 (void)locale;
18 return NULL;
19}
20
21static _locale_t __cdecl init_func(int category, const char *locale)
22{
23 HMODULE msvcrt = __mingw_get_msvcrt_handle();
24 _locale_t (__cdecl *func)(int, const char *) = NULL;
25
26 if (msvcrt)
27 func = (void*)GetProcAddress(msvcrt, "_create_locale");
28
29 if (!func)
30 func = null_func;
31
32 return (__MINGW_IMP_SYMBOL(_create_locale) = func)(category, locale);
33}
lib/libc/mingw/misc/_free_locale.c deleted-31
...@@ -1,31 +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 <windows.h>
8#include <locale.h>
9#include <msvcrt.h>
10
11static void __cdecl init_func(_locale_t locale);
12void (__cdecl *__MINGW_IMP_SYMBOL(_free_locale))(_locale_t) = init_func;
13
14static void __cdecl stub_func(_locale_t locale)
15{
16 (void)locale;
17}
18
19static void __cdecl init_func(_locale_t locale)
20{
21 HMODULE msvcrt = __mingw_get_msvcrt_handle();
22 void (__cdecl *func)(_locale_t) = NULL;
23
24 if (msvcrt)
25 func = (void*)GetProcAddress(msvcrt, "_free_locale");
26
27 if (!func)
28 func = stub_func;
29
30 (__MINGW_IMP_SYMBOL(_free_locale) = func)(locale);
31}
lib/libc/mingw/misc/_get_current_locale.c deleted-26
...@@ -1,26 +0,0 @@
1#include <windows.h>
2#include <locale.h>
3#include <msvcrt.h>
4
5static _locale_t __cdecl init_func(void);
6_locale_t (__cdecl *__MINGW_IMP_SYMBOL(_get_current_locale))(void) = init_func;
7
8static _locale_t __cdecl null_func(void)
9{
10 return NULL;
11}
12
13static _locale_t __cdecl init_func(void)
14{
15 HMODULE msvcrt = __mingw_get_msvcrt_handle();
16 _locale_t (__cdecl *func)(void) = NULL;
17
18 if (msvcrt) {
19 func = (void*)GetProcAddress(msvcrt, "_get_current_locale");
20 }
21
22 if (!func)
23 func = null_func;
24
25 return (__MINGW_IMP_SYMBOL(_get_current_locale) = func)();
26}
lib/libc/mingw/misc/imaxabs.c deleted-28
...@@ -1,28 +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 This source code was extracted from the Q8 package created and
8 placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil>
9 last edit: 1999/11/05 gwyn@arl.mil
10
11 Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E).
12
13 This particular implementation requires the matching <inttypes.h>.
14*/
15#define __CRT__NO_INLINE
16#include <inttypes.h>
17
18intmax_t
19__cdecl
20imaxabs (intmax_t _j)
21 { return _j >= 0 ? _j : -_j; }
22intmax_t (__cdecl *__MINGW_IMP_SYMBOL(imaxabs))(intmax_t) = imaxabs;
23
24long long __attribute__ ((alias ("imaxabs"))) __cdecl llabs (long long);
25long long (__cdecl *__MINGW_IMP_SYMBOL(llabs))(long long) = llabs;
26
27__int64 __attribute__ ((alias ("imaxabs"))) __cdecl _abs64 (__int64);
28__int64 (__cdecl *__MINGW_IMP_SYMBOL(_abs64))(__int64) = _abs64;
lib/libc/mingw/misc/imaxdiv.c deleted-35
...@@ -1,35 +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 This source code was extracted from the Q8 package created and
8 placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil>
9 last edit: 1999/11/05 gwyn@arl.mil
10
11
12 last edit: 1999/11/05 gwyn@arl.mil
13
14 Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E).
15
16*/
17
18#include <inttypes.h>
19#include <stdlib.h>
20
21imaxdiv_t
22__cdecl
23imaxdiv(intmax_t numer, intmax_t denom)
24{
25 imaxdiv_t result;
26 result.quot = numer / denom;
27 result.rem = numer % denom;
28 return result;
29}
30imaxdiv_t (__cdecl *__MINGW_IMP_SYMBOL(imaxdiv))(intmax_t, intmax_t) = imaxdiv;
31
32lldiv_t __attribute__ ((alias ("imaxdiv")))
33__cdecl
34lldiv (long long, long long);
35lldiv_t (__cdecl *__MINGW_IMP_SYMBOL(lldiv))(long long, long long) = lldiv;
lib/libc/mingw/misc/invalid_parameter_handler.c deleted-23
...@@ -1,23 +0,0 @@
1#define _CRTIMP
2#include <windows.h>
3
4typedef void (__cdecl *_invalid_parameter_handler)(const wchar_t *,const wchar_t *,const wchar_t *,unsigned int,uintptr_t);
5static _invalid_parameter_handler handler;
6
7static _invalid_parameter_handler __cdecl mingw_set_invalid_parameter_handler(_invalid_parameter_handler new_handler)
8{
9 return InterlockedExchangePointer((void**)&handler, new_handler);
10}
11
12_invalid_parameter_handler (__cdecl *__MINGW_IMP_SYMBOL(_set_invalid_parameter_handler))(_invalid_parameter_handler) =
13 mingw_set_invalid_parameter_handler;
14
15static _invalid_parameter_handler __cdecl mingw_get_invalid_parameter_handler(void)
16{
17 return handler;
18}
19
20_invalid_parameter_handler (__cdecl *__MINGW_IMP_SYMBOL(_get_invalid_parameter_handler))(void) = mingw_get_invalid_parameter_handler;
21
22_invalid_parameter_handler __cdecl _get_invalid_parameter_handler(void) __attribute__ ((alias ("mingw_get_invalid_parameter_handler")));
23_invalid_parameter_handler __cdecl _set_invalid_parameter_handler(_invalid_parameter_handler new_handler) __attribute__ ((alias ("mingw_set_invalid_parameter_handler")));
lib/libc/mingw/misc/lc_locale_func.c deleted-59
...@@ -1,59 +0,0 @@
1#define __lc_codepage __dummy_lc_codepage
2#define ___lc_codepage_func __dummy____lc_codepage_func
3#include <windows.h>
4#include <locale.h>
5
6#undef __lc_codepage
7#undef ___lc_codepage_func
8#include "mb_wc_common.h"
9
10static unsigned int __cdecl setlocale_codepage_hack(void)
11{
12 /* locale :: "lang[_country[.code_page]]" | ".code_page" */
13 const char *cp_str = strchr (setlocale(LC_CTYPE, NULL), '.');
14 return cp_str ? atoi(cp_str + 1) : 0;
15}
16
17#ifndef __LIBMSVCRT_OS__
18
19unsigned int (__cdecl *__MINGW_IMP_SYMBOL(___lc_codepage_func))(void) = setlocale_codepage_hack;
20
21#else
22
23#include <msvcrt.h>
24
25static unsigned int *msvcrt__lc_codepage;
26static unsigned int __cdecl msvcrt___lc_codepage_func(void)
27{
28 return *msvcrt__lc_codepage;
29}
30
31static unsigned int __cdecl init_codepage_func(void);
32unsigned int (__cdecl *__MINGW_IMP_SYMBOL(___lc_codepage_func))(void) = init_codepage_func;
33
34static unsigned int __cdecl init_codepage_func(void)
35{
36 HMODULE msvcrt = __mingw_get_msvcrt_handle();
37 unsigned int (__cdecl *func)(void) = NULL;
38
39 if(msvcrt) {
40 func = (void*)GetProcAddress(msvcrt, "___lc_codepage_func");
41 if(!func) {
42 msvcrt__lc_codepage = (unsigned int*)GetProcAddress(msvcrt, "__lc_codepage");
43 if(msvcrt__lc_codepage)
44 func = msvcrt___lc_codepage_func;
45 }
46 }
47
48 if(!func)
49 func = setlocale_codepage_hack;
50
51 return (__MINGW_IMP_SYMBOL(___lc_codepage_func) = func)();
52}
53
54#endif
55
56unsigned int __cdecl ___lc_codepage_func(void)
57{
58 return __MINGW_IMP_SYMBOL(___lc_codepage_func)();
59}
lib/libc/mingw/misc/mbrtowc.c deleted-156
...@@ -1,156 +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#ifndef WIN32_LEAN_AND_MEAN
7#define WIN32_LEAN_AND_MEAN
8#endif
9#include "mb_wc_common.h"
10#include <wchar.h>
11#include <stdlib.h>
12#include <errno.h>
13#include <windows.h>
14
15static int __MINGW_ATTRIB_NONNULL(1) __MINGW_ATTRIB_NONNULL(4)
16__mbrtowc_cp (wchar_t * __restrict__ pwc, const char * __restrict__ s,
17 size_t n, mbstate_t* __restrict__ ps,
18 const unsigned int cp, const unsigned int mb_max)
19{
20 union {
21 mbstate_t val;
22 char mbcs[4];
23 } shift_state;
24
25 /* Do the prelim checks */
26 if (s == NULL)
27 return 0;
28
29 if (n == 0)
30 /* The standard doesn't mention this case explicitly. Tell
31 caller that the conversion from a non-null s is incomplete. */
32 return -2;
33
34 /* Save the current shift state, in case we need it in DBCS case. */
35 shift_state.val = *ps;
36 *ps = 0;
37
38 if (!*s)
39 {
40 *pwc = 0;
41 return 0;
42 }
43
44 if (mb_max > 1)
45 {
46 if (shift_state.mbcs[0] != 0)
47 {
48 /* Complete the mb char with the trailing byte. */
49 shift_state.mbcs[1] = *s; /* the second byte */
50 if (MultiByteToWideChar(cp, MB_ERR_INVALID_CHARS,
51 shift_state.mbcs, 2, pwc, 1)
52 == 0)
53 {
54 /* An invalid trailing byte */
55 errno = EILSEQ;
56 return -1;
57 }
58 return 2;
59 }
60 else if (IsDBCSLeadByteEx (cp, *s))
61 {
62 /* If told to translate one byte, just save the leadbyte
63 in *ps. */
64 if (n < 2)
65 {
66 ((char*) ps)[0] = *s;
67 return -2;
68 }
69 /* Else translate the first two bytes */
70 else if (MultiByteToWideChar (cp, MB_ERR_INVALID_CHARS,
71 s, 2, pwc, 1)
72 == 0)
73 {
74 errno = EILSEQ;
75 return -1;
76 }
77 return 2;
78 }
79 }
80
81 /* Fall through to single byte char */
82 if (cp == 0)
83 *pwc = (wchar_t)(unsigned char)*s;
84
85 else if (MultiByteToWideChar (cp, MB_ERR_INVALID_CHARS, s, 1, pwc, 1)
86 == 0)
87 {
88 errno = EILSEQ;
89 return -1;
90 }
91
92 return 1;
93}
94
95size_t
96mbrtowc (wchar_t * __restrict__ pwc, const char * __restrict__ s,
97 size_t n, mbstate_t* __restrict__ ps)
98{
99 static mbstate_t internal_mbstate = 0;
100 wchar_t byte_bucket = 0;
101 wchar_t* dst = pwc ? pwc : &byte_bucket;
102
103 return (size_t) __mbrtowc_cp (dst, s, n, ps ? ps : &internal_mbstate,
104 ___lc_codepage_func(), MB_CUR_MAX);
105}
106
107
108size_t
109mbsrtowcs (wchar_t* __restrict__ dst, const char ** __restrict__ src,
110 size_t len, mbstate_t* __restrict__ ps)
111{
112 int ret =0 ;
113 size_t n = 0;
114 static mbstate_t internal_mbstate = 0;
115 mbstate_t* internal_ps = ps ? ps : &internal_mbstate;
116 const unsigned int cp = ___lc_codepage_func();
117 const unsigned int mb_max = MB_CUR_MAX;
118
119 if (src == NULL || *src == NULL) /* undefined behavior */
120 return 0;
121
122 if (dst != NULL)
123 {
124 while (n < len
125 && (ret = __mbrtowc_cp(dst, *src, len - n,
126 internal_ps, cp, mb_max))
127 > 0)
128 {
129 ++dst;
130 *src += ret;
131 n += ret;
132 }
133
134 if (n < len && ret == 0)
135 *src = (char *)NULL;
136 }
137 else
138 {
139 wchar_t byte_bucket = 0;
140 while ((ret = __mbrtowc_cp (&byte_bucket, *src + n, mb_max,
141 internal_ps, cp, mb_max))
142 > 0)
143 n += ret;
144 }
145 return n;
146}
147
148size_t
149mbrlen (const char * __restrict__ s, size_t n,
150 mbstate_t * __restrict__ ps)
151{
152 static mbstate_t s_mbstate = 0;
153 wchar_t byte_bucket = 0;
154 return __mbrtowc_cp (&byte_bucket, s, n, (ps) ? ps : &s_mbstate,
155 ___lc_codepage_func(), MB_CUR_MAX);
156}
lib/libc/mingw/misc/mbsinit.c deleted-32
...@@ -1,32 +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/* This source code was extracted from the Q8 package created and placed
7 in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil>
8 last edit: 1999/11/05 gwyn@arl.mil
9
10 Implements subclause 7.24 of ISO/IEC 9899:1999 (E).
11
12 It supports an encoding where all char codes are mapped
13 to the *same* code values within a wchar_t or wint_t,
14 so long as no other wchar_t codes are used by the program.
15
16*/
17
18#define __CRT__NO_INLINE
19#include <wchar.h>
20
21#if 0
22int mbsinit(const mbstate_t *ps)
23{
24 return 1; /* don't have shift states */
25}
26#endif
27
28int __cdecl mbsinit(const mbstate_t *_P)
29{
30 return (!_P || *_P == 0);
31}
32
lib/libc/mingw/misc/onexit_table.c deleted-77
...@@ -1,77 +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 <process.h>
8#include <stdlib.h>
9
10#define _EXIT_LOCK1 8
11
12void __cdecl _lock (int _File);
13void __cdecl _unlock (int _File);
14
15int __cdecl _initialize_onexit_table(_onexit_table_t *table)
16{
17 if (!table) return -1;
18 table->_first = table->_last = table->_end = NULL;
19 return 0;
20}
21
22int __cdecl _register_onexit_function(_onexit_table_t *table, _onexit_t func)
23{
24 if (!table) return -1;
25
26 _lock(_EXIT_LOCK1);
27
28 if (!table->_first) {
29 table->_first = calloc(32, sizeof(void*));
30 if (!table->_first) {
31 _unlock(_EXIT_LOCK1);
32 return -1;
33 }
34 table->_last = table->_first;
35 table->_end = table->_first + 32;
36 }
37
38 if (table->_last == table->_end) {
39 size_t len = table->_end - table->_first;
40 _PVFV *new_buf = realloc(table->_first, len * sizeof(void*) * 2);
41 if (!new_buf) {
42 _unlock(_EXIT_LOCK1);
43 return -1;
44 }
45 table->_first = new_buf;
46 table->_last = new_buf + len;
47 table->_end = new_buf + len * 2;
48 }
49
50 *table->_last++ = (_PVFV)func;
51 _unlock(_EXIT_LOCK1);
52 return 0;
53}
54
55int __cdecl _execute_onexit_table(_onexit_table_t *table)
56{
57 _PVFV *first, *last;
58
59 _lock(_EXIT_LOCK1);
60 first = table->_first;
61 last = table->_last;
62 _initialize_onexit_table(table);
63 _unlock(_EXIT_LOCK1);
64
65 if (!first) return 0;
66
67 while (--last >= first)
68 if (*last)
69 (**last)();
70
71 free(first);
72 return 0;
73}
74
75typeof(_initialize_onexit_table) *__MINGW_IMP_SYMBOL(_initialize_onexit_table) = _initialize_onexit_table;
76typeof(_register_onexit_function) *__MINGW_IMP_SYMBOL(_register_onexit_function) = _register_onexit_function;
77typeof(_execute_onexit_table) *__MINGW_IMP_SYMBOL(_execute_onexit_table) = _execute_onexit_table;
lib/libc/mingw/misc/output_format.c deleted-62
...@@ -1,62 +0,0 @@
1#define _get_output_format __dummy__get_output_format
2#define _set_output_format __dummy__set_output_format
3#include <windows.h>
4#include <msvcrt.h>
5
6#undef _get_output_format
7#undef _set_output_format
8
9static unsigned int last_value = 0;
10typedef unsigned int (*f_get_output_format)(void);
11typedef unsigned int (*f_set_output_format)(unsigned int);
12
13static unsigned int init_set_output_format(unsigned int);
14f_set_output_format __MINGW_IMP_SYMBOL(_set_output_format) = init_set_output_format;
15
16unsigned int _set_output_format(unsigned int format);
17unsigned int _set_output_format(unsigned int format)
18{
19 return __MINGW_IMP_SYMBOL(_set_output_format)(format);
20}
21
22static unsigned int fake_set_output_format(unsigned int value)
23{
24 return InterlockedExchange((LONG*)&last_value, value);
25}
26
27static unsigned int init_set_output_format(unsigned int format)
28{
29 f_set_output_format sof;
30
31 sof = (f_set_output_format) GetProcAddress (__mingw_get_msvcrt_handle(), "_set_output_format");
32 if(!sof)
33 sof = fake_set_output_format;
34
35 return (__MINGW_IMP_SYMBOL(_set_output_format) = sof)(format);
36}
37
38
39static unsigned int init_get_output_format(void);
40f_get_output_format __MINGW_IMP_SYMBOL(_get_output_format) = init_get_output_format;
41
42unsigned int _get_output_format(void);
43unsigned int _get_output_format(void)
44{
45 return __MINGW_IMP_SYMBOL(_get_output_format)();
46}
47
48static unsigned int fake_get_output_format(void)
49{
50 return last_value;
51}
52
53static unsigned int init_get_output_format(void)
54{
55 f_get_output_format gof;
56
57 gof = (f_get_output_format) GetProcAddress (__mingw_get_msvcrt_handle(), "_get_output_format");
58 if(!gof)
59 gof = fake_get_output_format;
60
61 return (__MINGW_IMP_SYMBOL(_get_output_format) = gof)();
62}
lib/libc/mingw/misc/purecall.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#define _CRTIMP
8#include <stdlib.h>
9#include <windows.h>
10
11_purecall_handler __cdecl _set_purecall_handler(_purecall_handler handler)
12{
13 static _purecall_handler prev_handler;
14 return InterlockedExchangePointer((void**)&prev_handler, handler);
15}
16
17void *__MINGW_IMP_SYMBOL(_set_purecall_handler) = _set_purecall_handler;
18
lib/libc/mingw/misc/register_tls_atexit.c deleted-29
...@@ -1,29 +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 <process.h>
8#include <windows.h>
9#include <winnt.h>
10#include <stdlib.h>
11
12static _tls_callback_type callback;
13
14static void run_callback(void)
15{
16 if (callback)
17 callback(NULL, DLL_PROCESS_DETACH, 0);
18 callback = NULL;
19}
20
21void __cdecl _register_thread_local_exe_atexit_callback(_tls_callback_type cb)
22{
23 callback = cb;
24 /* This should guarantee that the callback is called. It won't be run in the
25 * exact right spot as intended to, but it will be run. */
26 atexit(run_callback);
27}
28
29typeof(_register_thread_local_exe_atexit_callback) *__MINGW_IMP_SYMBOL(_register_thread_local_exe_atexit_callback) = _register_thread_local_exe_atexit_callback;
lib/libc/mingw/misc/seterrno.c deleted-24
...@@ -1,24 +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#include <errno.h>
7
8errno_t __cdecl _set_errno (int _Value)
9{
10 errno = _Value;
11 return 0;
12}
13
14errno_t __cdecl _get_errno (int *_Value)
15{
16 if(!_Value)
17 {
18 errno = EINVAL;
19 return EINVAL;
20 }
21
22 *_Value = errno;
23 return 0;
24}
lib/libc/mingw/misc/strtoimax.c deleted-123
...@@ -1,123 +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 This source code was extracted from the Q8 package created and
8 placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil>
9 last edit: 1999/11/05 gwyn@arl.mil
10
11 Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E).
12
13 This particular implementation requires the matching <inttypes.h>.
14 It also assumes that character codes for A..Z and a..z are in
15 contiguous ascending order; this is true for ASCII but not EBCDIC.
16*/
17#include <stdlib.h>
18#include <errno.h>
19#include <ctype.h>
20#include <inttypes.h>
21
22/* Helper macros */
23
24/* convert digit character to number, in any base */
25#define ToNumber(c) (isdigit(c) ? (c) - '0' : \
26 isupper(c) ? (c) - 'A' + 10 : \
27 islower(c) ? (c) - 'a' + 10 : \
28 -1 /* "invalid" flag */ \
29 )
30/* validate converted digit character for specific base */
31#define valid(n, b) ((n) >= 0 && (n) < (b))
32
33intmax_t
34__cdecl
35strtoimax(const char * __restrict__ nptr, char ** __restrict__ endptr, int base)
36 {
37 register uintmax_t accum; /* accumulates converted value */
38 register int n; /* numeral from digit character */
39 int minus; /* set iff minus sign seen */
40 int toobig; /* set iff value overflows */
41
42 if ( endptr != NULL )
43 *endptr = (char *)nptr; /* in case no conversion's performed */
44
45 if ( base < 0 || base == 1 || base > 36 )
46 {
47 errno = EDOM;
48 return 0; /* unspecified behavior */
49 }
50
51 /* skip initial, possibly empty sequence of white-space characters */
52
53 while ( isspace(*nptr) )
54 ++nptr;
55
56 /* process subject sequence: */
57
58 /* optional sign */
59 if ( (minus = *nptr == '-') || *nptr == '+' )
60 ++nptr;
61
62 if ( base == 0 ) {
63 if ( *nptr == '0' ) {
64 if ( nptr[1] == 'X' || nptr[1] == 'x' )
65 base = 16;
66 else
67 base = 8;
68 }
69 else
70 base = 10;
71 }
72 /* optional "0x" or "0X" for base 16 */
73
74 if ( base == 16 && *nptr == '0' && (nptr[1] == 'X' || nptr[1] == 'x') )
75 nptr += 2; /* skip past this prefix */
76
77 /* check whether there is at least one valid digit */
78
79 n = ToNumber(*nptr);
80 ++nptr;
81
82 if ( !valid(n, base) )
83 return 0; /* subject seq. not of expected form */
84
85 accum = n;
86
87 for ( toobig = 0; n = ToNumber(*nptr), valid(n, base); ++nptr )
88 if ( accum > (uintmax_t)(INTMAX_MAX / base + 2) ) /* major wrap-around */
89 toobig = 1; /* but keep scanning */
90 else
91 accum = base * accum + n;
92
93 if ( endptr != NULL )
94 *endptr = (char *)nptr; /* points to first not-valid-digit */
95
96 if ( minus )
97 {
98 if ( accum > (uintmax_t)INTMAX_MAX + 1 )
99 toobig = 1;
100 }
101 else
102 if ( accum > (uintmax_t)INTMAX_MAX )
103 toobig = 1;
104
105 if ( toobig )
106 {
107 errno = ERANGE;
108 return minus ? INTMAX_MIN : INTMAX_MAX;
109 }
110 else
111 return (intmax_t)(minus ? -accum : accum);
112 }
113intmax_t (__cdecl *__MINGW_IMP_SYMBOL(strtoimax))(const char* __restrict__, char ** __restrict__, int) = strtoimax;
114
115long long __attribute__ ((alias ("strtoimax")))
116__cdecl
117strtoll (const char* __restrict__ nptr, char ** __restrict__ endptr, int base);
118long long (__cdecl *__MINGW_IMP_SYMBOL(strtoll))(const char* __restrict__, char ** __restrict__, int) = strtoll;
119
120__int64 __attribute__ ((alias ("strtoimax")))
121__cdecl
122_strtoi64 (const char* __restrict__ nptr, char ** __restrict__ endptr, int base);
123__int64 (__cdecl *__MINGW_IMP_SYMBOL(_strtoi64))(const char* __restrict__, char ** __restrict__, int) = _strtoi64;
lib/libc/mingw/misc/strtoumax.c deleted-121
...@@ -1,121 +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 This source code was extracted from the Q8 package created and
8 placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil>
9 last edit: 1999/11/05 gwyn@arl.mil
10
11 Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E).
12
13 This particular implementation requires the matching <inttypes.h>.
14 It also assumes that character codes for A..Z and a..z are in
15 contiguous ascending order; this is true for ASCII but not EBCDIC.
16*/
17#include <stdlib.h>
18#include <errno.h>
19#include <ctype.h>
20#include <inttypes.h>
21
22/* Helper macros */
23
24/* convert digit character to number, in any base */
25#define ToNumber(c) (isdigit(c) ? (c) - '0' : \
26 isupper(c) ? (c) - 'A' + 10 : \
27 islower(c) ? (c) - 'a' + 10 : \
28 -1 /* "invalid" flag */ \
29 )
30/* validate converted digit character for specific base */
31#define valid(n, b) ((n) >= 0 && (n) < (b))
32
33uintmax_t
34__cdecl
35strtoumax(const char * __restrict__ nptr, char ** __restrict__ endptr, int base)
36 {
37 register uintmax_t accum; /* accumulates converted value */
38 register uintmax_t next; /* for computing next value of accum */
39 register int n; /* numeral from digit character */
40 int minus; /* set iff minus sign seen (yes!) */
41 int toobig; /* set iff value overflows */
42
43 if ( endptr != NULL )
44 *endptr = (char *)nptr; /* in case no conversion's performed */
45
46 if ( base < 0 || base == 1 || base > 36 )
47 {
48 errno = EDOM;
49 return 0; /* unspecified behavior */
50 }
51
52 /* skip initial, possibly empty sequence of white-space characters */
53
54 while ( isspace(*nptr) )
55 ++nptr;
56
57 /* process subject sequence: */
58
59 /* optional sign (yes!) */
60
61 if ( (minus = *nptr == '-') || *nptr == '+' )
62 ++nptr;
63
64 if ( base == 0 )
65 {
66 if ( *nptr == '0' )
67 {
68 if ( nptr[1] == 'X' || nptr[1] == 'x' )
69 base = 16;
70 else
71 base = 8;
72 }
73 else
74 base = 10;
75 }
76
77 /* optional "0x" or "0X" for base 16 */
78
79 if ( base == 16 && *nptr == '0' && (nptr[1] == 'X' || nptr[1] == 'x') )
80 nptr += 2; /* skip past this prefix */
81
82 /* check whether there is at least one valid digit */
83
84 n = ToNumber(*nptr);
85 ++nptr;
86
87 if ( !valid(n, base) )
88 return 0; /* subject seq. not of expected form */
89
90 accum = n;
91
92 for ( toobig = 0; n = ToNumber(*nptr), valid(n, base); ++nptr )
93 if ( accum > UINTMAX_MAX / base + 1 /* major wrap-around */
94 || (next = base * accum + n) < accum /* minor wrap-around */
95 )
96 toobig = 1; /* but keep scanning */
97 else
98 accum = next;
99
100 if ( endptr != NULL )
101 *endptr = (char *)nptr; /* points to first not-valid-digit */
102
103 if ( toobig )
104 {
105 errno = ERANGE;
106 return UINTMAX_MAX;
107 }
108 else
109 return minus ? -accum : accum; /* (yes!) */
110 }
111uintmax_t (__cdecl *__MINGW_IMP_SYMBOL(strtoumax))(const char* __restrict__, char ** __restrict__, int) = strtoumax;
112
113unsigned long long __attribute__ ((alias ("strtoumax")))
114__cdecl
115strtoull (const char* __restrict__ nptr, char ** __restrict__ endptr, int base);
116unsigned long long (__cdecl *__MINGW_IMP_SYMBOL(strtoull))(const char* __restrict__, char ** __restrict__, int) = strtoull;
117
118unsigned __int64 __attribute__ ((alias ("strtoumax")))
119__cdecl
120_strtoui64 (const char* __restrict__ nptr, char ** __restrict__ endptr, int base);
121unsigned __int64 (__cdecl *__MINGW_IMP_SYMBOL(_strtoui64))(const char* __restrict__, char ** __restrict__, int) = _strtoui64;
lib/libc/mingw/misc/wassert.c deleted-49
...@@ -1,49 +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 <assert.h>
8#include <stdlib.h>
9#include <windows.h>
10#include "msvcrt.h"
11
12/* _wassert is not available on XP, so forward it to _assert if needed */
13static void __cdecl mingw_wassert(const wchar_t *_Message, const wchar_t *_File, unsigned _Line)
14{
15 char *message = NULL, *file = NULL;
16 size_t len;
17
18 if ((len = wcstombs(NULL, _Message, 0)) != (size_t)-1)
19 {
20 message = malloc(len + 1);
21 wcstombs(message, _Message, len + 1);
22 }
23
24 if ((len = wcstombs(NULL, _File, 0)) != (size_t)-1)
25 {
26 file = malloc(len + 1);
27 wcstombs(file, _File, len + 1);
28 }
29
30 _assert(message, file, _Line);
31
32 free(message);
33 free(file);
34}
35
36static void __cdecl init_wassert(const wchar_t *message, const wchar_t *file, unsigned line);
37
38void (__cdecl *__MINGW_IMP_SYMBOL(_wassert))(const wchar_t*, const wchar_t*,unsigned) = init_wassert;
39
40static void __cdecl init_wassert(const wchar_t *message, const wchar_t *file, unsigned line)
41{
42 void *func;
43
44 func = (void*)GetProcAddress(__mingw_get_msvcrt_handle(), "_wassert");
45 if(!func)
46 func = mingw_wassert;
47
48 return (__MINGW_IMP_SYMBOL(_wassert) = func)(message, file, line);
49}
lib/libc/mingw/misc/wcrtomb.c deleted-100
...@@ -1,100 +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#ifndef WIN32_LEAN_AND_MEAN
7#define WIN32_LEAN_AND_MEAN
8#endif
9#include "mb_wc_common.h"
10#include <wchar.h>
11#include <stdlib.h>
12#include <errno.h>
13#include <limits.h>
14#include <windows.h>
15
16__attribute__((noinline))
17static int __MINGW_ATTRIB_NONNULL(1)
18 __wcrtomb_cp (char *dst, wchar_t wc, const unsigned int cp,
19 const unsigned int mb_max)
20{
21 if (cp == 0)
22 {
23 if (wc > 255)
24 {
25 errno = EILSEQ;
26 return -1;
27 }
28 *dst = (char) wc;
29 return 1;
30 }
31 else
32 {
33 int invalid_char = 0;
34
35 int size = WideCharToMultiByte (cp, 0 /* Is this correct flag? */,
36 &wc, 1, dst, mb_max,
37 NULL, &invalid_char);
38 if (size == 0 || invalid_char)
39 {
40 errno = EILSEQ;
41 return -1;
42 }
43 return size;
44 }
45}
46
47size_t
48wcrtomb (char *dst, wchar_t wc, mbstate_t * __UNUSED_PARAM (ps))
49{
50 char byte_bucket [MB_LEN_MAX];
51 char* tmp_dst = dst ? dst : &byte_bucket[0];
52 return (size_t)__wcrtomb_cp (tmp_dst, wc, ___lc_codepage_func(),
53 MB_CUR_MAX);
54}
55
56size_t wcsrtombs (char *dst, const wchar_t **src, size_t len,
57 mbstate_t * __UNUSED_PARAM (ps))
58{
59 int ret = 0;
60 size_t n = 0;
61 const unsigned int cp = ___lc_codepage_func();
62 const unsigned int mb_max = MB_CUR_MAX;
63 const wchar_t *pwc = *src;
64
65 if (src == NULL || *src == NULL) /* undefined behavior */
66 return 0;
67
68 if (dst != NULL)
69 {
70 while (n < len)
71 {
72 if ((ret = __wcrtomb_cp (dst, *pwc, cp, mb_max)) <= 0)
73 return (size_t) -1;
74 n += ret;
75 dst += ret;
76 if (*(dst - 1) == '\0')
77 {
78 *src = (wchar_t *) NULL;
79 return (n - 1);
80 }
81 pwc++;
82 }
83 *src = pwc;
84 }
85 else
86 {
87 char byte_bucket [MB_LEN_MAX];
88 while (1)
89 {
90 if ((ret = __wcrtomb_cp (&byte_bucket[0], *pwc, cp, mb_max)) <= 0)
91 return (size_t) -1;
92 n += ret;
93 if (byte_bucket [ret - 1] == '\0')
94 return (n - 1);
95 pwc++;
96 }
97 }
98
99 return n;
100}
lib/libc/mingw/secapi/_access_s.c deleted-46
...@@ -1,46 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <io.h>
6
7static errno_t __cdecl _int_access_s (const char *, int);
8static errno_t __cdecl _stub (const char *, int);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_access_s))(const char *, int) =
11 _stub;
12
13static errno_t __cdecl
14_stub (const char *s, int m)
15{
16 errno_t __cdecl (*f)(const char *, int) = __MINGW_IMP_SYMBOL(_access_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(const char *, int))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_access_s");
22 if (!f)
23 f = _int_access_s;
24 __MINGW_IMP_SYMBOL(_access_s) = f;
25 }
26 return (*f)(s, m);
27}
28
29errno_t __cdecl
30_access_s (const char *s, int m)
31{
32 return _stub (s, m);
33}
34
35static errno_t __cdecl
36_int_access_s (const char *s, int m)
37{
38 if (!s || (m & ~6) != 0)
39 {
40 _access (NULL, m);
41 return EINVAL;
42 }
43 if (!_access (s, m))
44 return 0;
45 return errno;
46}
lib/libc/mingw/secapi/_cgets_s.c deleted-55
...@@ -1,55 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <sec_api/conio_s.h>
6
7static errno_t __cdecl _int_cgets_s (char *, size_t, size_t *);
8static errno_t __cdecl _stub (char *, size_t, size_t *);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_cgets_s))(char *, size_t, size_t *) =
11 _stub;
12
13static errno_t __cdecl
14_stub (char *s, size_t l, size_t *r_len)
15{
16 errno_t __cdecl (*f)(char *, size_t, size_t *) = __MINGW_IMP_SYMBOL(_cgets_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(char *, size_t, size_t *))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_cgets_s");
22 if (!f)
23 f = _int_cgets_s;
24 __MINGW_IMP_SYMBOL(_cgets_s) = f;
25 }
26 return (*f)(s, l, r_len);
27}
28
29errno_t __cdecl
30_cgets_s (char *s, size_t l, size_t *r_len)
31{
32 return _stub (s, l, r_len);
33}
34
35static errno_t __cdecl
36_int_cgets_s (char *s, size_t l, size_t *r_len)
37{
38 char *h, *p;
39
40 if (s && l)
41 s[0] = 0;
42 if (!s || !l || !r_len)
43 {
44 _cgets (NULL);
45 return EINVAL;
46 }
47 p = (char *) alloca (l + 2);
48 p[0] = l;
49 h = _cgets (s);
50 if (!h)
51 return EINVAL;
52 *r_len = (size_t) p[1];
53 memcpy (s, &p[2], *r_len);
54 return 0;
55}
lib/libc/mingw/secapi/_cgetws_s.c deleted-55
...@@ -1,55 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <sec_api/conio_s.h>
6
7static errno_t __cdecl _int_cgetws_s (wchar_t *, size_t, size_t *);
8static errno_t __cdecl _stub (wchar_t *, size_t, size_t *);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_cgetws_s))(wchar_t *, size_t, size_t *) =
11 _stub;
12
13static errno_t __cdecl
14_stub (wchar_t *s, size_t l, size_t *r_len)
15{
16 errno_t __cdecl (*f)(wchar_t *, size_t, size_t *) = __MINGW_IMP_SYMBOL(_cgetws_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(wchar_t *, size_t, size_t *))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_cgetws_s");
22 if (!f)
23 f = _int_cgetws_s;
24 __MINGW_IMP_SYMBOL(_cgetws_s) = f;
25 }
26 return (*f)(s, l, r_len);
27}
28
29errno_t __cdecl
30_cgetws_s (wchar_t *s, size_t l, size_t *r_len)
31{
32 return _stub (s, l, r_len);
33}
34
35static errno_t __cdecl
36_int_cgetws_s (wchar_t *s, size_t l, size_t *r_len)
37{
38 wchar_t *h, *p;
39
40 if (s && l)
41 s[0] = 0;
42 if (!s || !l || !r_len)
43 {
44 _cgetws (NULL);
45 return EINVAL;
46 }
47 p = (wchar_t *) alloca ((l + 2) * sizeof (wchar_t));
48 p[0] = l;
49 h = _cgetws (s);
50 if (!h)
51 return EINVAL;
52 *r_len = (size_t) p[1];
53 memcpy (s, &p[2], *r_len);
54 return 0;
55}
lib/libc/mingw/secapi/_chsize_s.c deleted-46
...@@ -1,46 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <io.h>
6
7static errno_t __cdecl _int_chsize_s (int, long long);
8static errno_t __cdecl _stub (int, long long);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_chsize_s))(int, long long) =
11 _stub;
12
13static errno_t __cdecl
14_stub (int fd, long long sz)
15{
16 errno_t __cdecl (*f)(int, long long) = __MINGW_IMP_SYMBOL(_chsize_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(int, long long))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_chsize_s");
22 if (!f)
23 f = _int_chsize_s;
24 __MINGW_IMP_SYMBOL(_chsize_s) = f;
25 }
26 return (*f)(fd, sz);
27}
28
29errno_t __cdecl
30_chsize_s (int fd, long long sz)
31{
32 return _stub (fd, sz);
33}
34
35static errno_t __cdecl
36_int_chsize_s (int fd, long long sz)
37{
38 if (sz > 0x7fffffffll)
39 {
40 /* We can't set file bigger as 2GB, so return EACCES. */
41 return (errno = EACCES);
42 }
43 if (!_chsize (fd, sz))
44 return 0;
45 return errno;
46}
lib/libc/mingw/secapi/_controlfp_s.c deleted-56
...@@ -1,56 +0,0 @@
1#include <float.h>
2#include <errno.h>
3#include <windows.h>
4#include <msvcrt.h>
5
6static errno_t __cdecl _stub(
7 unsigned int *currentControl,
8 unsigned int newControl,
9 unsigned int mask
10);
11
12errno_t __cdecl (*__MINGW_IMP_SYMBOL(_controlfp_s))(unsigned int *, unsigned int, unsigned int) = _stub;
13
14errno_t __cdecl _controlfp_s(
15 unsigned int *currentControl,
16 unsigned int newControl,
17 unsigned int mask
18){
19 return __MINGW_IMP_SYMBOL(_controlfp_s)(currentControl,newControl,mask);
20}
21
22static const unsigned int allflags = _MCW_DN | _MCW_EM | _MCW_IC | _MCW_RC | _MCW_PC;
23static errno_t __cdecl _int_controlfp_s(
24 unsigned int *currentControl,
25 unsigned int newControl,
26 unsigned int mask
27){
28 unsigned int cont;
29 if(!(newControl & mask & ~allflags)){
30 if (currentControl) *currentControl = _controlfp( 0, 0 );
31 return EINVAL;
32 }
33 cont = _controlfp( newControl, mask );
34 if(currentControl) *currentControl = cont;
35 return 0;
36}
37
38static errno_t __cdecl _stub (
39 unsigned int *currentControl,
40 unsigned int newControl,
41 unsigned int mask
42)
43{
44 errno_t __cdecl (*f)(unsigned int *, unsigned int, unsigned int) = __MINGW_IMP_SYMBOL(_controlfp_s);
45
46 if (f == _stub)
47 {
48 f = (errno_t __cdecl (*)(unsigned int *, unsigned int, unsigned int))
49 GetProcAddress (__mingw_get_msvcrt_handle (), "_controlfp_s");
50 if (!f)
51 f = _int_controlfp_s;
52 __MINGW_IMP_SYMBOL(_controlfp_s) = f;
53 }
54 return (*f)(currentControl, newControl, mask);
55}
56
lib/libc/mingw/secapi/_cprintf_s.c deleted-20
...@@ -1,20 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <sec_api/conio_s.h>
6
7int __cdecl (*__MINGW_IMP_SYMBOL(_cprintf_s))(const char *,...) =
8 _cprintf_s;
9
10int __cdecl
11_cprintf_s (const char *s, ...)
12{
13 va_list argp;
14 int r;
15
16 va_start (argp, s);
17 r = _vcprintf_s (s, argp);
18 va_end (argp);
19 return r;
20}
lib/libc/mingw/secapi/_cprintf_s_l.c deleted-20
...@@ -1,20 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <sec_api/conio_s.h>
6
7int __cdecl (*__MINGW_IMP_SYMBOL(_cprintf_s_l))(const char *, _locale_t, ...) =
8 _cprintf_s_l;
9
10int __cdecl
11_cprintf_s_l (const char *s, _locale_t loc, ...)
12{
13 va_list argp;
14 int r;
15
16 va_start (argp, loc);
17 r = _vcprintf_s_l (s, loc, argp);
18 va_end (argp);
19 return r;
20}
lib/libc/mingw/secapi/_ctime32_s.c deleted-56
...@@ -1,56 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <time.h>
4#include <errno.h>
5#include <msvcrt.h>
6
7static errno_t __cdecl _int_ctime32_s (char *, size_t, const __time32_t *);
8static errno_t __cdecl _stub (char *, size_t, const __time32_t *);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_ctime32_s))(char *, size_t, const __time32_t *) =
11 _stub;
12
13static errno_t __cdecl
14_stub (char *d, size_t dn, const __time32_t *pt)
15{
16 errno_t __cdecl (*f)(char *, size_t, const __time32_t *) = __MINGW_IMP_SYMBOL(_ctime32_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(char *, size_t, const __time32_t *))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_ctime32_s");
22 if (!f)
23 f = _int_ctime32_s;
24 __MINGW_IMP_SYMBOL(_ctime32_s) = f;
25 }
26 return (*f)(d, dn, pt);
27}
28
29errno_t __cdecl
30_ctime32_s (char *d, size_t dn, const __time32_t *pt)
31{
32 return _stub (d, dn, pt);
33}
34
35static errno_t __cdecl
36_int_ctime32_s (char *d, size_t dn, const __time32_t *pt)
37{
38 struct tm ltm;
39 errno_t e;
40
41 if (!d || !dn)
42 {
43 errno = EINVAL;
44 return EINVAL;
45 }
46 d[0] = 0;
47 if (!pt)
48 {
49 errno = EINVAL;
50 return EINVAL;
51 }
52
53 if ((e = _localtime32_s (&ltm, pt)) != 0)
54 return e;
55 return asctime_s (d, dn, &ltm);
56}
lib/libc/mingw/secapi/_ctime64_s.c deleted-56
...@@ -1,56 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <time.h>
4#include <errno.h>
5#include <msvcrt.h>
6
7static errno_t __cdecl _int_ctime64_s (char *, size_t, const __time64_t *);
8static errno_t __cdecl _stub (char *, size_t, const __time64_t *);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_ctime64_s))(char *, size_t, const __time64_t *) =
11 _stub;
12
13static errno_t __cdecl
14_stub (char *d, size_t dn, const __time64_t *pt)
15{
16 errno_t __cdecl (*f)(char *, size_t, const __time64_t *) = __MINGW_IMP_SYMBOL(_ctime64_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(char *, size_t, const __time64_t *))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_ctime64_s");
22 if (!f)
23 f = _int_ctime64_s;
24 __MINGW_IMP_SYMBOL(_ctime64_s) = f;
25 }
26 return (*f)(d, dn, pt);
27}
28
29errno_t __cdecl
30_ctime64_s (char *d, size_t dn, const __time64_t *pt)
31{
32 return _stub (d, dn, pt);
33}
34
35static errno_t __cdecl
36_int_ctime64_s (char *d, size_t dn, const __time64_t *pt)
37{
38 struct tm ltm;
39 errno_t e;
40
41 if (!d || !dn)
42 {
43 errno = EINVAL;
44 return EINVAL;
45 }
46 d[0] = 0;
47 if (!pt)
48 {
49 errno = EINVAL;
50 return EINVAL;
51 }
52
53 if ((e = _localtime64_s (&ltm, pt)) != 0)
54 return e;
55 return asctime_s (d, dn, &ltm);
56}
lib/libc/mingw/secapi/_cwprintf_s.c deleted-20
...@@ -1,20 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <sec_api/conio_s.h>
6
7int __cdecl (*__MINGW_IMP_SYMBOL(_cwprintf_s))(const wchar_t *,...) =
8 _cwprintf_s;
9
10int __cdecl
11_cwprintf_s (const wchar_t *s, ...)
12{
13 va_list argp;
14 int r;
15
16 va_start (argp, s);
17 r = _vcwprintf_s (s, argp);
18 va_end (argp);
19 return r;
20}
lib/libc/mingw/secapi/_cwprintf_s_l.c deleted-20
...@@ -1,20 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <sec_api/conio_s.h>
6
7int __cdecl (*__MINGW_IMP_SYMBOL(_cwprintf_s_l))(const wchar_t *, _locale_t, ...) =
8 _cwprintf_s_l;
9
10int __cdecl
11_cwprintf_s_l (const wchar_t *s, _locale_t loc, ...)
12{
13 va_list argp;
14 int r;
15
16 va_start (argp, loc);
17 r = _vcwprintf_s_l (s, loc, argp);
18 va_end (argp);
19 return r;
20}
lib/libc/mingw/secapi/_gmtime32_s.c deleted-51
...@@ -1,51 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <time.h>
4#include <errno.h>
5#include <msvcrt.h>
6
7static errno_t __cdecl _int_gmtime32_s (struct tm *, const __time32_t *);
8static errno_t __cdecl _stub (struct tm *, const __time32_t *);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_gmtime32_s))(struct tm *, const __time32_t *) =
11 _stub;
12
13static errno_t __cdecl
14_stub (struct tm *ptm, const __time32_t *pt)
15{
16 errno_t __cdecl (*f)(struct tm *, const __time32_t *) = __MINGW_IMP_SYMBOL(_gmtime32_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(struct tm *, const __time32_t *))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_gmtime32_s");
22 if (!f)
23 f = _int_gmtime32_s;
24 __MINGW_IMP_SYMBOL(_gmtime32_s) = f;
25 }
26 return (*f)(ptm, pt);
27}
28
29errno_t __cdecl
30_gmtime32_s (struct tm *ptm, const __time32_t *pt)
31{
32 return _stub (ptm, pt);
33}
34
35static errno_t __cdecl
36_int_gmtime32_s (struct tm *ptm, const __time32_t *pt)
37{
38 struct tm *ltm;
39
40 if (ptm)
41 memset (ptm, 0xff, sizeof (*ptm));
42 if (!ptm || !pt)
43 {
44 errno = EINVAL;
45 return EINVAL;
46 }
47 if ((ltm = _gmtime32 (pt)) == NULL)
48 return errno;
49 *ptm = *ltm;
50 return 0;
51}
lib/libc/mingw/secapi/_gmtime64_s.c deleted-51
...@@ -1,51 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <time.h>
4#include <errno.h>
5#include <msvcrt.h>
6
7static errno_t __cdecl _int_gmtime64_s (struct tm *, const __time64_t *);
8static errno_t __cdecl _stub (struct tm *, const __time64_t *);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_gmtime64_s))(struct tm *, const __time64_t *) =
11 _stub;
12
13static errno_t __cdecl
14_stub (struct tm *ptm, const __time64_t *pt)
15{
16 errno_t __cdecl (*f)(struct tm *, const __time64_t *) = __MINGW_IMP_SYMBOL(_gmtime64_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(struct tm *, const __time64_t *))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_gmtime64_s");
22 if (!f)
23 f = _int_gmtime64_s;
24 __MINGW_IMP_SYMBOL(_gmtime64_s) = f;
25 }
26 return (*f)(ptm, pt);
27}
28
29errno_t __cdecl
30_gmtime64_s (struct tm *ptm, const __time64_t *pt)
31{
32 return _stub (ptm, pt);
33}
34
35static errno_t __cdecl
36_int_gmtime64_s (struct tm *ptm, const __time64_t *pt)
37{
38 struct tm *ltm;
39
40 if (ptm)
41 memset (ptm, 0xff, sizeof (*ptm));
42 if (!ptm || !pt)
43 {
44 errno = EINVAL;
45 return EINVAL;
46 }
47 if ((ltm = _gmtime64 (pt)) == NULL)
48 return errno;
49 *ptm = *ltm;
50 return 0;
51}
lib/libc/mingw/secapi/_localtime32_s.c deleted-51
...@@ -1,51 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <time.h>
4#include <errno.h>
5#include <msvcrt.h>
6
7static errno_t __cdecl _int_localtime32_s (struct tm *, const __time32_t *);
8static errno_t __cdecl _stub (struct tm *, const __time32_t *);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_localtime32_s))(struct tm *, const __time32_t *) =
11 _stub;
12
13static errno_t __cdecl
14_stub (struct tm *ptm, const __time32_t *pt)
15{
16 errno_t __cdecl (*f)(struct tm *, const __time32_t *) = __MINGW_IMP_SYMBOL(_localtime32_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(struct tm *, const __time32_t *))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_localtime32_s");
22 if (!f)
23 f = _int_localtime32_s;
24 __MINGW_IMP_SYMBOL(_localtime32_s) = f;
25 }
26 return (*f)(ptm, pt);
27}
28
29errno_t __cdecl
30_localtime32_s (struct tm *ptm, const __time32_t *pt)
31{
32 return _stub (ptm, pt);
33}
34
35static errno_t __cdecl
36_int_localtime32_s (struct tm *ptm, const __time32_t *pt)
37{
38 struct tm *ltm;
39
40 if (ptm)
41 memset (ptm, 0xff, sizeof (*ptm));
42 if (!ptm || !pt)
43 {
44 errno = EINVAL;
45 return EINVAL;
46 }
47 if ((ltm = _localtime32 (pt)) == NULL)
48 return errno;
49 *ptm = *ltm;
50 return 0;
51}
lib/libc/mingw/secapi/_localtime64_s.c deleted-51
...@@ -1,51 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <time.h>
4#include <errno.h>
5#include <msvcrt.h>
6
7static errno_t __cdecl _int_localtime64_s (struct tm *, const __time64_t *);
8static errno_t __cdecl _stub (struct tm *, const __time64_t *);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_localtime64_s))(struct tm *, const __time64_t *) =
11 _stub;
12
13static errno_t __cdecl
14_stub (struct tm *ptm, const __time64_t *pt)
15{
16 errno_t __cdecl (*f)(struct tm *, const __time64_t *) = __MINGW_IMP_SYMBOL(_localtime64_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(struct tm *, const __time64_t *))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_localtime64_s");
22 if (!f)
23 f = _int_localtime64_s;
24 __MINGW_IMP_SYMBOL(_localtime64_s) = f;
25 }
26 return (*f)(ptm, pt);
27}
28
29errno_t __cdecl
30_localtime64_s (struct tm *ptm, const __time64_t *pt)
31{
32 return _stub (ptm, pt);
33}
34
35static errno_t __cdecl
36_int_localtime64_s (struct tm *ptm, const __time64_t *pt)
37{
38 struct tm *ltm;
39
40 if (ptm)
41 memset (ptm, 0xff, sizeof (*ptm));
42 if (!ptm || !pt)
43 {
44 errno = EINVAL;
45 return EINVAL;
46 }
47 if ((ltm = _localtime64 (pt)) == NULL)
48 return errno;
49 *ptm = *ltm;
50 return 0;
51}
lib/libc/mingw/secapi/_mktemp_s.c deleted-54
...@@ -1,54 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <io.h>
6
7static errno_t __cdecl _int_mktemp_s (char *, size_t);
8static errno_t __cdecl _stub (char *, size_t);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_mktemp_s))(char *, size_t) =
11 _stub;
12
13static errno_t __cdecl
14_stub (char *d, size_t dn)
15{
16 errno_t __cdecl (*f)(char *, size_t) = __MINGW_IMP_SYMBOL(_mktemp_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(char *, size_t))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_mktemp_s");
22 if (!f)
23 f = _int_mktemp_s;
24 __MINGW_IMP_SYMBOL(_mktemp_s) = f;
25 }
26 return (*f)(d, dn);
27}
28
29errno_t __cdecl
30_mktemp_s (char *d, size_t dn)
31{
32 return _stub (d, dn);
33}
34
35static errno_t __cdecl
36_int_mktemp_s (char *d, size_t dn)
37{
38 size_t sz;
39 if (!d || !dn)
40 {
41 _mktemp (NULL);
42 return EINVAL;
43 }
44 sz = strnlen (d, dn);
45 if (sz >= dn || sz < 6)
46 {
47 d[0] = 0;
48 _mktemp (NULL);
49 return EINVAL;
50 }
51 if (_mktemp (d) != NULL)
52 return 0;
53 return errno;
54}
lib/libc/mingw/secapi/_sopen_s.c deleted-42
...@@ -1,42 +0,0 @@
1#include <windows.h>
2#include <io.h>
3#include <errno.h>
4#include <msvcrt.h>
5
6static errno_t __cdecl _int_sopen_s(int *, const char *, int, int, int);
7static errno_t __cdecl _stub(int *, const char *, int, int, int);
8
9errno_t __cdecl (*__MINGW_IMP_SYMBOL(_sopen_s))(int *, const char *, int, int, int) = _stub;
10
11static errno_t __cdecl
12_stub (int* pfh, const char *filename, int oflag, int shflag, int pmode)
13{
14 errno_t __cdecl (*f)(int *, const char *, int, int, int) = __MINGW_IMP_SYMBOL(_sopen_s);
15
16 if (f == _stub) {
17 f = (errno_t __cdecl (*)(int *, const char *, int, int, int))
18 GetProcAddress (__mingw_get_msvcrt_handle (), "_sopen_s");
19 if (f == NULL)
20 f = _int_sopen_s;
21 __MINGW_IMP_SYMBOL(_sopen_s) = f;
22 }
23
24 return (*f)(pfh, filename, oflag, shflag, pmode);
25}
26
27static errno_t __cdecl _int_sopen_s(int* pfh, const char *filename, int oflag, int shflag, int pmode)
28{
29 if (pfh == NULL || filename == NULL) {
30 if (pfh != NULL) *pfh = -1;
31 errno = EINVAL;
32 return EINVAL;
33 }
34
35 *pfh = _sopen(filename, oflag, shflag, pmode);
36 return errno;
37}
38
39errno_t __cdecl _sopen_s(int* pfh, const char *filename, int oflag, int shflag, int pmode)
40{
41 return _stub (pfh, filename, oflag, shflag, pmode);
42}
lib/libc/mingw/secapi/_strdate_s.c deleted-68
...@@ -1,68 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <time.h>
4#include <errno.h>
5#include <msvcrt.h>
6
7static errno_t __cdecl _int_strdate_s (char *, size_t);
8static errno_t __cdecl _stub (char *, size_t);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_strdate_s))(char *, size_t) =
11 _stub;
12
13static errno_t __cdecl
14_stub (char *d, size_t dn)
15{
16 errno_t __cdecl (*f)(char *, size_t) = __MINGW_IMP_SYMBOL(_strdate_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(char *, size_t))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_strdate_s");
22 if (!f)
23 f = _int_strdate_s;
24 __MINGW_IMP_SYMBOL(_strdate_s) = f;
25 }
26 return (*f)(d, dn);
27}
28
29errno_t __cdecl
30_strdate_s (char *d, size_t dn)
31{
32 return _stub (d, dn);
33}
34
35static errno_t __cdecl
36_int_strdate_s (char *d, size_t dn)
37{
38 SYSTEMTIME dt;
39
40 if (!d || !dn)
41 {
42 errno = EINVAL;
43 return EINVAL;
44 }
45
46 d[0] = 0;
47
48 if (dn < 9)
49 {
50 errno = ERANGE;
51 return ERANGE;
52 }
53
54 GetLocalTime (&dt);
55 dt.wYear %= 100;
56
57 d[0] = (char) (dt.wMonth / 10 + '0');
58 d[1] = (char) (dt.wMonth % 10 + '0');
59 d[2] = '/';
60 d[3] = (char) (dt.wDay / 10 + '0');
61 d[4] = (char) (dt.wDay % 10 + '0');
62 d[5] = '/';
63 d[6] = (char) (dt.wYear / 10 + '0');
64 d[7] = (char) (dt.wYear % 10 + '0');
65 d[8] = 0;
66
67 return 0;
68}
lib/libc/mingw/secapi/_strtime_s.c deleted-72
...@@ -1,72 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <time.h>
4#include <errno.h>
5#include <msvcrt.h>
6
7static errno_t __cdecl _int_strtime_s (char *, size_t);
8static errno_t __cdecl _stub (char *, size_t);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_strtime_s))(char *, size_t) =
11 _stub;
12
13static errno_t __cdecl
14_stub (char *d, size_t dn)
15{
16 errno_t __cdecl (*f)(char *, size_t) = __MINGW_IMP_SYMBOL(_strtime_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(char *, size_t))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_strtime_s");
22 if (!f)
23 f = _int_strtime_s;
24 __MINGW_IMP_SYMBOL(_strtime_s) = f;
25 }
26 return (*f)(d, dn);
27}
28
29errno_t __cdecl
30_strtime_s (char *d, size_t dn)
31{
32 return _stub (d, dn);
33}
34
35static errno_t __cdecl
36_int_strtime_s (char *d, size_t dn)
37{
38 SYSTEMTIME dt;
39 int hours, minutes, seconds;
40
41 if (!d || !dn)
42 {
43 errno = EINVAL;
44 return EINVAL;
45 }
46
47 d[0] = 0;
48
49 if (dn < 9)
50 {
51 errno = ERANGE;
52 return ERANGE;
53 }
54
55 GetLocalTime (&dt);
56 dt.wYear %= 100;
57
58 hours = dt.wHour;
59 minutes = dt.wMinute;
60 seconds = dt.wSecond;
61
62 d[2] = d[5] = ':';
63 d[0] = (char) (hours / 10 + '0');
64 d[1] = (char) (hours % 10 + '0');
65 d[3] = (char) (minutes / 10 + '0');
66 d[4] = (char) (minutes % 10 + '0');
67 d[6] = (char) (seconds / 10 + '0');
68 d[7] = (char) (seconds % 10 + '0');
69 d[8] = 0;
70
71 return 0;
72}
lib/libc/mingw/secapi/_umask_s.c deleted-45
...@@ -1,45 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <io.h>
6
7static errno_t __cdecl _int_umask_s (int, int *);
8static errno_t __cdecl _stub (int, int *);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_umask_s))(int, int *) =
11 _stub;
12
13static errno_t __cdecl
14_stub (int m, int *pold)
15{
16 errno_t __cdecl (*f)(int, int *) = __MINGW_IMP_SYMBOL(_umask_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(int, int *))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_umask_s");
22 if (!f)
23 f = _int_umask_s;
24 __MINGW_IMP_SYMBOL(_umask_s) = f;
25 }
26 return (*f)(m, pold);
27}
28
29errno_t __cdecl
30_umask_s (int m, int *pold)
31{
32 return _stub (m, pold);
33}
34
35static errno_t __cdecl
36_int_umask_s (int m, int *pold)
37{
38 if (!pold)
39 {
40 errno = EINVAL;
41 return EINVAL;
42 }
43 *pold = _umask (m);
44 return 0;
45}
lib/libc/mingw/secapi/_vcprintf_s.c deleted-39
...@@ -1,39 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <sec_api/conio_s.h>
6
7static int __cdecl _int_vcprintf_s (const char *, va_list);
8static int __cdecl _stub (const char *, va_list);
9
10int __cdecl (*__MINGW_IMP_SYMBOL(_vcprintf_s))(const char *, va_list) =
11 _stub;
12
13static int __cdecl
14_stub (const char *s, va_list argp)
15{
16 int __cdecl (*f)(const char *, va_list) = __MINGW_IMP_SYMBOL(_vcprintf_s);
17
18 if (f == _stub)
19 {
20 f = (int __cdecl (*)(const char *, va_list))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_vcprintf_s");
22 if (!f)
23 f = _int_vcprintf_s;
24 __MINGW_IMP_SYMBOL(_vcprintf_s) = f;
25 }
26 return (*f)(s, argp);
27}
28
29int __cdecl
30_vcprintf_s (const char *s, va_list argp)
31{
32 return _stub (s, argp);
33}
34
35static int __cdecl
36_int_vcprintf_s (const char *s, va_list argp)
37{
38 return _vcprintf (s, argp);
39}
lib/libc/mingw/secapi/_vcprintf_s_l.c deleted-39
...@@ -1,39 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <sec_api/conio_s.h>
6
7static int __cdecl _int_vcprintf_s_l (const char *, _locale_t, va_list);
8static int __cdecl _stub (const char *, _locale_t, va_list);
9
10int __cdecl (*__MINGW_IMP_SYMBOL(_vcprintf_s_l))(const char *, _locale_t, va_list) =
11 _stub;
12
13static int __cdecl
14_stub (const char *s, _locale_t loc, va_list argp)
15{
16 int __cdecl (*f)(const char *, _locale_t, va_list) = __MINGW_IMP_SYMBOL(_vcprintf_s_l);
17
18 if (f == _stub)
19 {
20 f = (int __cdecl (*)(const char *, _locale_t, va_list))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_vcprintf_s_l");
22 if (!f)
23 f = _int_vcprintf_s_l;
24 __MINGW_IMP_SYMBOL(_vcprintf_s_l) = f;
25 }
26 return (*f)(s, loc, argp);
27}
28
29int __cdecl
30_vcprintf_s_l (const char *s, _locale_t loc, va_list argp)
31{
32 return _stub (s, loc, argp);
33}
34
35static int __cdecl
36_int_vcprintf_s_l (const char *s, _locale_t loc, va_list argp)
37{
38 return _vcprintf_l (s, loc, argp);
39}
lib/libc/mingw/secapi/_vcwprintf_s.c deleted-39
...@@ -1,39 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <sec_api/wchar_s.h>
6
7static int __cdecl _int_vcwprintf_s (const wchar_t *, va_list);
8static int __cdecl _stub (const wchar_t *, va_list);
9
10int __cdecl (*__MINGW_IMP_SYMBOL(_vcwprintf_s))(const wchar_t *, va_list) =
11 _stub;
12
13static int __cdecl
14_stub (const wchar_t *s, va_list argp)
15{
16 int __cdecl (*f)(const wchar_t *, va_list) = __MINGW_IMP_SYMBOL(_vcwprintf_s);
17
18 if (f == _stub)
19 {
20 f = (int __cdecl (*)(const wchar_t *, va_list))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_vcwprintf_s");
22 if (!f)
23 f = _int_vcwprintf_s;
24 __MINGW_IMP_SYMBOL(_vcwprintf_s) = f;
25 }
26 return (*f)(s, argp);
27}
28
29int __cdecl
30_vcwprintf_s (const wchar_t *s, va_list argp)
31{
32 return _stub (s, argp);
33}
34
35static int __cdecl
36_int_vcwprintf_s (const wchar_t *s, va_list argp)
37{
38 return _vcwprintf (s, argp);
39}
lib/libc/mingw/secapi/_vcwprintf_s_l.c deleted-39
...@@ -1,39 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <sec_api/wchar_s.h>
6
7static int __cdecl _int_vcwprintf_s_l (const wchar_t *, _locale_t, va_list);
8static int __cdecl _stub (const wchar_t *, _locale_t, va_list);
9
10int __cdecl (*__MINGW_IMP_SYMBOL(_vcwprintf_s_l))(const wchar_t *, _locale_t, va_list) =
11 _stub;
12
13static int __cdecl
14_stub (const wchar_t *s, _locale_t loc, va_list argp)
15{
16 int __cdecl (*f)(const wchar_t *, _locale_t, va_list) = __MINGW_IMP_SYMBOL(_vcwprintf_s_l);
17
18 if (f == _stub)
19 {
20 f = (int __cdecl (*)(const wchar_t *, _locale_t, va_list))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_vcwprintf_s_l");
22 if (!f)
23 f = _int_vcwprintf_s_l;
24 __MINGW_IMP_SYMBOL(_vcwprintf_s_l) = f;
25 }
26 return (*f)(s, loc, argp);
27}
28
29int __cdecl
30_vcwprintf_s_l (const wchar_t *s, _locale_t loc, va_list argp)
31{
32 return _stub (s, loc, argp);
33}
34
35static int __cdecl
36_int_vcwprintf_s_l (const wchar_t *s, _locale_t loc, va_list argp)
37{
38 return _vcwprintf_l (s, loc, argp);
39}
lib/libc/mingw/secapi/_vscprintf_p.c deleted-8
...@@ -1,8 +0,0 @@
1#include <sec_api/stdio_s.h>
2
3int __cdecl _vscprintf_p(const char *format, va_list arglist)
4{
5 return _vscprintf_p_l(format, NULL, arglist);
6}
7
8int __cdecl (*__MINGW_IMP_SYMBOL(_vscprintf_p))(const char *, va_list) = _vscprintf_p;
lib/libc/mingw/secapi/_vscwprintf_p.c deleted-8
...@@ -1,8 +0,0 @@
1#include <sec_api/stdio_s.h>
2
3int __cdecl _vscwprintf_p(const wchar_t *format, va_list arglist)
4{
5 return _vscwprintf_p_l(format, NULL, arglist);
6}
7
8int __cdecl (*__MINGW_IMP_SYMBOL(_vscwprintf_p))(const wchar_t *, va_list) = _vscwprintf_p;
lib/libc/mingw/secapi/_vswprintf_p.c deleted-8
...@@ -1,8 +0,0 @@
1#include <sec_api/stdio_s.h>
2
3int __cdecl _vswprintf_p(wchar_t *_DstBuf, size_t _MaxCount, const wchar_t *_Format, va_list _ArgList)
4{
5 return _vswprintf_p_l(_DstBuf, _MaxCount, _Format, NULL, _ArgList);
6}
7
8int __cdecl (*__MINGW_IMP_SYMBOL(_vswprintf_p))(wchar_t*,size_t,const wchar_t*,va_list) = _vswprintf_p;
lib/libc/mingw/secapi/_waccess_s.c deleted-46
...@@ -1,46 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <sec_api/wchar_s.h>
6
7static errno_t __cdecl _int_waccess_s (const wchar_t *, int);
8static errno_t __cdecl _stub (const wchar_t *, int);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_waccess_s))(const wchar_t *, int) =
11 _stub;
12
13static errno_t __cdecl
14_stub (const wchar_t *s, int m)
15{
16 errno_t __cdecl (*f)(const wchar_t *, int) = __MINGW_IMP_SYMBOL(_waccess_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(const wchar_t *, int))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_waccess_s");
22 if (!f)
23 f = _int_waccess_s;
24 __MINGW_IMP_SYMBOL(_waccess_s) = f;
25 }
26 return (*f)(s, m);
27}
28
29errno_t __cdecl
30_waccess_s (const wchar_t *s, int m)
31{
32 return _stub (s, m);
33}
34
35static errno_t __cdecl
36_int_waccess_s (const wchar_t *s, int m)
37{
38 if (!s || (m & ~6) != 0)
39 {
40 _waccess (NULL, m);
41 return EINVAL;
42 }
43 if (!_waccess (s, m))
44 return 0;
45 return errno;
46}
lib/libc/mingw/secapi/_wasctime_s.c deleted-52
...@@ -1,52 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <time.h>
4#include <errno.h>
5#include <msvcrt.h>
6
7static errno_t __cdecl _int_wasctime_s (wchar_t *, size_t, const struct tm *);
8static errno_t __cdecl _stub (wchar_t *, size_t, const struct tm *);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_wasctime_s))(wchar_t *, size_t, const struct tm *) =
11 _stub;
12
13static errno_t __cdecl
14_stub (wchar_t *d, size_t dn, const struct tm *pt)
15{
16 errno_t __cdecl (*f)(wchar_t *, size_t, const struct tm *) = __MINGW_IMP_SYMBOL(_wasctime_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(wchar_t *, size_t, const struct tm *))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_wasctime_s");
22 if (!f)
23 f = _int_wasctime_s;
24 __MINGW_IMP_SYMBOL(_wasctime_s) = f;
25 }
26 return (*f)(d, dn, pt);
27}
28
29errno_t __cdecl
30_wasctime_s (wchar_t *d, size_t dn, const struct tm *pt)
31{
32 return _stub (d, dn, pt);
33}
34
35static errno_t __cdecl
36_int_wasctime_s (wchar_t *d, size_t dn, const struct tm *pt)
37{
38 wchar_t *tmp;
39 size_t i;
40
41 if (d && dn)
42 d[0] = 0;
43 if (!d || dn < 26 || !pt || (tmp = _wasctime (pt)) == NULL)
44 {
45 errno = EINVAL;
46 return EINVAL;
47 }
48 for (i = 0; tmp[i] != 0; i++)
49 d[i] = tmp[i];
50 d[i] = 0;
51 return 0;
52}
lib/libc/mingw/secapi/_wctime32_s.c deleted-56
...@@ -1,56 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <time.h>
4#include <errno.h>
5#include <msvcrt.h>
6
7static errno_t __cdecl _int_wctime32_s (wchar_t *, size_t, const __time32_t *);
8static errno_t __cdecl _stub (wchar_t *, size_t, const __time32_t *);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_wctime32_s))(wchar_t *, size_t, const __time32_t *) =
11 _stub;
12
13static errno_t __cdecl
14_stub (wchar_t *d, size_t dn, const __time32_t *pt)
15{
16 errno_t __cdecl (*f)(wchar_t*,size_t, const __time32_t *) = __MINGW_IMP_SYMBOL(_wctime32_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(wchar_t *, size_t, const __time32_t *))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_wctime32_s");
22 if (!f)
23 f = _int_wctime32_s;
24 __MINGW_IMP_SYMBOL(_wctime32_s) = f;
25 }
26 return (*f)(d, dn, pt);
27}
28
29errno_t __cdecl
30_wctime32_s (wchar_t *d, size_t dn, const __time32_t *pt)
31{
32 return _stub (d, dn, pt);
33}
34
35static errno_t __cdecl
36_int_wctime32_s (wchar_t *d, size_t dn, const __time32_t *pt)
37{
38 struct tm ltm;
39 errno_t e;
40
41 if (!d || !dn)
42 {
43 errno = EINVAL;
44 return EINVAL;
45 }
46 d[0] = 0;
47 if (!pt)
48 {
49 errno = EINVAL;
50 return EINVAL;
51 }
52
53 if ((e = _localtime32_s (&ltm, pt)) != 0)
54 return e;
55 return _wasctime_s (d, dn, &ltm);
56}
lib/libc/mingw/secapi/_wctime64_s.c deleted-56
...@@ -1,56 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <time.h>
4#include <errno.h>
5#include <msvcrt.h>
6
7static errno_t __cdecl _int_wctime64_s (wchar_t *, size_t, const __time64_t *);
8static errno_t __cdecl _stub (wchar_t *, size_t, const __time64_t *);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_wctime64_s))(wchar_t *, size_t, const __time64_t *) =
11 _stub;
12
13static errno_t __cdecl
14_stub (wchar_t *d, size_t dn, const __time64_t *pt)
15{
16 errno_t __cdecl (*f)(wchar_t*,size_t, const __time64_t *) = __MINGW_IMP_SYMBOL(_wctime64_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(wchar_t *, size_t, const __time64_t *))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_wctime64_s");
22 if (!f)
23 f = _int_wctime64_s;
24 __MINGW_IMP_SYMBOL(_wctime64_s) = f;
25 }
26 return (*f)(d, dn, pt);
27}
28
29errno_t __cdecl
30_wctime64_s (wchar_t *d, size_t dn, const __time64_t *pt)
31{
32 return _stub (d, dn, pt);
33}
34
35static errno_t __cdecl
36_int_wctime64_s (wchar_t *d, size_t dn, const __time64_t *pt)
37{
38 struct tm ltm;
39 errno_t e;
40
41 if (!d || !dn)
42 {
43 errno = EINVAL;
44 return EINVAL;
45 }
46 d[0] = 0;
47 if (!pt)
48 {
49 errno = EINVAL;
50 return EINVAL;
51 }
52
53 if ((e = _localtime64_s (&ltm, pt)) != 0)
54 return e;
55 return _wasctime_s (d, dn, &ltm);
56}
lib/libc/mingw/secapi/_wmktemp_s.c deleted-54
...@@ -1,54 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <sec_api/wchar_s.h>
6
7static errno_t __cdecl _int_wmktemp_s (wchar_t *, size_t);
8static errno_t __cdecl _stub (wchar_t *, size_t);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_wmktemp_s))(wchar_t *, size_t) =
11 _stub;
12
13static errno_t __cdecl
14_stub (wchar_t *d, size_t dn)
15{
16 errno_t __cdecl (*f)(wchar_t *, size_t) = __MINGW_IMP_SYMBOL(_wmktemp_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(wchar_t *, size_t))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_wmktemp_s");
22 if (!f)
23 f = _int_wmktemp_s;
24 __MINGW_IMP_SYMBOL(_wmktemp_s) = f;
25 }
26 return (*f)(d, dn);
27}
28
29errno_t __cdecl
30_wmktemp_s (wchar_t *d, size_t dn)
31{
32 return _stub (d, dn);
33}
34
35static errno_t __cdecl
36_int_wmktemp_s (wchar_t *d, size_t dn)
37{
38 size_t sz;
39 if (!d || !dn)
40 {
41 _wmktemp (NULL);
42 return EINVAL;
43 }
44 sz = wcsnlen (d, dn);
45 if (sz >= dn || sz < 6)
46 {
47 d[0] = 0;
48 _wmktemp (NULL);
49 return EINVAL;
50 }
51 if (_wmktemp (d) != NULL)
52 return 0;
53 return errno;
54}
lib/libc/mingw/secapi/_wstrdate_s.c deleted-68
...@@ -1,68 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <time.h>
4#include <errno.h>
5#include <msvcrt.h>
6
7static errno_t __cdecl _int_wstrdate_s (wchar_t *, size_t);
8static errno_t __cdecl _stub (wchar_t *, size_t);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_wstrdate_s))(wchar_t *, size_t) =
11 _stub;
12
13static errno_t __cdecl
14_stub (wchar_t *d, size_t dn)
15{
16 errno_t __cdecl (*f)(wchar_t *, size_t) = __MINGW_IMP_SYMBOL(_wstrdate_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(wchar_t *, size_t))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_wstrdate_s");
22 if (!f)
23 f = _int_wstrdate_s;
24 __MINGW_IMP_SYMBOL(_wstrdate_s) = f;
25 }
26 return (*f)(d, dn);
27}
28
29errno_t __cdecl
30_wstrdate_s (wchar_t *d, size_t dn)
31{
32 return _stub (d, dn);
33}
34
35static errno_t __cdecl
36_int_wstrdate_s (wchar_t *d, size_t dn)
37{
38 SYSTEMTIME dt;
39
40 if (!d || !dn)
41 {
42 errno = EINVAL;
43 return EINVAL;
44 }
45
46 d[0] = 0;
47
48 if (dn < 9)
49 {
50 errno = ERANGE;
51 return ERANGE;
52 }
53
54 GetLocalTime (&dt);
55 dt.wYear %= 100;
56
57 d[0] = (wchar_t) (dt.wMonth / 10 + '0');
58 d[1] = (wchar_t) (dt.wMonth % 10 + '0');
59 d[2] = '/';
60 d[3] = (wchar_t) (dt.wDay / 10 + '0');
61 d[4] = (wchar_t) (dt.wDay % 10 + '0');
62 d[5] = '/';
63 d[6] = (wchar_t) (dt.wYear / 10 + '0');
64 d[7] = (wchar_t) (dt.wYear % 10 + '0');
65 d[8] = 0;
66
67 return 0;
68}
lib/libc/mingw/secapi/_wstrtime_s.c deleted-71
...@@ -1,71 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <time.h>
4#include <errno.h>
5#include <msvcrt.h>
6
7static errno_t __cdecl _int_wstrtime_s (wchar_t *, size_t);
8static errno_t __cdecl _stub (wchar_t *, size_t);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(_wstrtime_s))(wchar_t *, size_t) =
11 _stub;
12
13static errno_t __cdecl
14_stub (wchar_t *d, size_t dn)
15{
16 errno_t __cdecl (*f)(wchar_t *, size_t) = __MINGW_IMP_SYMBOL(_wstrtime_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(wchar_t *, size_t))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "_wstrtime_s");
22 if (!f)
23 f = _int_wstrtime_s;
24 __MINGW_IMP_SYMBOL(_wstrtime_s) = f;
25 }
26 return (*f)(d, dn);
27}
28
29errno_t __cdecl
30_wstrtime_s (wchar_t *d, size_t dn)
31{
32 return _stub (d, dn);
33}
34
35static errno_t __cdecl
36_int_wstrtime_s (wchar_t *d, size_t dn)
37{
38 SYSTEMTIME dt;
39 int hours, minutes, seconds;
40
41 if (!d || !dn)
42 {
43 errno = EINVAL;
44 return EINVAL;
45 }
46
47 d[0] = 0;
48
49 if (dn < 9)
50 {
51 errno = ERANGE;
52 return ERANGE;
53 }
54
55 GetLocalTime (&dt);
56
57 hours = dt.wHour;
58 minutes = dt.wMinute;
59 seconds = dt.wSecond;
60
61 d[2] = d[5] = ':';
62 d[0] = (wchar_t) (hours / 10 + '0');
63 d[1] = (wchar_t) (hours % 10 + '0');
64 d[3] = (wchar_t) (minutes / 10 + '0');
65 d[4] = (wchar_t) (minutes % 10 + '0');
66 d[6] = (wchar_t) (seconds / 10 + '0');
67 d[7] = (wchar_t) (seconds % 10 + '0');
68 d[8] = 0;
69
70 return 0;
71}
lib/libc/mingw/secapi/asctime_s.c deleted-52
...@@ -1,52 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <time.h>
4#include <errno.h>
5#include <msvcrt.h>
6
7static errno_t __cdecl _int_asctime_s (char *, size_t, const struct tm *);
8static errno_t __cdecl _stub (char *, size_t, const struct tm *);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(asctime_s))(char *, size_t, const struct tm *) =
11 _stub;
12
13static errno_t __cdecl
14_stub (char *d, size_t dn, const struct tm *pt)
15{
16 errno_t __cdecl (*f)(char *, size_t, const struct tm *) = __MINGW_IMP_SYMBOL(asctime_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(char *, size_t, const struct tm *))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "asctime_s");
22 if (!f)
23 f = _int_asctime_s;
24 __MINGW_IMP_SYMBOL(asctime_s) = f;
25 }
26 return (*f)(d, dn, pt);
27}
28
29errno_t __cdecl
30asctime_s (char *d, size_t dn, const struct tm *pt)
31{
32 return _stub (d, dn, pt);
33}
34
35static errno_t __cdecl
36_int_asctime_s (char *d, size_t dn, const struct tm *pt)
37{
38 char *tmp;
39 size_t i;
40
41 if (d && dn)
42 d[0] = 0;
43 if (!d || dn < 26 || !pt || (tmp = asctime (pt)) == NULL)
44 {
45 errno = EINVAL;
46 return EINVAL;
47 }
48 for (i = 0; tmp[i] != 0; i++)
49 d[i] = tmp[i];
50 d[i] = 0;
51 return 0;
52}
lib/libc/mingw/secapi/memcpy_s.c deleted-59
...@@ -1,59 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5
6static errno_t __cdecl _int_memcpy_s (void *, size_t, const void *, size_t);
7static errno_t __cdecl _stub (void *, size_t, const void *, size_t);
8
9errno_t __cdecl (*__MINGW_IMP_SYMBOL(memcpy_s))(void *, size_t, const void *, size_t) =
10 _stub;
11
12static errno_t __cdecl
13_stub (void *d, size_t dn, const void *s, size_t n)
14{
15 errno_t __cdecl (*f)(void *, size_t, const void *, size_t) = __MINGW_IMP_SYMBOL(memcpy_s);
16
17 if (f == _stub)
18 {
19 f = (errno_t __cdecl (*)(void *, size_t, const void *, size_t))
20 GetProcAddress (__mingw_get_msvcrt_handle (), "memcpy_s");
21 if (!f)
22 f = _int_memcpy_s;
23 __MINGW_IMP_SYMBOL(memcpy_s) = f;
24 }
25 return (*f)(d, dn, s, n);
26}
27
28errno_t __cdecl
29memcpy_s (void *d, size_t dn, const void *s, size_t n)
30{
31 return _stub (d, dn, s, n);
32}
33
34static errno_t __cdecl
35_int_memcpy_s (void *d, size_t dn, const void *s, size_t n)
36{
37 if (!n)
38 return 0;
39
40 if (!d || !s)
41 {
42 if (d)
43 memset (d, 0, dn);
44 errno = EINVAL;
45 return EINVAL;
46 }
47
48 if (dn < n)
49 {
50 memset (d, 0, dn);
51
52 errno = ERANGE;
53 return ERANGE;
54 }
55
56 memcpy (d, s, n);
57
58 return 0;
59}
lib/libc/mingw/secapi/memmove_s.c deleted-59
...@@ -1,59 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5
6static errno_t __cdecl _int_memmove_s (void *, size_t, const void *, size_t);
7static errno_t __cdecl _stub (void *, size_t, const void *, size_t);
8
9errno_t __cdecl (*__MINGW_IMP_SYMBOL(memmove_s))(void *, size_t, const void *, size_t) =
10 _stub;
11
12static errno_t __cdecl
13_stub (void *d, size_t dn, const void *s, size_t n)
14{
15 errno_t __cdecl (*f)(void *, size_t, const void *, size_t) = __MINGW_IMP_SYMBOL(memmove_s);
16
17 if (f == _stub)
18 {
19 f = (errno_t __cdecl (*)(void *, size_t, const void *, size_t))
20 GetProcAddress (__mingw_get_msvcrt_handle (), "memmove_s");
21 if (!f)
22 f = _int_memmove_s;
23 __MINGW_IMP_SYMBOL(memmove_s) = f;
24 }
25 return (*f)(d, dn, s, n);
26}
27
28errno_t __cdecl
29memmove_s (void *d, size_t dn, const void *s, size_t n)
30{
31 return _stub (d, dn, s, n);
32}
33
34static errno_t __cdecl
35_int_memmove_s (void *d, size_t dn, const void *s, size_t n)
36{
37 if (!n)
38 return 0;
39
40 if (!d || !s)
41 {
42 if (d)
43 memset (d, 0, dn);
44 errno = EINVAL;
45 return EINVAL;
46 }
47
48 if (dn < n)
49 {
50 memset (d, 0, dn);
51
52 errno = ERANGE;
53 return ERANGE;
54 }
55
56 memmove (d, s, n);
57
58 return 0;
59}
lib/libc/mingw/secapi/rand_s.c deleted-36
...@@ -1,36 +0,0 @@
1#define _CRT_RAND_S
2#include <stdlib.h>
3#include <windows.h>
4#include <ntsecapi.h>
5#include <errno.h>
6#include <msvcrt.h>
7
8static BOOLEAN (WINAPI *pRtlGenRandom)(void*,ULONG);
9
10static errno_t mingw_rand_s(unsigned int *pval)
11{
12 return !pval || !pRtlGenRandom || !pRtlGenRandom(pval, sizeof(*pval)) ? EINVAL : 0;
13}
14
15static errno_t __cdecl init_rand_s(unsigned int*);
16
17errno_t (__cdecl *__MINGW_IMP_SYMBOL(rand_s))(unsigned int*) = init_rand_s;
18
19errno_t __cdecl
20rand_s(unsigned int *val)
21{
22 return __MINGW_IMP_SYMBOL(rand_s)(val);
23}
24
25static errno_t __cdecl init_rand_s(unsigned int *val)
26{
27 int (__cdecl *func)(unsigned int*);
28
29 func = (void*)GetProcAddress(__mingw_get_msvcrt_handle(), "rand_s");
30 if(!func) {
31 func = mingw_rand_s;
32 pRtlGenRandom = (void*)GetProcAddress(LoadLibraryW(L"advapi32.dll"), "SystemFunction036");
33 }
34
35 return (__MINGW_IMP_SYMBOL(rand_s) = func)(val);
36}
lib/libc/mingw/secapi/sprintf_s.c deleted-19
...@@ -1,19 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <sec_api/stdio_s.h>
6
7int __cdecl (*__MINGW_IMP_SYMBOL(sprintf_s))(char *, size_t, const char *,...) = sprintf_s;
8
9int __cdecl
10sprintf_s (char *_DstBuf, size_t _Size, const char *_Format, ...)
11{
12 va_list argp;
13 int r;
14
15 va_start (argp, _Format);
16 r = vsprintf_s (_DstBuf, _Size, _Format, argp);
17 va_end (argp);
18 return r;
19}
lib/libc/mingw/secapi/strerror_s.c deleted-54
...@@ -1,54 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <sec_api/stdio_s.h>
6
7static errno_t __cdecl _int_strerror_s (char *, size_t, int);
8static errno_t __cdecl _stub (char *, size_t, int);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(strerror_s))(char *, size_t, int) = _stub;
11
12static errno_t __cdecl
13_stub (char *buffer, size_t numberOfElements, int errnum)
14{
15 errno_t __cdecl (*f)(char *, size_t, int) = __MINGW_IMP_SYMBOL(strerror_s);
16
17 if (f == _stub)
18 {
19 f = (errno_t __cdecl (*)(char *, size_t, int))
20 GetProcAddress (__mingw_get_msvcrt_handle (), "strerror_s");
21 if (!f)
22 {
23 f = _int_strerror_s;
24 }
25 __MINGW_IMP_SYMBOL(strerror_s) = f;
26 }
27 return (*f)(buffer, numberOfElements, errnum);
28}
29
30errno_t __cdecl
31strerror_s (char *buffer, size_t numberOfElements, int errnum)
32{
33 return _stub (buffer, numberOfElements, errnum);
34}
35
36static errno_t __cdecl
37_int_strerror_s (char *buffer, size_t numberOfElements, int errnum)
38{
39 char *errmsg = strerror(errnum);
40
41 if (!errmsg || !buffer || numberOfElements == 0)
42 {
43 errno = EINVAL;
44 return EINVAL;
45 }
46
47 if (sprintf_s(buffer, numberOfElements, "%s", errmsg) == -1)
48 {
49 errno = EINVAL;
50 return EINVAL;
51 }
52
53 return 0;
54}
lib/libc/mingw/secapi/vsprintf_s.c deleted-40
...@@ -1,40 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <stdio.h>
6#include <sec_api/stdio_s.h>
7
8static int __cdecl _int_vsprintf_s (char *, size_t, const char *, va_list);
9static int __cdecl _stub (char *, size_t, const char *, va_list);
10
11int __cdecl (*__MINGW_IMP_SYMBOL(vsprintf_s))(char *, size_t, const char *, va_list) =
12 _stub;
13
14static int __cdecl
15_stub (char *_DstBuf, size_t _Size, const char *_Format, va_list _ArgList)
16{
17 int __cdecl (*f)(char *, size_t, const char *, va_list) = __MINGW_IMP_SYMBOL(vsprintf_s);
18
19 if (f == _stub)
20 {
21 f = (int __cdecl (*)(char *, size_t, const char *, va_list))
22 GetProcAddress (__mingw_get_msvcrt_handle (), "vsprintf_s");
23 if (!f)
24 f = _int_vsprintf_s;
25 __MINGW_IMP_SYMBOL(vsprintf_s) = f;
26 }
27 return (*f)(_DstBuf, _Size, _Format, _ArgList);
28}
29
30int __cdecl
31vsprintf_s (char *_DstBuf, size_t _Size, const char *_Format, va_list _ArgList)
32{
33 return _stub (_DstBuf, _Size, _Format, _ArgList);
34}
35
36static int __cdecl
37_int_vsprintf_s (char *_DstBuf, size_t _Size, const char *_Format, va_list _ArgList)
38{
39 return __ms_vsnprintf (_DstBuf, _Size, _Format, _ArgList);
40}
lib/libc/mingw/secapi/wmemcpy_s.c deleted-60
...@@ -1,60 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <sec_api/wchar_s.h>
6
7static errno_t __cdecl _int_wmemcpy_s (wchar_t *, size_t, const wchar_t *, size_t);
8static errno_t __cdecl _stub (wchar_t *, size_t, const wchar_t *, size_t);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(wmemcpy_s))(wchar_t *, size_t, const wchar_t *, size_t) =
11 _stub;
12
13static errno_t __cdecl
14_stub (wchar_t *d, size_t dn, const wchar_t *s, size_t n)
15{
16 errno_t __cdecl (*f)(wchar_t *, size_t, const wchar_t *, size_t) = __MINGW_IMP_SYMBOL(wmemcpy_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(wchar_t *, size_t, const wchar_t *, size_t))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "wmemcpy_s");
22 if (!f)
23 f = _int_wmemcpy_s;
24 __MINGW_IMP_SYMBOL(wmemcpy_s) = f;
25 }
26 return (*f)(d, dn, s, n);
27}
28
29errno_t __cdecl
30wmemcpy_s (wchar_t *d, size_t dn, const wchar_t *s, size_t n)
31{
32 return _stub (d, dn, s, n);
33}
34
35static errno_t __cdecl
36_int_wmemcpy_s (wchar_t *d, size_t dn, const wchar_t *s, size_t n)
37{
38 if (!n)
39 return 0;
40
41 if (!d || !s)
42 {
43 if (d)
44 memset (d, 0, dn * sizeof (wchar_t));
45 errno = EINVAL;
46 return EINVAL;
47 }
48
49 if (dn < n)
50 {
51 memset (d, 0, dn * sizeof (wchar_t));
52
53 errno = ERANGE;
54 return ERANGE;
55 }
56
57 memcpy (d, s, n * sizeof (wchar_t));
58
59 return 0;
60}
lib/libc/mingw/secapi/wmemmove_s.c deleted-60
...@@ -1,60 +0,0 @@
1#include <windows.h>
2#include <malloc.h>
3#include <errno.h>
4#include <msvcrt.h>
5#include <sec_api/wchar_s.h>
6
7static errno_t __cdecl _int_wmemmove_s (wchar_t *, size_t, const wchar_t*, size_t);
8static errno_t __cdecl _stub (wchar_t *, size_t, const wchar_t *, size_t);
9
10errno_t __cdecl (*__MINGW_IMP_SYMBOL(wmemmove_s))(wchar_t *, size_t, const wchar_t *, size_t) =
11 _stub;
12
13static errno_t __cdecl
14_stub (wchar_t *d, size_t dn, const wchar_t *s, size_t n)
15{
16 errno_t __cdecl (*f)(wchar_t *, size_t, const wchar_t *, size_t) = __MINGW_IMP_SYMBOL(wmemmove_s);
17
18 if (f == _stub)
19 {
20 f = (errno_t __cdecl (*)(wchar_t *, size_t, const wchar_t *, size_t))
21 GetProcAddress (__mingw_get_msvcrt_handle (), "wmemmove_s");
22 if (!f)
23 f = _int_wmemmove_s;
24 __MINGW_IMP_SYMBOL(wmemmove_s) = f;
25 }
26 return (*f)(d, dn, s, n);
27}
28
29errno_t __cdecl
30wmemmove_s (wchar_t *d, size_t dn, const wchar_t *s, size_t n)
31{
32 return _stub (d, dn, s, n);
33}
34
35static errno_t __cdecl
36_int_wmemmove_s (wchar_t *d, size_t dn, const wchar_t *s, size_t n)
37{
38 if (!n)
39 return 0;
40
41 if (!d || !s)
42 {
43 if (d)
44 memset (d, 0, dn * sizeof (wchar_t));
45 errno = EINVAL;
46 return EINVAL;
47 }
48
49 if (dn < n)
50 {
51 memset (d, 0, dn * sizeof (wchar_t));
52
53 errno = ERANGE;
54 return ERANGE;
55 }
56
57 memmove (d, s, n * sizeof (wchar_t));
58
59 return 0;
60}
lib/libc/mingw/stdio/_getc_nolock.c deleted-8
...@@ -1,8 +0,0 @@
1#include <stdio.h>
2
3#undef _getc_nolock
4int __cdecl _getc_nolock(FILE *stream);
5int __cdecl _getc_nolock(FILE *stream)
6{
7 return _fgetc_nolock(stream);
8}
lib/libc/mingw/stdio/_getwc_nolock.c deleted-10
...@@ -1,10 +0,0 @@
1#undef __MSVCRT_VERSION__
2#define __MSVCRT_VERSION__ 0x800
3#include <stdio.h>
4
5#undef _getwc_nolock
6wint_t __cdecl _getwc_nolock(FILE *stream);
7wint_t __cdecl _getwc_nolock(FILE *stream)
8{
9 return _fgetwc_nolock(stream);
10}
lib/libc/mingw/stdio/_putc_nolock.c deleted-8
...@@ -1,8 +0,0 @@
1#include <stdio.h>
2
3#undef _putc_nolock
4int __cdecl _putc_nolock(int c, FILE *stream);
5int __cdecl _putc_nolock(int c, FILE *stream)
6{
7 return _fputc_nolock(c, stream);
8}
lib/libc/mingw/stdio/_putwc_nolock.c deleted-10
...@@ -1,10 +0,0 @@
1#undef __MSVCRT_VERSION__
2#define __MSVCRT_VERSION__ 0x800
3#include <stdio.h>
4
5#undef _putwc_nolock
6wint_t __cdecl _putwc_nolock(wchar_t c, FILE *stream);
7wint_t __cdecl _putwc_nolock(wchar_t c, FILE *stream)
8{
9 return _fputwc_nolock(c, stream);
10}
lib/libc/mingw/stdio/_vscprintf.c deleted-86
...@@ -1,86 +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#include <windows.h>
7#include <stdarg.h>
8#include <stdio.h>
9#include <stdlib.h>
10#include <string.h>
11#include <errno.h>
12
13/* emulation of _vscprintf() via _vsnprintf() */
14static int __cdecl emu_vscprintf(const char * __restrict__ format, va_list arglist)
15{
16 char *buffer, *new_buffer;
17 size_t size;
18 int ret = -1;
19
20 /* if format is a null pointer, _vscprintf() returns -1 and sets errno to EINVAL */
21 if (!format) {
22 _set_errno(EINVAL);
23 return -1;
24 }
25
26 /* size for _vsnprintf() must be non-zero and buffer must have place for terminating null character */
27 size = strlen(format) * 2 + 1;
28 buffer = malloc(size);
29
30 if (!buffer) {
31 _set_errno(ENOMEM);
32 return -1;
33 }
34
35 /* if the number of characters to write is greater than size, _vsnprintf() returns -1 */
36 while (size < SIZE_MAX/2 && (ret = _vsnprintf(buffer, size, format, arglist)) < 0) {
37 /* in this case try with larger buffer */
38 size *= 2;
39 new_buffer = realloc(buffer, size);
40 if (!new_buffer)
41 break;
42 buffer = new_buffer;
43 }
44
45 free(buffer);
46
47 if (ret < 0) {
48 _set_errno(ENOMEM);
49 return -1;
50 }
51
52 return ret;
53}
54
55#ifndef __LIBMSVCRT_OS__
56
57int (__cdecl *__MINGW_IMP_SYMBOL(_vscprintf))(const char * __restrict__, va_list) = emu_vscprintf;
58
59#else
60
61#include <msvcrt.h>
62
63static int __cdecl init_vscprintf(const char * __restrict__ format, va_list arglist);
64
65int (__cdecl *__MINGW_IMP_SYMBOL(_vscprintf))(const char * __restrict__, va_list) = init_vscprintf;
66
67static int __cdecl init_vscprintf(const char * __restrict__ format, va_list arglist)
68{
69 HMODULE msvcrt = __mingw_get_msvcrt_handle();
70 int (__cdecl *func)(const char * __restrict__, va_list) = NULL;
71
72 if (msvcrt)
73 func = (int (__cdecl *)(const char * __restrict__, va_list))GetProcAddress(msvcrt, "_vscprintf");
74
75 if (!func)
76 func = emu_vscprintf;
77
78 return (__MINGW_IMP_SYMBOL(_vscprintf) = func)(format, arglist);
79}
80
81#endif
82
83int __cdecl _vscprintf(const char * __restrict__ format, va_list arglist)
84{
85 return __MINGW_IMP_SYMBOL(_vscprintf)(format, arglist);
86}
lib/libc/mingw/stdio/acrt_iob_func.c deleted-15
...@@ -1,15 +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 <stdio.h>
8
9FILE *__cdecl __acrt_iob_func(unsigned index)
10{
11 return &(__iob_func()[index]);
12}
13
14typedef FILE *__cdecl (*_f__acrt_iob_func)(unsigned index);
15_f__acrt_iob_func __MINGW_IMP_SYMBOL(__acrt_iob_func) = __acrt_iob_func;
lib/libc/mingw/stdio/atoll.c deleted-13
...@@ -1,13 +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#define __CRT__NO_INLINE
7#include <stdlib.h>
8
9long long __cdecl atoll(const char * nptr) { return strtoll(nptr, NULL, 10); }
10long long (__cdecl *__MINGW_IMP_SYMBOL(atoll))(const char *) = atoll;
11
12__int64 __attribute__((alias("atoll"))) __cdecl _atoi64(const char * nptr);
13__int64 (__cdecl *__MINGW_IMP_SYMBOL(_atoi64))(const char *) = _atoi64;
lib/libc/mingw/stdio/fseeki64.c deleted-50
...@@ -1,50 +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#include <stdio.h>
7#include <io.h>
8#include <errno.h>
9
10#if !defined(__arm__) && !defined(__aarch64__) /* we have F_ARM_ANY(_fseeki64) in msvcrt.def.in */
11int __cdecl _fseeki64(FILE* stream, __int64 offset, int whence)
12{
13 fpos_t pos;
14 if (whence == SEEK_CUR)
15 {
16 /* If stream is invalid, fgetpos sets errno. */
17 if (fgetpos (stream, &pos))
18 return (-1);
19 pos += (fpos_t) offset;
20 }
21 else if (whence == SEEK_END)
22 {
23 /* If writing, we need to flush before getting file length. */
24 fflush (stream);
25 pos = (fpos_t) (_filelengthi64 (_fileno (stream)) + offset);
26 }
27 else if (whence == SEEK_SET)
28 pos = (fpos_t) offset;
29 else
30 {
31 errno = EINVAL;
32 return (-1);
33 }
34 return fsetpos (stream, &pos);
35}
36
37int __cdecl (*__MINGW_IMP_SYMBOL(_fseeki64))(FILE*, __int64, int) = _fseeki64;
38#endif /* !defined(__arm__) && !defined(__aarch64__) */
39
40__int64 __cdecl _ftelli64(FILE* stream)
41{
42 fpos_t pos;
43 if (fgetpos (stream, &pos))
44 return -1LL;
45 else
46 return (__int64) pos;
47}
48
49__int64 __cdecl (*__MINGW_IMP_SYMBOL(_ftelli64))(FILE*) = _ftelli64;
50
lib/libc/mingw/stdio/mingw_dummy__lock.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 <internal.h>
8
9void __cdecl _lock(int locknum);
10void __cdecl _unlock(int locknum);
11void __cdecl _lock(__UNUSED_PARAM(int locknum)) { }
12void __cdecl _unlock(__UNUSED_PARAM(int locknum)) { }
lib/libc/mingw/stdio/mingw_lock.c deleted-102
...@@ -1,102 +0,0 @@
1#define _CRTIMP
2#include <stdio.h>
3#include <synchapi.h>
4#include "internal.h"
5
6/***
7 * Copy of MS functions _lock_file, _unlock_file which are missing from
8 * msvcrt.dll and msvcr80.dll. They are needed to atomic/lock stdio
9 * functions (printf, fprintf, vprintf, vfprintf). We need exactly the same
10 * lock that MS uses in msvcrt.dll because we can mix mingw-w64 code with
11 * original MS functions (puts, fputs for example).
12***/
13
14
15_CRTIMP void __cdecl _lock(int locknum);
16_CRTIMP void __cdecl _unlock(int locknum);
17#define _STREAM_LOCKS 16
18#define _IOLOCKED 0x8000
19
20
21/***
22* _lock_file - Lock a FILE
23*
24*Purpose:
25* Assert the lock for a stdio-level file
26*
27*Entry:
28* pf = __piob[] entry (pointer to a FILE or _FILEX)
29*
30*Exit:
31*
32*Exceptions:
33*
34*******************************************************************************/
35
36void __cdecl _lock_file( FILE *pf )
37{
38 /*
39 * The way the FILE (pointed to by pf) is locked depends on whether
40 * it is part of _iob[] or not
41 */
42 if ( (pf >= __acrt_iob_func(0)) && (pf <= __acrt_iob_func(_IOB_ENTRIES-1)) )
43 {
44 /*
45 * FILE lies in _iob[] so the lock lies in _locktable[].
46 */
47 _lock( _STREAM_LOCKS + (int)(pf - __acrt_iob_func(0)) );
48 /* We set _IOLOCKED to indicate we locked the stream */
49 pf->_flag |= _IOLOCKED;
50 }
51 else
52 /*
53 * Not part of _iob[]. Therefore, *pf is a _FILEX and the
54 * lock field of the struct is an initialized critical
55 * section.
56 */
57 EnterCriticalSection( &(((_FILEX *)pf)->lock) );
58}
59
60void *__MINGW_IMP_SYMBOL(_lock_file) = _lock_file;
61
62
63/***
64* _unlock_file - Unlock a FILE
65*
66*Purpose:
67* Release the lock for a stdio-level file
68*
69*Entry:
70* pf = __piob[] entry (pointer to a FILE or _FILEX)
71*
72*Exit:
73*
74*Exceptions:
75*
76*******************************************************************************/
77
78void __cdecl _unlock_file( FILE *pf )
79{
80 /*
81 * The way the FILE (pointed to by pf) is unlocked depends on whether
82 * it is part of _iob[] or not
83 */
84 if ( (pf >= __acrt_iob_func(0)) && (pf <= __acrt_iob_func(_IOB_ENTRIES-1)) )
85 {
86 /*
87 * FILE lies in _iob[] so the lock lies in _locktable[].
88 * We reset _IOLOCKED to indicate we unlock the stream.
89 */
90 pf->_flag &= ~_IOLOCKED;
91 _unlock( _STREAM_LOCKS + (int)(pf - __acrt_iob_func(0)) );
92 }
93 else
94 /*
95 * Not part of _iob[]. Therefore, *pf is a _FILEX and the
96 * lock field of the struct is an initialized critical
97 * section.
98 */
99 LeaveCriticalSection( &(((_FILEX *)pf)->lock) );
100}
101
102void *__MINGW_IMP_SYMBOL(_unlock_file) = _unlock_file;
lib/libc/mingw/stdio/snprintf_alias.c deleted-26
...@@ -1,26 +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 <stdarg.h>
8#include <stddef.h>
9
10/* Intentionally not including stdio.h, as it unconditionally defines the
11 * snprintf inline, and it can't be renamed with "#define snprintf othername"
12 * either, as stdio.h contains "#undef snprintf". */
13
14int __cdecl __ms_vsnprintf(char *buffer, size_t n, const char *format, va_list arg);
15
16int __cdecl snprintf(char *buffer, size_t n, const char *format, ...);
17int __cdecl snprintf(char *buffer, size_t n, const char *format, ...)
18{
19 int retval;
20 va_list argptr;
21
22 va_start(argptr, format);
23 retval = __ms_vsnprintf(buffer, n, format, argptr);
24 va_end(argptr);
25 return retval;
26}
lib/libc/mingw/stdio/strtof.c deleted-27
...@@ -1,27 +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#include <stdlib.h>
7#include <float.h>
8#include <errno.h>
9#include <math.h>
10
11float strtof( const char *nptr, char **endptr)
12{
13 double ret = strtod(nptr, endptr);
14 if (isfinite(ret)) {
15 /* Check for cases that aren't out of range for doubles, but that are
16 * for floats. */
17 if (ret > FLT_MAX)
18 errno = ERANGE;
19 else if (ret < -FLT_MAX)
20 errno = ERANGE;
21 else if (ret > 0 && ret < FLT_MIN)
22 errno = ERANGE;
23 else if (ret < 0 && ret > -FLT_MIN)
24 errno = ERANGE;
25 }
26 return ret;
27}
lib/libc/mingw/stdio/vsnprintf_alias.c deleted-20
...@@ -1,20 +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 <stdarg.h>
8#include <stddef.h>
9
10/* Intentionally not including stdio.h, as it unconditionally defines the
11 * vsnprintf inline, and it can't be renamed with "#define vsnprintf othername"
12 * either, as stdio.h contains "#undef vsnprintf". */
13
14int __cdecl __ms_vsnprintf(char *buffer, size_t n, const char *format, va_list arg);
15
16int __cdecl vsnprintf(char *buffer, size_t n, const char *format, va_list arg);
17int __cdecl vsnprintf(char *buffer, size_t n, const char *format, va_list arg)
18{
19 return __ms_vsnprintf(buffer, n, format, arg);
20}
tools/update_mingw.zig+3
...@@ -148,7 +148,10 @@ const blacklist = [_][]const u8{...@@ -148,7 +148,10 @@ const blacklist = [_][]const u8{
148 "msvcr80.def.in",148 "msvcr80.def.in",
149 "msvcr90.def.in",149 "msvcr90.def.in",
150 "msvcr90d.def.in",150 "msvcr90d.def.in",
151 "msvcrt.def.in",
151 "msvcrt10.def.in",152 "msvcrt10.def.in",
152 "msvcrt20.def.in",153 "msvcrt20.def.in",
153 "msvcrt40.def.in",154 "msvcrt40.def.in",
155
156 "crtdll.def.in",
154};157};