crt: _HUGE for UCRT

Signed-off-by: Jonathan Yong <10walls@gmail.com>
This commit is contained in:
Jonathan Yong 2021-05-15 12:56:51 +00:00
parent 69e13b5806
commit 5a4f14f699
No known key found for this signature in database
GPG Key ID: 713B5FE29C145D45
3 changed files with 8 additions and 0 deletions

View File

@ -229,6 +229,7 @@ src_msvcrt=\
src_ucrtbase=\
crt/ucrtbase_compat.c \
math/_huge.c \
stdio/ucrt_fprintf.c \
stdio/ucrt_fscanf.c \
stdio/ucrt_fwprintf.c \

View File

@ -0,0 +1,2 @@
/* For UCRT, positive infinity */
double const _HUGE = __builtin_huge_val();

View File

@ -143,8 +143,13 @@ extern "C" {
#endif
#ifndef _HUGE
#ifdef _UCRT
extern double const _HUGE;
#define _HUGE _HUGE
#else
extern double * __MINGW_IMP_SYMBOL(_HUGE);
#define _HUGE (* __MINGW_IMP_SYMBOL(_HUGE))
#endif /* _UCRT */
#endif
#ifdef __GNUC__