1/* Copyright (C) 2010-2022 Free Software Foundation, Inc.
2
3This file is part of the GNU Fortran runtime library (libgfortran).
4
5Libgfortran is free software; you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation; either version 3, or (at your option)
8any later version.
9
10Libgfortran is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13GNU General Public License for more details.
14
15Under Section 7 of GPL version 3, you are granted additional
16permissions described in the GCC Runtime Library Exception, version
173.1, as published by the Free Software Foundation.
18
19You should have received a copy of the GNU General Public License and
20a copy of the GCC Runtime Library Exception along with this program;
21see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
22<http://www.gnu.org/licenses/>.  */
23
24/* Note: This file needs to be a separate translation unit (.o file)
25   to make sure that for static linkage, the libquad dependence only
26   occurs if needed.  */
27
28#include "io.h"
29
30
31#if defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_GFC_REAL_17)
32
33/* The prototypes for the called procedures in transfer.c.  */
34
35extern void transfer_real (st_parameter_dt *, void *, int);
36export_proto(transfer_real);
37
38extern void transfer_real_write (st_parameter_dt *, void *, int);
39export_proto(transfer_real_write);
40
41extern void transfer_complex (st_parameter_dt *, void *, int);
42export_proto(transfer_complex);
43
44extern void transfer_complex_write (st_parameter_dt *, void *, int);
45export_proto(transfer_complex_write);
46
47
48/* The prototypes for the procedures in this file.  */
49
50extern void transfer_real128 (st_parameter_dt *, void *, int);
51export_proto(transfer_real128);
52
53extern void transfer_real128_write (st_parameter_dt *, void *, int);
54export_proto(transfer_real128_write);
55
56extern void transfer_complex128 (st_parameter_dt *, void *, int);
57export_proto(transfer_complex128);
58
59extern void transfer_complex128_write (st_parameter_dt *, void *, int);
60export_proto(transfer_complex128_write);
61
62
63/* Make sure that libquadmath is pulled in. The functions strtoflt128
64   and quadmath_snprintf are weakly referrenced in convert_real and
65   write_float; the pointer assignment with USED attribute make sure
66   that there is a non-weakref dependence if the quadmath functions
67   are used. That avoids segfault when libquadmath is statically linked.  */
68# if !defined(HAVE_GFC_REAL_17) || !defined(POWER_IEEE128)
69static void __attribute__((used)) *tmp1 = strtoflt128;
70static void __attribute__((used)) *tmp2 = quadmath_snprintf;
71# endif
72
73void
74transfer_real128 (st_parameter_dt *dtp, void *p, int kind)
75{
76  transfer_real (dtp, p, kind);
77}
78
79
80void
81transfer_real128_write (st_parameter_dt *dtp, void *p, int kind)
82{
83  transfer_real (dtp, p, kind);
84}
85
86
87void
88transfer_complex128 (st_parameter_dt *dtp, void *p, int kind)
89{
90  transfer_complex (dtp, p, kind);
91}
92
93
94void
95transfer_complex128_write (st_parameter_dt *dtp, void *p, int kind)
96{
97  transfer_complex_write (dtp, p, kind);
98}
99#endif
100