transfer128.c 3.0 KB

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