1 | /* Wrappers for err.h functions. IEEE128 version. |
2 | Copyright (C) 2019-2024 Free Software Foundation, Inc. |
3 | This file is part of the GNU C Library. |
4 | |
5 | The GNU C Library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Lesser General Public |
7 | License as published by the Free Software Foundation; either |
8 | version 2.1 of the License, or (at your option) any later version. |
9 | |
10 | The GNU C Library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Lesser General Public License for more details. |
14 | |
15 | You should have received a copy of the GNU Lesser General Public |
16 | License along with the GNU C Library; if not, see |
17 | <https://www.gnu.org/licenses/>. */ |
18 | |
19 | #include <err.h> |
20 | #include <stdarg.h> |
21 | #include <libio/libioP.h> |
22 | |
23 | #define VA(call) \ |
24 | { \ |
25 | va_list ap; \ |
26 | va_start (ap, format); \ |
27 | IEEE128_CALL (call); \ |
28 | va_end (ap); \ |
29 | } |
30 | |
31 | #define IEEE128_ALIAS(name) \ |
32 | strong_alias (___ieee128_##name, __##name##ieee128) |
33 | |
34 | #define IEEE128_DECL(name) ___ieee128_##name |
35 | #define IEEE128_CALL(name) ___ieee128_##name |
36 | |
37 | void |
38 | IEEE128_DECL (vwarn) (const char *format, __gnuc_va_list ap) |
39 | { |
40 | __vwarn_internal (format, ap, PRINTF_LDBL_USES_FLOAT128); |
41 | } |
42 | IEEE128_ALIAS (vwarn) |
43 | |
44 | void |
45 | IEEE128_DECL (vwarnx) (const char *format, __gnuc_va_list ap) |
46 | { |
47 | __vwarnx_internal (format, ap, PRINTF_LDBL_USES_FLOAT128); |
48 | } |
49 | IEEE128_ALIAS (vwarnx) |
50 | |
51 | void |
52 | IEEE128_DECL (warn) (const char *format, ...) |
53 | { |
54 | VA (vwarn (format, ap)) |
55 | } |
56 | IEEE128_ALIAS (warn) |
57 | |
58 | void |
59 | IEEE128_DECL (warnx) (const char *format, ...) |
60 | { |
61 | VA (vwarnx (format, ap)) |
62 | } |
63 | IEEE128_ALIAS (warnx) |
64 | |
65 | void |
66 | IEEE128_DECL (verr) (int status, const char *format, __gnuc_va_list ap) |
67 | { |
68 | IEEE128_CALL (vwarn) (format, ap); |
69 | exit (status: status); |
70 | } |
71 | IEEE128_ALIAS (verr) |
72 | |
73 | void |
74 | IEEE128_DECL (verrx) (int status, const char *format, __gnuc_va_list ap) |
75 | { |
76 | IEEE128_CALL (vwarnx) (format, ap); |
77 | exit (status: status); |
78 | } |
79 | IEEE128_ALIAS (verrx) |
80 | |
81 | void |
82 | IEEE128_DECL (err) (int status, const char *format, ...) |
83 | { |
84 | VA (verr (status, format, ap)) |
85 | } |
86 | IEEE128_ALIAS (err) |
87 | |
88 | void |
89 | IEEE128_DECL (errx) (int status, const char *format, ...) |
90 | { |
91 | VA (verrx (status, format, ap)) |
92 | } |
93 | IEEE128_ALIAS (errx) |
94 | |
95 | hidden_def (___ieee128_warn) |
96 | hidden_def (___ieee128_warnx) |
97 | hidden_def (___ieee128_vwarn) |
98 | hidden_def (___ieee128_vwarnx) |
99 | hidden_def (___ieee128_verr) |
100 | hidden_def (___ieee128_verrx) |
101 | |