Changeset 96098 in vbox for trunk/include/iprt/nocrt
- Timestamp:
- Aug 7, 2022 7:04:19 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 152897
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/nocrt/math.h
r96019 r96098 64 64 */ 65 65 extern const union __infinity_un { 66 unsigned char __uc[8];67 double __ud;66 RTFLOAT64U __uu; 67 double __ud; 68 68 } RT_NOCRT(__infinity); 69 69 70 extern const union __nan _un {71 unsigned char __uc[sizeof(float)];72 float __uf;73 } RT_NOCRT(__nan );70 extern const union __nanf_un { 71 RTFLOAT32U __uu; 72 float __uf; 73 } RT_NOCRT(__nanf); 74 74 75 75 #if __GNUC_PREREQ__(3, 3) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800) … … 81 81 #endif 82 82 83 #ifdef __MATH_BUILTIN_CONSTANTS 84 #define HUGE_VAL __builtin_huge_val() 83 #if defined(__MATH_BUILTIN_CONSTANTS) \ 84 || (RT_MSC_PREREQ(RT_MSC_VER_VC140) && defined(__cplusplus)) /** @todo when was this added exactly? 2015, 2017 & 2019 has it for C++. */ 85 # define HUGE_VAL __builtin_huge_val() 85 86 #else 86 # define HUGE_VAL(RT_NOCRT(__infinity).__ud)87 # define HUGE_VAL (RT_NOCRT(__infinity).__ud) 87 88 #endif 88 89 … … 483 484 484 485 #ifdef __MATH_BUILTIN_CONSTANTS 485 #define HUGE_VALF __builtin_huge_valf() 486 #define HUGE_VALL __builtin_huge_vall() 487 #define INFINITY __builtin_inf() 488 #define NAN __builtin_nan("") 486 # define HUGE_VALF __builtin_huge_valf() 487 # define HUGE_VALL __builtin_huge_vall() 488 # define INFINITY __builtin_inf() 489 # define NAN __builtin_nan("") 490 #elif RT_MSC_PREREQ(RT_MSC_VER_VC140) && defined(__cplusplus) 491 /** @todo When were these introduced exactly? 2015, 2017 & 2019 has them. 492 * However, they only work in C++ even if the c1.dll includes the strings. Oh, well. */ 493 # define HUGE_VALF __builtin_huge_valf() 494 # define HUGE_VALL __builtin_huge_val() 495 # define INFINITY __builtin_huge_val() 496 # define NAN __builtin_nan("0") /* same as we use in climits */ 489 497 #else 490 # define HUGE_VALF (float)HUGE_VAL491 # define HUGE_VALL (long double)HUGE_VAL492 # define INFINITY HUGE_VALF493 # define NAN (__nan.__uf)498 # define HUGE_VALF (float)HUGE_VAL 499 # define HUGE_VALL (long double)HUGE_VAL 500 # define INFINITY HUGE_VALF 501 # define NAN (__nanf.__uf) 494 502 #endif /* __MATH_BUILTIN_CONSTANTS */ 495 503 … … 566 574 #if !defined(RT_WITHOUT_NOCRT_WRAPPERS) && !defined(RT_WITHOUT_NOCRT_WRAPPER_ALIASES) 567 575 /* sed -e "/#/d" -e "/RT_NOCRT/!d" -e "s/^.*RT_NOCRT(\([a-z0-9_]*\)).*$/# define \1 RT_NOCRT(\1)/" */ 568 # define __infinity RT_NOCRT(__infinity)569 # define __nan RT_NOCRT(__nan)570 576 # define __fpclassifyf RT_NOCRT(__fpclassifyf) 571 577 # define __fpclassifyd RT_NOCRT(__fpclassifyd)
Note:
See TracChangeset
for help on using the changeset viewer.