]> gcc.gnu.org Git - gcc.git/blob - libgfortran/ISO_Fortran_binding-2-tmpl.h
Bind(C): Fix type encodings in ISO_Fortran_binding.h
[gcc.git] / libgfortran / ISO_Fortran_binding-2-tmpl.h
1 #include "config.h"
2 #include "kinds.inc"
3
4 /* Note that -1 is used by CFI_type_other, hence, -2 is used for unavailable kinds. */
5
6 #if GFC_C_INT128_T_KIND == 16
7 #define CFI_type_int128_t (CFI_type_Integer + (16 << CFI_type_kind_shift))
8 #define CFI_type_int_least128_t (CFI_type_Integer + (16 << CFI_type_kind_shift))
9 #define CFI_type_int_fast128_t (CFI_type_Integer + (16 << CFI_type_kind_shift))
10 #elif GFC_C_INT128_T_KIND < 0
11 #define CFI_type_int128_t -2
12 #define CFI_type_int_least128_t -2
13 #define CFI_type_int_fast128_t -2
14 #else
15 #error "Unexpected value for GFC_C_INT128_T_KIND"
16 #endif
17
18 #if GFC_C_LONG_DOUBLE_KIND == 16
19 #define CFI_type_long_double (CFI_type_Real + (16 << CFI_type_kind_shift))
20 #define CFI_type_long_double_Complex (CFI_type_Complex + (16 << CFI_type_kind_shift))
21 #elif GFC_C_LONG_DOUBLE_KIND == 10
22 #define CFI_type_long_double (CFI_type_Real + (10 << CFI_type_kind_shift))
23 #define CFI_type_long_double_Complex (CFI_type_Complex + (10 << CFI_type_kind_shift))
24 #elif GFC_C_LONG_DOUBLE_KIND == 8
25 #define CFI_type_long_double (CFI_type_Real + (8 << CFI_type_kind_shift))
26 #define CFI_type_long_double_Complex (CFI_type_Complex + (8 << CFI_type_kind_shift))
27 #elif GFC_C_LONG_DOUBLE_KIND < 0
28 #define CFI_type_long_double -2
29 #define CFI_type_long_double_Complex -2
30 #else
31 #error "Unexpected value for GFC_C_LONG_DOUBLE_KIND"
32 #endif
33
34 #if GFC_C_FLOAT128_KIND == 16
35 #define CFI_type_float128 (CFI_type_Real + (16 << CFI_type_kind_shift))
36 #define CFI_type_float128_Complex (CFI_type_Complex + (16 << CFI_type_kind_shift))
37 #elif GFC_C_FLOAT128_KIND < 0
38 #define CFI_type_float128 -2
39 #define CFI_type_float128_Complex -2
40 #else
41 #error "Unexpected value for GFC_C_FLOAT128_KIND"
42 #endif
This page took 0.037721 seconds and 5 git commands to generate.