1 /* Copyright (C) 2005, 2007 Free Software Foundation, Inc.
2 Contributed by Janne Blomqvist
4 This file is part of the GNU Fortran runtime library (libgfortran).
6 Libgfortran is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 In addition to the permissions in the GNU General Public License, the
12 Free Software Foundation gives you unlimited permission to link the
13 compiled version of this file into combinations with other programs,
14 and to distribute those combinations without any restriction coming
15 from the use of this file. (The General Public License restrictions
16 do apply in other respects; for example, they cover modification of
17 the file, and distribution when not linked into a combine
20 Libgfortran is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU General Public License for more details.
25 You should have received a copy of the GNU General Public License
26 along with Libgfortran; see the file COPYING. If not, write to
27 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
28 Boston, MA 02110-1301, USA. */
31 /* This file contains utility functions for determining the size of a
32 variable given its kind. */
37 size_from_real_kind (int kind
)
41 #ifdef HAVE_GFC_REAL_4
43 return sizeof (GFC_REAL_4
);
45 #ifdef HAVE_GFC_REAL_8
47 return sizeof (GFC_REAL_8
);
49 #ifdef HAVE_GFC_REAL_10
51 return sizeof (GFC_REAL_10
);
53 #ifdef HAVE_GFC_REAL_16
55 return sizeof (GFC_REAL_16
);
64 size_from_complex_kind (int kind
)
68 #ifdef HAVE_GFC_COMPLEX_4
70 return sizeof (GFC_COMPLEX_4
);
72 #ifdef HAVE_GFC_COMPLEX_8
74 return sizeof (GFC_COMPLEX_8
);
76 #ifdef HAVE_GFC_COMPLEX_10
78 return sizeof (GFC_COMPLEX_10
);
80 #ifdef HAVE_GFC_COMPLEX_16
82 return sizeof (GFC_COMPLEX_16
);