| 1 |
/* Copyright (C) 2006-2025 Free Software Foundation, Inc. |
| 2 |
|
| 3 |
This file is part of GCC. |
| 4 |
|
| 5 |
GCC is free software; you can redistribute it and/or modify it under |
| 6 |
the terms of the GNU General Public License as published by the Free |
| 7 |
Software Foundation; either version 3, or (at your option) any later |
| 8 |
version. |
| 9 |
|
| 10 |
GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
| 11 |
WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 12 |
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 13 |
for more details. |
| 14 |
|
| 15 |
You should have received a copy of the GNU General Public License |
| 16 |
along with GCC; see the file COPYING3. If not see |
| 17 |
<http://www.gnu.org/licenses/>. */ |
| 18 |
|
| 19 |
/* This file contains the definition of the named integer constants provided |
| 20 |
by the Fortran 2003 ISO_FORTRAN_ENV intrinsic module. The ordering of |
| 21 |
the entries matters for the *.mod backwards compatibility. */ |
| 22 |
|
| 23 |
#ifndef NAMED_INTCST |
| 24 |
# define NAMED_INTCST(a,b,c,d) |
| 25 |
#endif |
| 26 |
|
| 27 |
#ifndef NAMED_UINTCST |
| 28 |
# define NAMED_UINTCST(a,b,c,d) |
| 29 |
#endif |
| 30 |
|
| 31 |
#ifndef NAMED_KINDARRAY |
| 32 |
# define NAMED_KINDARRAY(a,b,c,d) |
| 33 |
#endif |
| 34 |
|
| 35 |
#ifndef NAMED_SUBROUTINE |
| 36 |
# define NAMED_SUBROUTINE(a,b,c,d) |
| 37 |
#endif |
| 38 |
|
| 39 |
#ifndef NAMED_FUNCTION |
| 40 |
# define NAMED_FUNCTION(a,b,c,d) |
| 41 |
#endif |
| 42 |
|
| 43 |
/* The arguments to NAMED_INTCST are: |
| 44 |
-- an internal name |
| 45 |
-- the symbol name in the module, as seen by Fortran code |
| 46 |
-- the value it has |
| 47 |
-- the standard that supports this type */ |
| 48 |
|
| 49 |
NAMED_INTCST (ISOFORTRANENV_FILE_ATOMIC_INT_KIND, "atomic_int_kind", \ |
| 50 |
gfc_atomic_int_kind, GFC_STD_F2008) |
| 51 |
NAMED_INTCST (ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND, "atomic_logical_kind", \ |
| 52 |
gfc_atomic_logical_kind, GFC_STD_F2008) |
| 53 |
NAMED_INTCST (ISOFORTRANENV_CHARACTER_STORAGE_SIZE, "character_storage_size", \ |
| 54 |
gfc_character_storage_size, GFC_STD_F2003) |
| 55 |
NAMED_INTCST (ISOFORTRANENV_ERROR_UNIT, "error_unit", GFC_STDERR_UNIT_NUMBER, \ |
| 56 |
GFC_STD_F2003) |
| 57 |
NAMED_INTCST (ISOFORTRANENV_FILE_STORAGE_SIZE, "file_storage_size", 8, \ |
| 58 |
GFC_STD_F2003) |
| 59 |
NAMED_INTCST (ISOFORTRANENV_INPUT_UNIT, "input_unit", GFC_STDIN_UNIT_NUMBER, \ |
| 60 |
GFC_STD_F2003) |
| 61 |
NAMED_INTCST (ISOFORTRANENV_INT8, "int8", \ |
| 62 |
gfc_get_int_kind_from_width_isofortranenv (8), GFC_STD_F2008) |
| 63 |
NAMED_INTCST (ISOFORTRANENV_INT16, "int16", \ |
| 64 |
gfc_get_int_kind_from_width_isofortranenv (16), GFC_STD_F2008) |
| 65 |
NAMED_INTCST (ISOFORTRANENV_INT32, "int32", \ |
| 66 |
gfc_get_int_kind_from_width_isofortranenv (32), GFC_STD_F2008) |
| 67 |
NAMED_INTCST (ISOFORTRANENV_INT64, "int64", \ |
| 68 |
gfc_get_int_kind_from_width_isofortranenv (64), GFC_STD_F2008) |
| 69 |
NAMED_INTCST (ISOFORTRANENV_IOSTAT_END, "iostat_end", LIBERROR_END, \ |
| 70 |
GFC_STD_F2003) |
| 71 |
NAMED_INTCST (ISOFORTRANENV_IOSTAT_EOR, "iostat_eor", LIBERROR_EOR, \ |
| 72 |
GFC_STD_F2003) |
| 73 |
NAMED_INTCST (ISOFORTRANENV_IOSTAT_INQUIRE_INTERNAL_UNIT, \ |
| 74 |
"iostat_inquire_internal_unit", LIBERROR_INQUIRE_INTERNAL_UNIT, \ |
| 75 |
GFC_STD_F2008) |
| 76 |
NAMED_INTCST (ISOFORTRANENV_NUMERIC_STORAGE_SIZE, "numeric_storage_size", \ |
| 77 |
gfc_numeric_storage_size, GFC_STD_F2003) |
| 78 |
NAMED_INTCST (ISOFORTRANENV_OUTPUT_UNIT, "output_unit", GFC_STDOUT_UNIT_NUMBER, \ |
| 79 |
GFC_STD_F2003) |
| 80 |
NAMED_INTCST (ISOFORTRANENV_REAL32, "real32", \ |
| 81 |
gfc_get_real_kind_from_width_isofortranenv (32), GFC_STD_F2008) |
| 82 |
NAMED_INTCST (ISOFORTRANENV_REAL64, "real64", \ |
| 83 |
gfc_get_real_kind_from_width_isofortranenv (64), GFC_STD_F2008) |
| 84 |
NAMED_INTCST (ISOFORTRANENV_REAL128, "real128", \ |
| 85 |
gfc_get_real_kind_from_width_isofortranenv (128), GFC_STD_F2008) |
| 86 |
NAMED_INTCST (ISOFORTRANENV_FILE_STAT_LOCKED, "stat_locked", \ |
| 87 |
GFC_STAT_LOCKED, GFC_STD_F2008) |
| 88 |
NAMED_INTCST (ISOFORTRANENV_FILE_STAT_LOCKED_OTHER_IMAGE, \ |
| 89 |
"stat_locked_other_image", \ |
| 90 |
GFC_STAT_LOCKED_OTHER_IMAGE, GFC_STD_F2008) |
| 91 |
NAMED_INTCST (ISOFORTRANENV_FILE_STAT_STOPPED_IMAGE, "stat_stopped_image", \ |
| 92 |
GFC_STAT_STOPPED_IMAGE, GFC_STD_F2008) |
| 93 |
NAMED_INTCST (ISOFORTRANENV_FILE_STAT_FAILED_IMAGE, "stat_failed_image", \ |
| 94 |
GFC_STAT_FAILED_IMAGE, GFC_STD_F2018) |
| 95 |
NAMED_INTCST (ISOFORTRANENV_FILE_STAT_UNLOCKED, "stat_unlocked", \ |
| 96 |
GFC_STAT_UNLOCKED, GFC_STD_F2008) |
| 97 |
|
| 98 |
|
| 99 |
/* The arguments to NAMED_KINDARRAY are: |
| 100 |
-- an internal name |
| 101 |
-- the symbol name in the module, as seen by Fortran code |
| 102 |
-- the gfortran variable containing the information |
| 103 |
-- the Fortran standard */ |
| 104 |
|
| 105 |
NAMED_KINDARRAY (ISOFORTRAN_CHARACTER_KINDS, "character_kinds", \ |
| 106 |
gfc_character_kinds, GFC_STD_F2008) |
| 107 |
NAMED_KINDARRAY (ISOFORTRAN_INTEGER_KINDS, "integer_kinds", \ |
| 108 |
gfc_integer_kinds, GFC_STD_F2008) |
| 109 |
NAMED_KINDARRAY (ISOFORTRAN_LOGICAL_KINDS, "logical_kinds", \ |
| 110 |
gfc_logical_kinds, GFC_STD_F2008) |
| 111 |
NAMED_KINDARRAY (ISOFORTRAN_REAL_KINDS, "real_kinds", \ |
| 112 |
gfc_real_kinds, GFC_STD_F2008) |
| 113 |
|
| 114 |
/* The arguments to NAMED_FUNCTIONS are: |
| 115 |
-- the ISYM |
| 116 |
-- the symbol name in the module, as seen by Fortran code |
| 117 |
-- the Fortran standard */ |
| 118 |
|
| 119 |
NAMED_FUNCTION (ISOFORTRAN_COMPILER_OPTIONS, "compiler_options", \ |
| 120 |
GFC_ISYM_COMPILER_OPTIONS, GFC_STD_F2008) |
| 121 |
NAMED_FUNCTION (ISOFORTRAN_COMPILER_VERSION, "compiler_version", \ |
| 122 |
GFC_ISYM_COMPILER_VERSION, GFC_STD_F2008) |
| 123 |
|
| 124 |
#ifndef NAMED_DERIVED_TYPE |
| 125 |
# define NAMED_DERIVED_TYPE(a,b,c,d) |
| 126 |
#endif |
| 127 |
|
| 128 |
NAMED_DERIVED_TYPE (ISOFORTRAN_LOCK_TYPE, "lock_type", \ |
| 129 |
get_int_kind_from_node (ptr_type_node), GFC_STD_F2008) |
| 130 |
|
| 131 |
NAMED_DERIVED_TYPE (ISOFORTRAN_EVENT_TYPE, "event_type", \ |
| 132 |
flag_coarray == GFC_FCOARRAY_LIB |
| 133 |
? get_int_kind_from_node (ptr_type_node) |
| 134 |
: gfc_default_integer_kind, GFC_STD_F2018) |
| 135 |
|
| 136 |
NAMED_DERIVED_TYPE (ISOFORTRAN_TEAM_TYPE, "team_type", \ |
| 137 |
flag_coarray == GFC_FCOARRAY_LIB |
| 138 |
? get_int_kind_from_node (ptr_type_node) |
| 139 |
: gfc_default_integer_kind, GFC_STD_F2018) |
| 140 |
|
| 141 |
NAMED_INTCST (ISOFORTRANENV_LOGICAL8, "logical8", \ |
| 142 |
gfc_get_int_kind_from_width_isofortranenv (8), GFC_STD_F2023) |
| 143 |
NAMED_INTCST (ISOFORTRANENV_LOGICAL16, "logical16", \ |
| 144 |
gfc_get_int_kind_from_width_isofortranenv (16), GFC_STD_F2023) |
| 145 |
NAMED_INTCST (ISOFORTRANENV_LOGICAL32, "logical32", \ |
| 146 |
gfc_get_int_kind_from_width_isofortranenv (32), GFC_STD_F2023) |
| 147 |
NAMED_INTCST (ISOFORTRANENV_LOGICAL64, "logical64", \ |
| 148 |
gfc_get_int_kind_from_width_isofortranenv (64), GFC_STD_F2023) |
| 149 |
NAMED_INTCST (ISOFORTRANENV_REAL16, "real16", \ |
| 150 |
gfc_get_real_kind_from_width_isofortranenv (16), GFC_STD_F2023) |
| 151 |
|
| 152 |
NAMED_UINTCST (ISOFORTRANENV_UINT8, "uint8", \ |
| 153 |
gfc_get_uint_kind_from_width_isofortranenv (8), GFC_STD_UNSIGNED) |
| 154 |
NAMED_UINTCST (ISOFORTRANENV_UINT16, "uint16", \ |
| 155 |
gfc_get_uint_kind_from_width_isofortranenv (16), GFC_STD_UNSIGNED) |
| 156 |
NAMED_UINTCST (ISOFORTRANENV_UINT32, "uint32", \ |
| 157 |
gfc_get_uint_kind_from_width_isofortranenv (32), GFC_STD_UNSIGNED) |
| 158 |
NAMED_UINTCST (ISOFORTRANENV_UINT64, "uint64", \ |
| 159 |
gfc_get_uint_kind_from_width_isofortranenv (64), GFC_STD_UNSIGNED) |
| 160 |
|
| 161 |
#undef NAMED_INTCST |
| 162 |
#undef NAMED_UINTCST |
| 163 |
#undef NAMED_KINDARRAY |
| 164 |
#undef NAMED_FUNCTION |
| 165 |
#undef NAMED_SUBROUTINE |
| 166 |
#undef NAMED_DERIVED_TYPE |