1/* IEEE binary128 versions of *cvt functions.
2 Copyright (C) 2018-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/* When in IEEE long double mode, call ___ieee128_sprintf. */
20#include <stdio.h>
21typeof (sprintf) ___ieee128_sprintf attribute_hidden;
22#define SPRINTF ___ieee128_sprintf
23
24/* Declare internal functions: ___qecvtieee128_r and ___qfcvtieee128_r,
25 built from a different compiling unit, and called from here. */
26#include <stdlib.h>
27typeof (qecvt_r) ___qecvtieee128_r;
28typeof (qfcvt_r) ___qfcvtieee128_r;
29
30/* Rename the static buffers and pointer, otherwise the IEEE long double
31 variants of qecvt and qfcvt would reuse the same buffers and pointer
32 as their non-IEEE long double counterparts. */
33#define qecvt_buffer qecvtieee128_buffer
34#define qfcvt_buffer qfcvtieee128_buffer
35#define qfcvt_bufptr qfcvtieee128_bufptr
36
37#define ECVT __qecvtieee128
38#define FCVT __qfcvtieee128
39#define GCVT __qgcvtieee128
40#define __ECVT ___qecvtieee128
41#define __FCVT ___qfcvtieee128
42#define __GCVT ___qgcvtieee128
43#define __ECVT_R ___qecvtieee128_r
44#define __FCVT_R ___qfcvtieee128_r
45#define __EFGCVT_FREEMEM_PTR __libc_efgcvtieee128_freemem_ptr
46#include <efgcvt-ldbl-macros.h>
47#include <efgcvt-template.c>
48
49#define cvt_symbol(local, symbol) \
50 strong_alias (local, symbol)
51cvt_symbol (___qfcvtieee128, __qfcvtieee128);
52cvt_symbol (___qecvtieee128, __qecvtieee128);
53cvt_symbol (___qgcvtieee128, __qgcvtieee128);
54

source code of glibc/sysdeps/ieee754/ldbl-128ibm-compat/ieee128-qefgcvt.c