]>
Commit | Line | Data |
---|---|---|
83ffe9cd | 1 | /* Copyright (C) 2010-2023 Free Software Foundation, Inc. |
1ec601bf FXC |
2 | |
3 | This file is part of the GNU Fortran runtime library (libgfortran). | |
4 | ||
5 | Libgfortran is free software; you can redistribute it and/or modify | |
6 | it under the terms of the GNU General Public License as published by | |
7 | the Free Software Foundation; either version 3, or (at your option) | |
8 | any later version. | |
9 | ||
10 | Libgfortran 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 | |
13 | GNU General Public License for more details. | |
14 | ||
15 | Under Section 7 of GPL version 3, you are granted additional | |
16 | permissions described in the GCC Runtime Library Exception, version | |
17 | 3.1, as published by the Free Software Foundation. | |
18 | ||
19 | You should have received a copy of the GNU General Public License and | |
20 | a copy of the GCC Runtime Library Exception along with this program; | |
21 | see 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 | ||
07c60b8e | 31 | #if defined(GFC_REAL_16_IS_FLOAT128) || defined(HAVE_GFC_REAL_17) |
1ec601bf FXC |
32 | |
33 | /* The prototypes for the called procedures in transfer.c. */ | |
34 | ||
35 | extern void transfer_real (st_parameter_dt *, void *, int); | |
36 | export_proto(transfer_real); | |
37 | ||
38 | extern void transfer_real_write (st_parameter_dt *, void *, int); | |
39 | export_proto(transfer_real_write); | |
40 | ||
41 | extern void transfer_complex (st_parameter_dt *, void *, int); | |
42 | export_proto(transfer_complex); | |
43 | ||
44 | extern void transfer_complex_write (st_parameter_dt *, void *, int); | |
45 | export_proto(transfer_complex_write); | |
46 | ||
47 | ||
48 | /* The prototypes for the procedures in this file. */ | |
49 | ||
50 | extern void transfer_real128 (st_parameter_dt *, void *, int); | |
51 | export_proto(transfer_real128); | |
52 | ||
53 | extern void transfer_real128_write (st_parameter_dt *, void *, int); | |
54 | export_proto(transfer_real128_write); | |
55 | ||
56 | extern void transfer_complex128 (st_parameter_dt *, void *, int); | |
57 | export_proto(transfer_complex128); | |
58 | ||
59 | extern void transfer_complex128_write (st_parameter_dt *, void *, int); | |
60 | export_proto(transfer_complex128_write); | |
61 | ||
62 | ||
e313241f | 63 | /* Make sure that libquadmath is pulled in. The functions strtoflt128 |
1d92226b | 64 | and quadmath_snprintf are weakly referrenced in convert_real and |
e313241f JJ |
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. */ | |
133d0d42 JJ |
68 | # if (defined(HAVE_GFC_REAL_17) && !defined(POWER_IEEE128) \ |
69 | && !defined(GFC_REAL_17_USE_IEC_60559)) \ | |
70 | || (!defined(HAVE_GFC_REAL_17) && !defined(GFC_REAL_16_USE_IEC_60559)) | |
e313241f | 71 | static void __attribute__((used)) *tmp1 = strtoflt128; |
1d92226b | 72 | static void __attribute__((used)) *tmp2 = quadmath_snprintf; |
07c60b8e | 73 | # endif |
1ec601bf FXC |
74 | |
75 | void | |
76 | transfer_real128 (st_parameter_dt *dtp, void *p, int kind) | |
77 | { | |
1ec601bf FXC |
78 | transfer_real (dtp, p, kind); |
79 | } | |
80 | ||
81 | ||
82 | void | |
83 | transfer_real128_write (st_parameter_dt *dtp, void *p, int kind) | |
84 | { | |
1ec601bf FXC |
85 | transfer_real (dtp, p, kind); |
86 | } | |
87 | ||
88 | ||
89 | void | |
90 | transfer_complex128 (st_parameter_dt *dtp, void *p, int kind) | |
91 | { | |
1ec601bf FXC |
92 | transfer_complex (dtp, p, kind); |
93 | } | |
94 | ||
95 | ||
96 | void | |
97 | transfer_complex128_write (st_parameter_dt *dtp, void *p, int kind) | |
98 | { | |
1ec601bf FXC |
99 | transfer_complex_write (dtp, p, kind); |
100 | } | |
101 | #endif |