History

Finalizing math.h fixes: - Updated msvcrt.def with symbols from 64bit version of dll - it contains the float math functions missing in the 32bit dll. - Made sure this patch only apply to to WIN32 and WIN64. For WIN32 float functions calls the double variants, on 64bit they are called natively.

Tyge committed 6 years ago

Commit 024214a1 parent df67d862 files · +131 −171Browse files

Unified · Split

2 files
  1. win32/include/math.h +41 −2
  2. win32/lib/msvcrt.def +90 −169
win32/include/math.h+41−2
@@ -205,8 +205,21 @@ extern "C" { · 204 unmodified lines
205 __CRT_INLINE float frexpf(float _X,int *_Y) { return ((float)frexp((double)_X,_Y)); }205 __CRT_INLINE float frexpf(float _X,int *_Y) { return ((float)frexp((double)_X,_Y)); }
206 206
207#if !defined (__ia64__)207#if !defined (__ia64__)
208 __CRT_INLINE float fabsf(float x) { return (float) fabs(x); }208 __CRT_INLINE float __cdecl fabsf (float x)
209 __CRT_INLINE float ldexpf(float x, int expn) { return (float) ldexp(x, expn); }209 {
210#ifdef _WIN64
211 *((int *) &x) &= 0x7fffffff;
212 return x;
213#else
214 float res;
215 __asm__ ("fabs;" : "=t" (res) : "0" (x));
216 return res;
217#endif
218 }
219
220 __CRT_INLINE float __cdecl ldexpf (float x, int expn) { return (float) ldexp (x, expn); }
221#endif
222#if defined (_WIN32) && !defined(_WIN64)
210 __CRT_INLINE float acosf(float x) { return (float) acos(x); }223 __CRT_INLINE float acosf(float x) { return (float) acos(x); }
211 __CRT_INLINE float asinf(float x) { return (float) asin(x); }224 __CRT_INLINE float asinf(float x) { return (float) asin(x); }
212 __CRT_INLINE float atanf(float x) { return (float) atan(x); }225 __CRT_INLINE float atanf(float x) { return (float) atan(x); }
@@ -377,6 +390,32 @@ extern "C" { · 164 unmodified lines
377 extern double __cdecl logb (double);390 extern double __cdecl logb (double);
378 extern float __cdecl logbf (float);391 extern float __cdecl logbf (float);
379 extern long double __cdecl logbl (long double);392 extern long double __cdecl logbl (long double);
393#ifndef _WIN32
394 __CRT_INLINE double __cdecl logb (double x)
395 {
396 double res;
397 __asm__ ("fxtract\n\t"
398 "fstp %%st" : "=t" (res) : "0" (x));
399 return res;
400 }
401
402 __CRT_INLINE float __cdecl logbf (float x)
403 {
404 float res;
405 __asm__ ("fxtract\n\t"
406 "fstp %%st" : "=t" (res) : "0" (x));
407 return res;
408 }
409
410 __CRT_INLINE long double __cdecl logbl (long double x)
411 {
412 long double res;
413 __asm__ ("fxtract\n\t"
414 "fstp %%st" : "=t" (res) : "0" (x));
415 return res;
416 }
417#endif
418
380 extern long double __cdecl modfl (long double, long double*);419 extern long double __cdecl modfl (long double, long double*);
381 420
382 /* 7.12.6.13 */421 /* 7.12.6.13 */
win32/lib/msvcrt.def+90−169
@@ -1,80 +1,57 @@
1LIBRARY msvcrt.dll1LIBRARY msvcrt.dll
2 2
3EXPORTS3EXPORTS
4$I10_OUTPUT4??0__non_rtti_object@@QEAA@AEBV0@@Z
5??0__non_rtti_object@@QAE@ABV0@@Z5??0__non_rtti_object@@QEAA@PEBD@Z
6??0__non_rtti_object@@QAE@PBD@Z
7??0bad_cast@@AAE@PBQBD@Z6??0bad_cast@@AAE@PBQBD@Z
7??0bad_cast@@AEAA@PEBQEBD@Z
8??0bad_cast@@QAE@ABQBD@Z8??0bad_cast@@QAE@ABQBD@Z
9??0bad_cast@@QAE@ABV0@@Z9??0bad_cast@@QEAA@AEBQEBD@Z
10??0bad_cast@@QAE@PBD@Z10??0bad_cast@@QEAA@AEBV0@@Z
11??0bad_typeid@@QAE@ABV0@@Z11??0bad_cast@@QEAA@PEBD@Z
12??0bad_typeid@@QAE@PBD@Z12??0bad_typeid@@QEAA@AEBV0@@Z
13??0exception@@QAE@ABQBD@Z13??0bad_typeid@@QEAA@PEBD@Z
14??0exception@@QAE@ABQBDH@Z14??0exception@@QEAA@AEBQEBD@Z
15??0exception@@QAE@ABV0@@Z15??0exception@@QEAA@AEBQEBDH@Z
16??0exception@@QAE@XZ16??0exception@@QEAA@AEBV0@@Z
17??1__non_rtti_object@@UAE@XZ17??0exception@@QEAA@XZ
18??1bad_cast@@UAE@XZ18??1__non_rtti_object@@UEAA@XZ
19??1bad_typeid@@UAE@XZ19??1bad_cast@@UEAA@XZ
20??1exception@@UAE@XZ20??1bad_typeid@@UEAA@XZ
21??1type_info@@UAE@XZ21??1exception@@UEAA@XZ
22??2@YAPAXI@Z22??1type_info@@UEAA@XZ
23??2@YAPAXIHPBDH@Z23??2@YAPEAX_K@Z
24??3@YAXPAX@Z24??2@YAPEAX_KHPEBDH@Z
25??4__non_rtti_object@@QAEAAV0@ABV0@@Z25??3@YAXPEAX@Z
26??4bad_cast@@QAEAAV0@ABV0@@Z26??4__non_rtti_object@@QEAAAEAV0@AEBV0@@Z
27??4bad_typeid@@QAEAAV0@ABV0@@Z27??4bad_cast@@QEAAAEAV0@AEBV0@@Z
28??4exception@@QAEAAV0@ABV0@@Z28??4bad_typeid@@QEAAAEAV0@AEBV0@@Z
29??8type_info@@QBEHABV0@@Z29??4exception@@QEAAAEAV0@AEBV0@@Z
30??9type_info@@QBEHABV0@@Z30??8type_info@@QEBAHAEBV0@@Z
31??9type_info@@QEBAHAEBV0@@Z
31??_7__non_rtti_object@@6B@32??_7__non_rtti_object@@6B@
32??_7bad_cast@@6B@33??_7bad_cast@@6B@
33??_7bad_typeid@@6B@34??_7bad_typeid@@6B@
34??_7exception@@6B@35??_7exception@@6B@
35??_E__non_rtti_object@@UAEPAXI@Z36??_Fbad_cast@@QEAAXXZ
36??_Ebad_cast@@UAEPAXI@Z37??_Fbad_typeid@@QEAAXXZ
37??_Ebad_typeid@@UAEPAXI@Z38??_U@YAPEAX_K@Z
38??_Eexception@@UAEPAXI@Z39??_U@YAPEAX_KHPEBDH@Z
39??_Fbad_cast@@QAEXXZ40??_V@YAXPEAX@Z
40??_Fbad_typeid@@QAEXXZ41?_query_new_handler@@YAP6AH_K@ZXZ
41??_G__non_rtti_object@@UAEPAXI@Z
42??_Gbad_cast@@UAEPAXI@Z
43??_Gbad_typeid@@UAEPAXI@Z
44??_Gexception@@UAEPAXI@Z
45??_U@YAPAXI@Z
46??_U@YAPAXIHPBDH@Z
47??_V@YAXPAX@Z
48?_query_new_handler@@YAP6AHI@ZXZ
49?_query_new_mode@@YAHXZ42?_query_new_mode@@YAHXZ
50?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z43?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z
51?_set_new_mode@@YAHH@Z44?_set_new_mode@@YAHH@Z
52?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z45?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z
53?before@type_info@@QBEHABV1@@Z46?before@type_info@@QEBAHAEBV1@@Z
54?name@type_info@@QBEPBDXZ47?name@type_info@@QEBAPEBDXZ
55?raw_name@type_info@@QBEPBDXZ48?raw_name@type_info@@QEBAPEBDXZ
56?set_new_handler@@YAP6AXXZP6AXXZ@Z49?set_new_handler@@YAP6AXXZP6AXXZ@Z
57?set_terminate@@YAP6AXXZP6AXXZ@Z50?set_terminate@@YAP6AXXZP6AXXZ@Z
58?set_unexpected@@YAP6AXXZP6AXXZ@Z51?set_unexpected@@YAP6AXXZP6AXXZ@Z
59?terminate@@YAXXZ52?terminate@@YAXXZ
60?unexpected@@YAXXZ53?unexpected@@YAXXZ
61?what@exception@@UBEPBDXZ54?what@exception@@UEBAPEBDXZ
62_CIacos
63_CIasin
64_CIatan
65_CIatan2
66_CIcos
67_CIcosh
68_CIexp
69_CIfmod
70_CIlog
71_CIlog10
72_CIpow
73_CIsin
74_CIsinh
75_CIsqrt
76_CItan
77_CItanh
78_CrtCheckMemory55_CrtCheckMemory
79_CrtDbgBreak56_CrtDbgBreak
80_CrtDbgReport57_CrtDbgReport
@@ -101,27 +78,33 @@ _CrtSetReportHook · 20 unmodified lines
101_CrtSetReportHook278_CrtSetReportHook2
102_CrtSetReportMode79_CrtSetReportMode
103_CxxThrowException80_CxxThrowException
104_EH_prolog
105_Getdays81_Getdays
106_Getmonths82_Getmonths
107_Gettnames83_Gettnames
108_HUGE84_HUGE
109_Strftime85_Strftime
86_W_Getdays
87_W_Getmonths
88_W_Gettnames
89_Wcsftime
110_XcptFilter90_XcptFilter
91__AdjustPointer
92__C_specific_handler
111__CppXcptFilter93__CppXcptFilter
112__CxxCallUnwindDelDtor
113__CxxCallUnwindDtor
114__CxxCallUnwindVecDtor
115__CxxDetectRethrow
116__CxxExceptionFilter
117__CxxFrameHandler94__CxxFrameHandler
118__CxxFrameHandler295__CxxFrameHandler2
119__CxxFrameHandler396__CxxFrameHandler3
120__CxxLongjmpUnwind
121__CxxQueryExceptionSize
122__CxxRegisterExceptionObject
123__CxxUnregisterExceptionObject
124__DestructExceptionObject97__DestructExceptionObject
98__ExceptionPtrAssign
99__ExceptionPtrCompare
100__ExceptionPtrCopy
101__ExceptionPtrCopyException
102__ExceptionPtrCreate
103__ExceptionPtrCurrentException
104__ExceptionPtrDestroy
105__ExceptionPtrRethrow
106__ExceptionPtrSwap
107__ExceptionPtrToBool
125__RTCastToVoid108__RTCastToVoid
126__RTDynamicCast109__RTDynamicCast
127__RTtypeid110__RTtypeid
@@ -156,57 +139,7 @@ __lc_codepage · 28 unmodified lines
156__lc_collate_cp139__lc_collate_cp
157__lc_handle140__lc_handle
158__lconv_init141__lconv_init
159__libm_sse2_acos
160__libm_sse2_acosf
161__libm_sse2_asin
162__libm_sse2_asinf
163__libm_sse2_atan
164__libm_sse2_atan2
165__libm_sse2_atanf
166__libm_sse2_cos
167__libm_sse2_cosf
168__libm_sse2_exp
169__libm_sse2_expf
170__libm_sse2_log
171__libm_sse2_log10
172__libm_sse2_log10f
173__libm_sse2_logf
174__libm_sse2_pow
175__libm_sse2_powf
176__libm_sse2_sin
177__libm_sse2_sinf
178__libm_sse2_tan
179__libm_sse2_tanf
180__mb_cur_max142__mb_cur_max
181__p___argc
182__p___argv
183__p___initenv
184__p___mb_cur_max
185__p___wargv
186__p___winitenv
187__p__acmdln
188__p__amblksiz
189__p__commode
190__p__daylight
191__p__dstbias
192__p__environ
193__p__fileinfo
194__p__fmode
195__p__iob
196__p__mbcasemap
197__p__mbctype
198__p__osver
199__p__pctype
200__p__pgmptr
201__p__pwctype
202__p__timezone
203__p__tzname
204__p__wcmdln
205__p__wenviron
206__p__winmajor
207__p__winminor
208__p__winver
209__p__wpgmptr
210__pctype_func143__pctype_func
211__pioinfo144__pioinfo
212__pwctype_func145__pwctype_func
@@ -228,25 +161,10 @@ __wcserror_s · 15 unmodified lines
228__wcsncnt161__wcsncnt
229__wgetmainargs162__wgetmainargs
230__winitenv163__winitenv
231_abnormal_termination
232_abs64164_abs64
233_access165_access
234_access_s166_access_s
235_acmdln167_acmdln
236_adj_fdiv_m16i
237_adj_fdiv_m32
238_adj_fdiv_m32i
239_adj_fdiv_m64
240_adj_fdiv_r
241_adj_fdivr_m16i
242_adj_fdivr_m32
243_adj_fdivr_m32i
244_adj_fdivr_m64
245_adj_fpatan
246_adj_fprem
247_adj_fprem1
248_adj_fptan
249_adjust_fdiv
250_aexit_rtn168_aexit_rtn
251_aligned_free169_aligned_free
252_aligned_free_dbg170_aligned_free_dbg
@@ -285,7 +203,7 @@ _cgetws_s · 32 unmodified lines
285_chdir203_chdir
286_chdrive204_chdrive
287_chgsign205_chgsign
288_chkesp206_chgsignf
289_chmod207_chmod
290_chsize208_chsize
291_chsize_s209_chsize_s
@@ -299,6 +217,7 @@ _control87 · 7 unmodified lines
299_controlfp217_controlfp
300_controlfp_s218_controlfp_s
301_copysign219_copysign
220_copysignf
302_cprintf221_cprintf
303_cprintf_l222_cprintf_l
304_cprintf_p223_cprintf_p
@@ -308,6 +227,7 @@ _cprintf_s_l · 3 unmodified lines
308_cputs227_cputs
309_cputws228_cputws
310_creat229_creat
230_create_locale
311_crtAssertBusy231_crtAssertBusy
312_crtBreakAlloc232_crtBreakAlloc
313_crtDbgFlag233_crtDbgFlag
@@ -344,9 +264,6 @@ _endthreadex · 30 unmodified lines
344_environ264_environ
345_eof265_eof
346_errno266_errno
347_except_handler2
348_except_handler3
349_except_handler4_common
350_execl267_execl
351_execle268_execle
352_execlp269_execlp
@@ -377,11 +294,12 @@ _findnext · 24 unmodified lines
377_findnext64294_findnext64
378_findnexti64295_findnexti64
379_finite296_finite
297_finitef
380_flsbuf298_flsbuf
381_flushall299_flushall
382_fmode300_fmode
383_fpclass301_fpclass
384_fpieee_flt302_fpclassf
385_fpreset303_fpreset
386_fprintf_l304_fprintf_l
387_fprintf_p305_fprintf_p
@@ -390,6 +308,7 @@ _fprintf_s_l · 2 unmodified lines
390_fputchar308_fputchar
391_fputwchar309_fputwchar
392_free_dbg310_free_dbg
311_free_locale
393_freea312_freea
394_freea_s313_freea_s
395_fscanf_l314_fscanf_l
@@ -404,10 +323,6 @@ _ftime32 · 8 unmodified lines
404_ftime32_s323_ftime32_s
405_ftime64324_ftime64
406_ftime64_s325_ftime64_s
407_ftol
408_ftol2
409_ftol2_sse
410_ftol2_sse_excpt
411_fullpath326_fullpath
412_fullpath_dbg327_fullpath_dbg
413_futime328_futime
@@ -421,6 +336,7 @@ _fwscanf_l · 7 unmodified lines
421_fwscanf_s_l336_fwscanf_s_l
422_gcvt337_gcvt
423_gcvt_s338_gcvt_s
339_get_current_locale
424_get_doserrno340_get_doserrno
425_get_environ341_get_environ
426_get_errno342_get_errno
@@ -443,7 +359,6 @@ _getche · 16 unmodified lines
443_getcwd359_getcwd
444_getdcwd360_getdcwd
445_getdiskfree361_getdiskfree
446_getdllprocaddr
447_getdrive362_getdrive
448_getdrives363_getdrives
449_getmaxstdio364_getmaxstdio
@@ -454,27 +369,22 @@ _getw · 4 unmodified lines
454_getwch369_getwch
455_getwche370_getwche
456_getws371_getws
457_global_unwind2
458_gmtime32372_gmtime32
459_gmtime32_s373_gmtime32_s
460_gmtime64374_gmtime64
461_gmtime64_s375_gmtime64_s
462_heapadd
463_heapchk376_heapchk
464_heapmin377_heapmin
465_heapset378_heapset
466_heapused
467_heapwalk379_heapwalk
468_hypot380_hypot
381_hypotf
469_i64toa382_i64toa
470_i64toa_s383_i64toa_s
471_i64tow384_i64tow
472_i64tow_s385_i64tow_s
473_initterm386_initterm
474_initterm_e387_initterm_e
475_inp
476_inpd
477_inpw
478_invalid_parameter388_invalid_parameter
479_iob389_iob
480_isalnum_l390_isalnum_l
@@ -546,6 +456,7 @@ _ismbslead_l · 65 unmodified lines
546_ismbstrail456_ismbstrail
547_ismbstrail_l457_ismbstrail_l
548_isnan458_isnan
459_isnanf
549_isprint_l460_isprint_l
550_isspace_l461_isspace_l
551_isupper_l462_isupper_l
@@ -572,9 +483,7 @@ _jn · 20 unmodified lines
572_kbhit483_kbhit
573_lfind484_lfind
574_lfind_s485_lfind_s
575_loaddll486_local_unwind
576_local_unwind2
577_local_unwind4
578_localtime32487_localtime32
579_localtime32_s488_localtime32_s
580_localtime64489_localtime64
@@ -582,7 +491,7 @@ _localtime64_s · 1 unmodified line
582_lock491_lock
583_locking492_locking
584_logb493_logb
585_longjmpex494_logbf
586_lrotl495_lrotl
587_lrotr496_lrotr
588_lsearch497_lsearch
@@ -746,16 +655,14 @@ _mktemp_s · 157 unmodified lines
746_mktime32655_mktime32
747_mktime64656_mktime64
748_msize657_msize
749_msize_debug658_msize_dbg
750_nextafter659_nextafter
660_nextafterf
751_onexit661_onexit
752_open662_open
753_open_osfhandle663_open_osfhandle
754_osplatform664_osplatform
755_osver665_osver
756_outp
757_outpd
758_outpw
759_pclose666_pclose
760_pctype667_pctype
761_pgmptr668_pgmptr
@@ -782,11 +689,8 @@ _rotl · 20 unmodified lines
782_rotl64689_rotl64
783_rotr690_rotr
784_rotr64691_rotr64
785_safe_fdiv
786_safe_fdivr
787_safe_fprem
788_safe_fprem1
789_scalb692_scalb
693_scalbf
790_scanf_l694_scanf_l
791_scanf_s_l695_scanf_s_l
792_scprintf696_scprintf
@@ -797,9 +701,6 @@ _scwprintf_l · 4 unmodified lines
797_scwprintf_p_l701_scwprintf_p_l
798_searchenv702_searchenv
799_searchenv_s703_searchenv_s
800_seh_longjmp_unwind
801_seh_longjmp_unwind4
802_set_SSE2_enable
803_set_controlfp704_set_controlfp
804_set_doserrno705_set_doserrno
805_set_errno706_set_errno
@@ -810,7 +711,7 @@ _set_output_format · 4 unmodified lines
810_set_sbh_threshold711_set_sbh_threshold
811_seterrormode712_seterrormode
812_setjmp713_setjmp
813_setjmp3714_setjmpex
814_setmaxstdio715_setmaxstdio
815_setmbcp716_setmbcp
816_setmode717_setmode
@@ -934,7 +835,6 @@ _umask_s · 117 unmodified lines
934_ungetch835_ungetch
935_ungetwch836_ungetwch
936_unlink837_unlink
937_unloaddll
938_unlock838_unlock
939_utime839_utime
940_utime32840_utime32
@@ -1027,6 +927,7 @@ _wcsnset_s · 86 unmodified lines
1027_wcsrev927_wcsrev
1028_wcsset928_wcsset
1029_wcsset_s929_wcsset_s
930_wcstod_l
1030_wcstoi64931_wcstoi64
1031_wcstoi64_l932_wcstoi64_l
1032_wcstol_l933_wcstol_l
@@ -1146,11 +1047,15 @@ _yn · 113 unmodified lines
1146abort1047abort
1147abs1048abs
1148acos1049acos
1050acosf
1149asctime1051asctime
1150asctime_s1052asctime_s
1151asin1053asin
1054asinf
1152atan1055atan
1153atan21056atan2
1057atan2f
1058atanf
1154atexit1059atexit
1155atof1060atof
1156atoi1061atoi
@@ -1160,16 +1065,20 @@ bsearch_s · 3 unmodified lines
1160btowc1065btowc
1161calloc1066calloc
1162ceil1067ceil
1068ceilf
1163clearerr1069clearerr
1164clearerr_s1070clearerr_s
1165clock1071clock
1166cos1072cos
1073cosf
1167cosh1074cosh
1075coshf
1168ctime1076ctime
1169difftime1077difftime
1170div1078div
1171exit1079exit
1172exp1080exp
1081expf
1173fabs1082fabs
1174fclose1083fclose
1175feof1084feof
@@ -1181,7 +1090,9 @@ fgets · 5 unmodified lines
1181fgetwc1090fgetwc
1182fgetws1091fgetws
1183floor1092floor
1093floorf
1184fmod1094fmod
1095fmodf
1185fopen1096fopen
1186fopen_s1097fopen_s
1187fprintf1098fprintf
@@ -1246,6 +1157,8 @@ localeconv · 58 unmodified lines
1246localtime1157localtime
1247log1158log
1248log101159log10
1160log10f
1161logf
1249longjmp1162longjmp
1250malloc1163malloc
1251mblen1164mblen
@@ -1266,8 +1179,10 @@ memmove_s · 14 unmodified lines
1266memset1179memset
1267mktime1180mktime
1268modf1181modf
1182modff
1269perror1183perror
1270pow1184pow
1185powf
1271printf1186printf
1272printf_s1187printf_s
1273putc1188putc
@@ -1287,14 +1202,18 @@ rewind · 13 unmodified lines
1287scanf1202scanf
1288scanf_s1203scanf_s
1289setbuf1204setbuf
1205setjmp
1290setlocale1206setlocale
1291setvbuf1207setvbuf
1292signal1208signal
1293sin1209sin
1210sinf
1294sinh1211sinh
1212sinhf
1295sprintf1213sprintf
1296sprintf_s1214sprintf_s
1297sqrt1215sqrt
1216sqrtf
1298srand1217srand
1299sscanf1218sscanf
1300sscanf_s1219sscanf_s
@@ -1332,7 +1251,9 @@ swscanf · 31 unmodified lines
1332swscanf_s1251swscanf_s
1333system1252system
1334tan1253tan
1254tanf
1335tanh1255tanh
1256tanhf
1336time1257time
1337tmpfile1258tmpfile
1338tmpfile_s1259tmpfile_s

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t