5
/* $Id: datatypes.c,v 1.9.10.1 2006-12-14 13:24:47 manoj Exp $
6
* conversion of MA identifiers between C to Fortran data types
7
* Note that ga_type_c2f(MT_F_INT) == MT_F_INT
14
Integer pnga_type_f2c(Integer type)
19
# if SIZEOF_F77_INTEGER == SIZEOF_INT
21
# elif SIZEOF_F77_INTEGER == SIZEOF_LONG
23
# elif SIZEOF_F77_INTEGER == SIZEOF_LONG_LONG
26
# error SIZEOF_F77_INTEGER == SIZEOF_???
30
# if SIZEOF_F77_REAL == SIZEOF_FLOAT
32
# elif SIZEOF_F77_REAL == SIZEOF_DOUBLE
34
# elif SIZEOF_F77_REAL == SIZEOF_LONG_DOUBLE
35
# error SIZEOF_F77_REAL == SIZEOF_LONG_DOUBLE not supported?
37
# error SIZEOF_F77_REAL == SIZEOF_???
41
# if SIZEOF_F77_DOUBLE_PRECISION == SIZEOF_DOUBLE
43
# elif SIZEOF_F77_DOUBLE_PRECISION == SIZEOF_LONG_DOUBLE
44
# error SIZEOF_F77_DOUBLE_PRECISION == SIZEOF_LONG_DOUBLE not supported?
46
# error SIZEOF_F77_DOUBLE_PRECISION == SIZEOF_???
53
# if SIZEOF_F77_REAL == SIZEOF_FLOAT
55
# elif SIZEOF_F77_REAL == SIZEOF_DOUBLE
57
# elif SIZEOF_F77_REAL == SIZEOF_LONG_DOUBLE
58
# error SIZEOF_F77_REAL == SIZEOF_LONG_DOUBLE not supported?
60
# error SIZEOF_F77_REAL == SIZEOF_???
63
default: ctype = type;
71
Integer pnga_type_c2f(Integer type)
76
ftype = (sizeof(int) != sizeof(Integer))? -1: MT_F_INT;
79
ftype = (sizeof(long) != sizeof(Integer))? -1: MT_F_INT;
82
ftype = (sizeof(long long) != sizeof(Integer))? -1: MT_F_INT;
85
# if SIZEOF_FLOAT == SIZEOF_F77_REAL
87
# elif SIZEOF_FLOAT == SIZEOF_F77_DOUBLE_PRECISION
100
# if SIZEOF_FLOAT == SIZEOF_F77_REAL
102
# elif SIZEOF_FLOAT == SIZEOF_F77_DOUBLE_PRECISION
108
default: ftype = type;