PR middle-end/66429
[official-gcc.git] / libgfortran / io / transfer128.c
blob31bf22f1b75725b075f365969add21c5d1658b5b
1 /* Copyright (C) 2010-2015 Free Software Foundation, Inc.
3 This file is part of the GNU Fortran runtime library (libgfortran).
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.
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.
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.
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/>. */
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. */
28 #include "io.h"
31 #if defined(GFC_REAL_16_IS_FLOAT128)
33 /* The prototypes for the called procedures in transfer.c. */
35 extern void transfer_real (st_parameter_dt *, void *, int);
36 export_proto(transfer_real);
38 extern void transfer_real_write (st_parameter_dt *, void *, int);
39 export_proto(transfer_real_write);
41 extern void transfer_complex (st_parameter_dt *, void *, int);
42 export_proto(transfer_complex);
44 extern void transfer_complex_write (st_parameter_dt *, void *, int);
45 export_proto(transfer_complex_write);
48 /* The prototypes for the procedures in this file. */
50 extern void transfer_real128 (st_parameter_dt *, void *, int);
51 export_proto(transfer_real128);
53 extern void transfer_real128_write (st_parameter_dt *, void *, int);
54 export_proto(transfer_real128_write);
56 extern void transfer_complex128 (st_parameter_dt *, void *, int);
57 export_proto(transfer_complex128);
59 extern void transfer_complex128_write (st_parameter_dt *, void *, int);
60 export_proto(transfer_complex128_write);
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 static void __attribute__((used)) *tmp1 = strtoflt128;
69 static void __attribute__((used)) *tmp2 = quadmath_snprintf;
71 void
72 transfer_real128 (st_parameter_dt *dtp, void *p, int kind)
74 transfer_real (dtp, p, kind);
78 void
79 transfer_real128_write (st_parameter_dt *dtp, void *p, int kind)
81 transfer_real (dtp, p, kind);
85 void
86 transfer_complex128 (st_parameter_dt *dtp, void *p, int kind)
88 transfer_complex (dtp, p, kind);
92 void
93 transfer_complex128_write (st_parameter_dt *dtp, void *p, int kind)
95 transfer_complex_write (dtp, p, kind);
97 #endif