From e896b05945ceb3cf4f2d17951d0e21ac5558172e Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 27 Jun 2022 21:56:55 -0700 Subject: [PATCH 1/2] Move code from inc/ymath.h to src/xmath.hpp. --- stl/inc/ymath.h | 29 ----------------------------- stl/src/xmath.hpp | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 29 deletions(-) diff --git a/stl/inc/ymath.h b/stl/inc/ymath.h index ff1e5246a0..789ef75a5a 100644 --- a/stl/inc/ymath.h +++ b/stl/inc/ymath.h @@ -18,50 +18,21 @@ _STL_DISABLE_CLANG_WARNINGS _EXTERN_C_UNLESS_PURE // macros for _Dtest return (0 => ZERO) -#define _DENORM (-2) // C9X only -#define _FINITE (-1) #define _INFCODE 1 #define _NANCODE 2 -void __CLRCALL_PURE_OR_CDECL _Feraise(int); - -union _Dconst { // pun float types as integer array - unsigned short _Word[8]; // TRANSITION, ABI: Twice as large as necessary. - float _Float; - double _Double; - long double _Long_double; -}; - _CRTIMP2_PURE double __CLRCALL_PURE_OR_CDECL _Cosh(double, double); -_CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _Dtest(double*); _CRTIMP2_PURE double __CLRCALL_PURE_OR_CDECL _Sinh(double, double); - _CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _Exp(double*, double, short); -extern _CRTIMP2_PURE_IMPORT _Dconst _Denorm; -extern _CRTIMP2_PURE_IMPORT _Dconst _Hugeval; -extern _CRTIMP2_PURE_IMPORT _Dconst _Inf; -extern _CRTIMP2_PURE_IMPORT _Dconst _Nan; -extern _CRTIMP2_PURE_IMPORT _Dconst _Snan; _CRTIMP2_PURE float __CLRCALL_PURE_OR_CDECL _FCosh(float, float); -_CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _FDtest(float*); _CRTIMP2_PURE float __CLRCALL_PURE_OR_CDECL _FSinh(float, float); - _CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _FExp(float*, float, short); -extern _CRTIMP2_PURE_IMPORT _Dconst _FDenorm; -extern _CRTIMP2_PURE_IMPORT _Dconst _FInf; -extern _CRTIMP2_PURE_IMPORT _Dconst _FNan; -extern _CRTIMP2_PURE_IMPORT _Dconst _FSnan; _CRTIMP2_PURE long double __CLRCALL_PURE_OR_CDECL _LCosh(long double, long double); _CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _LDtest(long double*); _CRTIMP2_PURE long double __CLRCALL_PURE_OR_CDECL _LSinh(long double, long double); - _CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _LExp(long double*, long double, short); -extern _CRTIMP2_PURE_IMPORT _Dconst _LDenorm; -extern _CRTIMP2_PURE_IMPORT _Dconst _LInf; -extern _CRTIMP2_PURE_IMPORT _Dconst _LNan; -extern _CRTIMP2_PURE_IMPORT _Dconst _LSnan; _END_EXTERN_C_UNLESS_PURE diff --git a/stl/src/xmath.hpp b/stl/src/xmath.hpp index 4aeba30212..9d31e735c4 100644 --- a/stl/src/xmath.hpp +++ b/stl/src/xmath.hpp @@ -49,8 +49,41 @@ #define FL_NAN 4 #define FL_NEG 8 +// macros for _Dtest return (0 => ZERO) +#define _DENORM (-2) // C9X only +#define _FINITE (-1) + _EXTERN_C_UNLESS_PURE +void __CLRCALL_PURE_OR_CDECL _Feraise(int); + +union _Dconst { // pun float types as integer array + unsigned short _Word[8]; // TRANSITION, ABI: Twice as large as necessary. + float _Float; + double _Double; + long double _Long_double; +}; + +_CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _Dtest(double*); + +extern _CRTIMP2_PURE_IMPORT _Dconst _Denorm; +extern _CRTIMP2_PURE_IMPORT _Dconst _Hugeval; +extern _CRTIMP2_PURE_IMPORT _Dconst _Inf; +extern _CRTIMP2_PURE_IMPORT _Dconst _Nan; +extern _CRTIMP2_PURE_IMPORT _Dconst _Snan; + +_CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _FDtest(float*); + +extern _CRTIMP2_PURE_IMPORT _Dconst _FDenorm; +extern _CRTIMP2_PURE_IMPORT _Dconst _FInf; +extern _CRTIMP2_PURE_IMPORT _Dconst _FNan; +extern _CRTIMP2_PURE_IMPORT _Dconst _FSnan; + +extern _CRTIMP2_PURE_IMPORT _Dconst _LDenorm; +extern _CRTIMP2_PURE_IMPORT _Dconst _LInf; +extern _CRTIMP2_PURE_IMPORT _Dconst _LNan; +extern _CRTIMP2_PURE_IMPORT _Dconst _LSnan; + int _Stopfx(const char**, char**); _In_range_(0, maxsig) int _Stoflt( const char*, const char*, char**, _Out_writes_(maxsig) long[], _In_range_(1, 4) int maxsig); From 9012eacafe227db37988fab7b5e6aec039e9a668 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Mon, 27 Jun 2022 22:03:32 -0700 Subject: [PATCH 2/2] Within src, _CRTIMP2_PURE_IMPORT is just _CRTIMP2_PURE. --- stl/src/xmath.hpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/stl/src/xmath.hpp b/stl/src/xmath.hpp index 9d31e735c4..ba624b355f 100644 --- a/stl/src/xmath.hpp +++ b/stl/src/xmath.hpp @@ -66,23 +66,23 @@ union _Dconst { // pun float types as integer array _CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _Dtest(double*); -extern _CRTIMP2_PURE_IMPORT _Dconst _Denorm; -extern _CRTIMP2_PURE_IMPORT _Dconst _Hugeval; -extern _CRTIMP2_PURE_IMPORT _Dconst _Inf; -extern _CRTIMP2_PURE_IMPORT _Dconst _Nan; -extern _CRTIMP2_PURE_IMPORT _Dconst _Snan; +extern _CRTIMP2_PURE _Dconst _Denorm; +extern _CRTIMP2_PURE _Dconst _Hugeval; +extern _CRTIMP2_PURE _Dconst _Inf; +extern _CRTIMP2_PURE _Dconst _Nan; +extern _CRTIMP2_PURE _Dconst _Snan; _CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _FDtest(float*); -extern _CRTIMP2_PURE_IMPORT _Dconst _FDenorm; -extern _CRTIMP2_PURE_IMPORT _Dconst _FInf; -extern _CRTIMP2_PURE_IMPORT _Dconst _FNan; -extern _CRTIMP2_PURE_IMPORT _Dconst _FSnan; +extern _CRTIMP2_PURE _Dconst _FDenorm; +extern _CRTIMP2_PURE _Dconst _FInf; +extern _CRTIMP2_PURE _Dconst _FNan; +extern _CRTIMP2_PURE _Dconst _FSnan; -extern _CRTIMP2_PURE_IMPORT _Dconst _LDenorm; -extern _CRTIMP2_PURE_IMPORT _Dconst _LInf; -extern _CRTIMP2_PURE_IMPORT _Dconst _LNan; -extern _CRTIMP2_PURE_IMPORT _Dconst _LSnan; +extern _CRTIMP2_PURE _Dconst _LDenorm; +extern _CRTIMP2_PURE _Dconst _LInf; +extern _CRTIMP2_PURE _Dconst _LNan; +extern _CRTIMP2_PURE _Dconst _LSnan; int _Stopfx(const char**, char**); _In_range_(0, maxsig) int _Stoflt(