]> git.proxmox.com Git - wasi-libc.git/blob - libc-top-half/headers/private/printscan.h
273bc8eddc8bd0661759ec073ab00bafe9d3b54e
[wasi-libc.git] / libc-top-half / headers / private / printscan.h
1 #if defined(__wasilibc_printscan_no_floating_point)
2
3 #include <stdio.h>
4
5 __attribute__((__cold__, __noreturn__))
6 static void floating_point_not_supported(void) {
7 void abort(void) __attribute__((__noreturn__));
8 fputs("Support for floating-point formatting is currently disabled.\n"
9 "To enable it, " __wasilibc_printscan_floating_point_support_option ".\n", stderr);
10 abort();
11 }
12
13 #elif defined(__wasilibc_printscan_no_long_double)
14
15 #include <stdio.h>
16
17 typedef double long_double;
18 #undef LDBL_TRUE_MIN
19 #define LDBL_TRUE_MIN DBL_DENORM_MIN
20 #undef LDBL_MIN
21 #define LDBL_MIN DBL_MIN
22 #undef LDBL_MAX
23 #define LDBL_MAX DBL_MAX
24 #undef LDBL_EPSILON
25 #define LDBL_EPSILON DBL_EPSILON
26 #undef LDBL_MANT_DIG
27 #define LDBL_MANT_DIG DBL_MANT_DIG
28 #undef LDBL_MIN_EXP
29 #define LDBL_MIN_EXP DBL_MIN_EXP
30 #undef LDBL_MAX_EXP
31 #define LDBL_MAX_EXP DBL_MAX_EXP
32 #undef LDBL_DIG
33 #define LDBL_DIG DBL_DIG
34 #undef LDBL_MIN_10_EXP
35 #define LDBL_MIN_10_EXP DBL_MIN_10_EXP
36 #undef LDBL_MAX_10_EXP
37 #define LDBL_MAX_10_EXP DBL_MAX_10_EXP
38 #undef frexpl
39 #define frexpl(x, exp) frexp(x, exp)
40 __attribute__((__cold__, __noreturn__))
41 static void long_double_not_supported(void) {
42 void abort(void) __attribute__((__noreturn__));
43 fputs("Support for formatting long double values is currently disabled.\n"
44 "To enable it, " __wasilibc_printscan_full_support_option ".\n", &__stderr_FILE);
45 abort();
46 }
47
48 #else
49
50 /* Full long double support. */
51 typedef long double long_double;
52
53 #endif