]>
Commit | Line | Data |
---|---|---|
4c4b3eb0 | 1 | /* Common declarations for all of libgfortran. |
a945c346 | 2 | Copyright (C) 2002-2024 Free Software Foundation, Inc. |
6de9cd9a DN |
3 | Contributed by Paul Brook <paul@nowt.org>, and |
4 | Andy Vaught <andy@xena.eas.asu.edu> | |
5 | ||
bb408e87 | 6 | This file is part of the GNU Fortran runtime library (libgfortran). |
6de9cd9a | 7 | |
748086b7 JJ |
8 | Libgfortran is free software; you can redistribute it and/or modify |
9 | it under the terms of the GNU General Public License as published by | |
10 | the Free Software Foundation; either version 3, or (at your option) | |
11 | any later version. | |
6de9cd9a | 12 | |
57dea9f6 | 13 | Libgfortran is distributed in the hope that it will be useful, |
6de9cd9a DN |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
748086b7 | 16 | GNU General Public License for more details. |
6de9cd9a | 17 | |
748086b7 JJ |
18 | Under Section 7 of GPL version 3, you are granted additional |
19 | permissions described in the GCC Runtime Library Exception, version | |
20 | 3.1, as published by the Free Software Foundation. | |
57dea9f6 | 21 | |
748086b7 JJ |
22 | You should have received a copy of the GNU General Public License and |
23 | a copy of the GCC Runtime Library Exception along with this program; | |
24 | see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | |
25 | <http://www.gnu.org/licenses/>. */ | |
6de9cd9a DN |
26 | |
27 | #ifndef LIBGFOR_H | |
28 | #define LIBGFOR_H | |
29 | ||
196c8bc8 KT |
30 | /* Ensure that ANSI conform stdio is used. This needs to be set before |
31 | any system header file is included. */ | |
32 | #if defined __MINGW32__ | |
33 | # define _POSIX 1 | |
34 | # define gfc_printf gnu_printf | |
35 | #else | |
36 | # define gfc_printf __printf__ | |
37 | #endif | |
38 | ||
200809cb DE |
39 | /* config.h MUST be first because it can affect system headers. */ |
40 | #include "config.h" | |
41 | ||
21423a1d | 42 | #include <ctype.h> |
d8163f5c | 43 | #include <stdio.h> |
887d9b8b | 44 | #include <stdlib.h> |
6de9cd9a | 45 | #include <stddef.h> |
cdc5524f | 46 | #include <float.h> |
7f763922 | 47 | #include <stdarg.h> |
f5e3ed2d | 48 | #include <stdbool.h> |
6de9cd9a | 49 | |
62755fd5 TG |
50 | #if HAVE_COMPLEX_H |
51 | /* Must appear before math.h on VMS systems. */ | |
52 | # include <complex.h> | |
53 | #else | |
54 | #define complex __complex__ | |
55 | #endif | |
56 | ||
57 | #include <math.h> | |
58 | ||
1ec601bf FXC |
59 | /* If we're support quad-precision floating-point type, include the |
60 | header to our support library. */ | |
133d0d42 JJ |
61 | #if defined(HAVE_FLOAT128) && !defined(USE_IEC_60559) |
62 | # include "quadmath_weak.h" | |
1ec601bf FXC |
63 | #endif |
64 | ||
196c8bc8 KT |
65 | #ifdef __MINGW32__ |
66 | extern float __strtof (const char *, char **); | |
67 | #define gfc_strtof __strtof | |
68 | extern double __strtod (const char *, char **); | |
69 | #define gfc_strtod __strtod | |
70 | extern long double __strtold (const char *, char **); | |
71 | #define gfc_strtold __strtold | |
72 | #else | |
73 | #define gfc_strtof strtof | |
74 | #define gfc_strtod strtod | |
75 | #define gfc_strtold strtold | |
76 | #endif | |
77 | ||
d74b97cc FXC |
78 | #include "../gcc/fortran/libgfortran.h" |
79 | ||
1409cd0b FXC |
80 | #include "c99_protos.h" |
81 | ||
6e4d9244 EB |
82 | #if HAVE_IEEEFP_H |
83 | #include <ieeefp.h> | |
84 | #endif | |
85 | ||
4c4b3eb0 | 86 | #include "gstdint.h" |
3969c39f | 87 | |
6de9cd9a DN |
88 | #if HAVE_SYS_TYPES_H |
89 | #include <sys/types.h> | |
90 | #endif | |
a4384bad | 91 | |
edaaef60 JB |
92 | #ifdef HAVE_SYS_UIO_H |
93 | #include <sys/uio.h> | |
94 | #endif | |
95 | ||
a4384bad JB |
96 | #ifdef __MINGW32__ |
97 | typedef off64_t gfc_offset; | |
98 | #else | |
81f4be3c | 99 | typedef off_t gfc_offset; |
a4384bad | 100 | #endif |
6de9cd9a DN |
101 | |
102 | #ifndef NULL | |
103 | #define NULL (void *) 0 | |
104 | #endif | |
105 | ||
49ad4d2c | 106 | #if defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ \ |
7c3b9c17 JJ |
107 | && defined __GLIBC_PREREQ |
108 | #if __GLIBC_PREREQ (2, 32) | |
49ad4d2c TK |
109 | #define POWER_IEEE128 1 |
110 | #endif | |
7c3b9c17 | 111 | #endif |
433d6b39 | 112 | |
21423a1d FXC |
113 | /* These functions from <ctype.h> should only be used on values that can be |
114 | represented as unsigned char, otherwise the behavior is undefined. | |
115 | Some targets have a char type that is signed, so we cast the argument | |
116 | to unsigned char. See: | |
117 | https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177 | |
118 | https://wiki.sei.cmu.edu/confluence/x/BNcxBQ | |
119 | */ | |
120 | ||
121 | #define safe_isalnum(x) isalnum((unsigned char) (x)) | |
122 | #define safe_isdigit(x) isdigit((unsigned char) (x)) | |
123 | #define safe_tolower(x) tolower((unsigned char) (x)) | |
124 | #define safe_toupper(x) toupper((unsigned char) (x)) | |
125 | ||
126 | ||
433d6b39 TB |
127 | /* The following macros can be used to annotate conditions which are likely or |
128 | unlikely to be true. Avoid using them when a condition is only slightly | |
129 | more likely/less unlikely than average to avoid the performance penalties of | |
130 | branch misprediction. In addition, as __builtin_expect overrides the compiler | |
131 | heuristic, do not use in conditions where one of the branches ends with a | |
132 | call to a function with __attribute__((noreturn)): the compiler internal | |
133 | heuristic will mark this branch as much less likely as unlikely() would | |
134 | do. */ | |
135 | ||
9731c4a3 TB |
136 | #define likely(x) __builtin_expect(!!(x), 1) |
137 | #define unlikely(x) __builtin_expect(!!(x), 0) | |
6de9cd9a | 138 | |
20305b50 TK |
139 | /* This macro can be used to annotate conditions which we know to |
140 | be true, so that the compiler can optimize based on the condition. */ | |
141 | ||
142 | #define GFC_ASSERT(EXPR) \ | |
143 | ((void)(__builtin_expect (!(EXPR), 0) ? __builtin_unreachable (), 0 : 0)) | |
0dce3ca1 | 144 | |
44720bef JB |
145 | /* Make sure we have ptrdiff_t. */ |
146 | #ifndef HAVE_PTRDIFF_T | |
147 | typedef intptr_t ptrdiff_t; | |
c7d0f4d5 TK |
148 | #endif |
149 | ||
db8092dc FXC |
150 | /* On mingw, work around the buggy Windows snprintf() by using the one |
151 | mingw provides, __mingw_snprintf(). We also provide a prototype for | |
152 | __mingw_snprintf(), because the mingw headers currently don't have one. */ | |
153 | #if HAVE_MINGW_SNPRINTF | |
9731c4a3 | 154 | extern int __mingw_snprintf (char *, size_t, const char *, ...) |
6a21bcbe | 155 | __attribute__ ((format (gnu_printf, 3, 4))); |
db8092dc FXC |
156 | #undef snprintf |
157 | #define snprintf __mingw_snprintf | |
d30fe1c5 JB |
158 | /* Fallback to sprintf if target does not have snprintf. */ |
159 | #elif !defined(HAVE_SNPRINTF) | |
160 | #undef snprintf | |
161 | #define snprintf(str, size, ...) sprintf (str, __VA_ARGS__) | |
db8092dc FXC |
162 | #endif |
163 | ||
164 | ||
7d7b8bfe RH |
165 | /* For a library, a standard prefix is a requirement in order to partition |
166 | the namespace. IPREFIX is for symbols intended to be internal to the | |
167 | library. */ | |
168 | #define PREFIX(x) _gfortran_ ## x | |
169 | #define IPREFIX(x) _gfortrani_ ## x | |
170 | ||
171 | /* Magic to rename a symbol at the compiler level. You continue to refer | |
172 | to the symbol as OLD in the source, but it'll be named NEW in the asm. */ | |
173 | #define sym_rename(old, new) sym_rename1(old, __USER_LABEL_PREFIX__, new) | |
174 | #define sym_rename1(old, ulp, new) sym_rename2(old, ulp, new) | |
175 | #define sym_rename2(old, ulp, new) extern __typeof(old) old __asm__(#ulp #new) | |
176 | ||
177 | /* There are several classifications of routines: | |
178 | ||
179 | (1) Symbols used only within the library, | |
180 | (2) Symbols to be exported from the library, | |
181 | (3) Symbols to be exported from the library, but | |
182 | also used inside the library. | |
183 | ||
184 | By telling the compiler about these different classifications we can | |
185 | tightly control the interface seen by the user, and get better code | |
186 | from the compiler at the same time. | |
187 | ||
188 | One of the following should be used immediately after the declaration | |
189 | of each symbol: | |
190 | ||
191 | internal_proto Marks a symbol used only within the library, | |
192 | and adds IPREFIX to the assembly-level symbol | |
193 | name. The later is important for maintaining | |
194 | the namespace partition for the static library. | |
195 | ||
196 | export_proto Marks a symbol to be exported, and adds PREFIX | |
197 | to the assembly-level symbol name. | |
198 | ||
199 | export_proto_np Marks a symbol to be exported without adding PREFIX. | |
200 | ||
201 | iexport_proto Marks a function to be exported, but with the | |
202 | understanding that it can be used inside as well. | |
203 | ||
204 | iexport_data_proto Similarly, marks a data symbol to be exported. | |
205 | Unfortunately, some systems can't play the hidden | |
206 | symbol renaming trick on data symbols, thanks to | |
207 | the horribleness of COPY relocations. | |
208 | ||
209 | If iexport_proto or iexport_data_proto is used, you must also use | |
210 | iexport or iexport_data after the *definition* of the symbol. */ | |
211 | ||
212 | #if defined(HAVE_ATTRIBUTE_VISIBILITY) | |
213 | # define internal_proto(x) \ | |
214 | sym_rename(x, IPREFIX (x)) __attribute__((__visibility__("hidden"))) | |
215 | #else | |
216 | # define internal_proto(x) sym_rename(x, IPREFIX(x)) | |
217 | #endif | |
218 | ||
219 | #if defined(HAVE_ATTRIBUTE_VISIBILITY) && defined(HAVE_ATTRIBUTE_ALIAS) | |
220 | # define export_proto(x) sym_rename(x, PREFIX(x)) | |
221 | # define export_proto_np(x) extern char swallow_semicolon | |
222 | # define iexport_proto(x) internal_proto(x) | |
3075a4cd FXC |
223 | # define iexport(x) iexport1(x, IPREFIX(x)) |
224 | # define iexport1(x,y) iexport2(x,y) | |
225 | # define iexport2(x,y) \ | |
29d24852 | 226 | extern __typeof(x) PREFIX(x) __attribute__((__alias__(#y), __copy__ (x))) |
7d7b8bfe RH |
227 | #else |
228 | # define export_proto(x) sym_rename(x, PREFIX(x)) | |
229 | # define export_proto_np(x) extern char swallow_semicolon | |
230 | # define iexport_proto(x) export_proto(x) | |
231 | # define iexport(x) extern char swallow_semicolon | |
232 | #endif | |
233 | ||
234 | /* TODO: detect the case when we *can* hide the symbol. */ | |
235 | #define iexport_data_proto(x) export_proto(x) | |
236 | #define iexport_data(x) extern char swallow_semicolon | |
6de9cd9a DN |
237 | |
238 | /* The only reliable way to get the offset of a field in a struct | |
239 | in a system independent way is via this macro. */ | |
240 | #ifndef offsetof | |
241 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *) 0)->MEMBER) | |
242 | #endif | |
243 | ||
b1012ca4 FXC |
244 | /* The C99 classification macros isfinite, isinf, isnan, isnormal |
245 | and signbit are broken or inconsistent on quite a few targets. | |
246 | So, we use GCC's builtins instead. | |
e88334a6 | 247 | |
b1012ca4 FXC |
248 | Another advantage for GCC's builtins for these type-generic macros |
249 | is that it handles floating-point types that the system headers | |
5097cdf9 | 250 | may not support (like _Float128). */ |
e88334a6 | 251 | |
118ea208 | 252 | #undef isnan |
b1012ca4 FXC |
253 | #define isnan(x) __builtin_isnan(x) |
254 | #undef isfinite | |
255 | #define isfinite(x) __builtin_isfinite(x) | |
256 | #undef isinf | |
257 | #define isinf(x) __builtin_isinf(x) | |
258 | #undef isnormal | |
259 | #define isnormal(x) __builtin_isnormal(x) | |
260 | #undef signbit | |
261 | #define signbit(x) __builtin_signbit(x) | |
69d3c9a4 | 262 | |
32aa3bff | 263 | #include "kinds.h" |
6de9cd9a | 264 | |
566ffce8 JD |
265 | /* Define the type used for the current record number for large file I/O. |
266 | The size must be consistent with the size defined on the compiler side. */ | |
267 | #ifdef HAVE_GFC_INTEGER_8 | |
91b30ee5 | 268 | typedef GFC_INTEGER_8 GFC_IO_INT; |
566ffce8 JD |
269 | #else |
270 | #ifdef HAVE_GFC_INTEGER_4 | |
91b30ee5 | 271 | typedef GFC_INTEGER_4 GFC_IO_INT; |
566ffce8 JD |
272 | #else |
273 | #error "GFC_INTEGER_4 should be available for the library to compile". | |
274 | #endif | |
275 | #endif | |
276 | ||
da17f559 PB |
277 | /* The following two definitions must be consistent with the types used |
278 | by the compiler. */ | |
279 | /* The type used of array indices, amongst other things. */ | |
44720bef | 280 | typedef ptrdiff_t index_type; |
4b267817 | 281 | |
d7177ab2 | 282 | /* The type used for the lengths of character variables. */ |
f622221a | 283 | typedef size_t gfc_charlen_type; |
6de9cd9a | 284 | |
4b267817 FXC |
285 | /* Definitions of CHARACTER data types: |
286 | - CHARACTER(KIND=1) corresponds to the C char type, | |
287 | - CHARACTER(KIND=4) corresponds to an unsigned 32-bit integer. */ | |
288 | typedef GFC_UINTEGER_4 gfc_char4_t; | |
289 | ||
290 | /* Byte size of character kinds. For the kinds currently supported, it's | |
291 | simply equal to the kind parameter itself. */ | |
292 | #define GFC_SIZE_OF_CHAR_KIND(kind) (kind) | |
293 | ||
28dc6b33 | 294 | #define GFOR_POINTER_TO_L1(p, kind) \ |
5675291d | 295 | ((__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ? 1: 0) * (kind - 1) + (GFC_LOGICAL_1 *)(p)) |
6de9cd9a | 296 | |
567c915b TK |
297 | #define GFC_INTEGER_1_HUGE \ |
298 | (GFC_INTEGER_1)((((GFC_UINTEGER_1)1) << 7) - 1) | |
299 | #define GFC_INTEGER_2_HUGE \ | |
300 | (GFC_INTEGER_2)((((GFC_UINTEGER_2)1) << 15) - 1) | |
6de9cd9a DN |
301 | #define GFC_INTEGER_4_HUGE \ |
302 | (GFC_INTEGER_4)((((GFC_UINTEGER_4)1) << 31) - 1) | |
303 | #define GFC_INTEGER_8_HUGE \ | |
304 | (GFC_INTEGER_8)((((GFC_UINTEGER_8)1) << 63) - 1) | |
644cb69f FXC |
305 | #ifdef HAVE_GFC_INTEGER_16 |
306 | #define GFC_INTEGER_16_HUGE \ | |
307 | (GFC_INTEGER_16)((((GFC_UINTEGER_16)1) << 127) - 1) | |
308 | #endif | |
309 | ||
80927a56 JJ |
310 | /* M{IN,AX}{LOC,VAL} need also infinities and NaNs if supported. */ |
311 | ||
c87cce5a | 312 | #if __FLT_HAS_INFINITY__ |
80927a56 JJ |
313 | # define GFC_REAL_4_INFINITY __builtin_inff () |
314 | #endif | |
c87cce5a | 315 | #if __DBL_HAS_INFINITY__ |
80927a56 JJ |
316 | # define GFC_REAL_8_INFINITY __builtin_inf () |
317 | #endif | |
c87cce5a | 318 | #if __LDBL_HAS_INFINITY__ |
80927a56 JJ |
319 | # ifdef HAVE_GFC_REAL_10 |
320 | # define GFC_REAL_10_INFINITY __builtin_infl () | |
321 | # endif | |
322 | # ifdef HAVE_GFC_REAL_16 | |
1ec601bf FXC |
323 | # ifdef GFC_REAL_16_IS_LONG_DOUBLE |
324 | # define GFC_REAL_16_INFINITY __builtin_infl () | |
133d0d42 JJ |
325 | # elif defined GFC_REAL_16_USE_IEC_60559 |
326 | # define GFC_REAL_16_INFINITY __builtin_inff128 () | |
1ec601bf FXC |
327 | # else |
328 | # define GFC_REAL_16_INFINITY __builtin_infq () | |
329 | # endif | |
80927a56 | 330 | # endif |
5db042b2 JJ |
331 | # ifdef HAVE_GFC_REAL_17 |
332 | # define GFC_REAL_17_INFINITY __builtin_inff128 () | |
333 | # endif | |
80927a56 | 334 | #endif |
c87cce5a | 335 | #if __FLT_HAS_QUIET_NAN__ |
80927a56 JJ |
336 | # define GFC_REAL_4_QUIET_NAN __builtin_nanf ("") |
337 | #endif | |
c87cce5a | 338 | #if __DBL_HAS_QUIET_NAN__ |
80927a56 JJ |
339 | # define GFC_REAL_8_QUIET_NAN __builtin_nan ("") |
340 | #endif | |
c87cce5a | 341 | #if __LDBL_HAS_QUIET_NAN__ |
80927a56 JJ |
342 | # ifdef HAVE_GFC_REAL_10 |
343 | # define GFC_REAL_10_QUIET_NAN __builtin_nanl ("") | |
344 | # endif | |
345 | # ifdef HAVE_GFC_REAL_16 | |
1ec601bf FXC |
346 | # ifdef GFC_REAL_16_IS_LONG_DOUBLE |
347 | # define GFC_REAL_16_QUIET_NAN __builtin_nanl ("") | |
133d0d42 JJ |
348 | # elif defined GFC_REAL_16_USE_IEC_60559 |
349 | # define GFC_REAL_16_QUIET_NAN __builtin_nanf128 ("") | |
1ec601bf FXC |
350 | # else |
351 | # define GFC_REAL_16_QUIET_NAN nanq ("") | |
352 | # endif | |
80927a56 | 353 | # endif |
5db042b2 JJ |
354 | # ifdef HAVE_GFC_REAL_17 |
355 | # define GFC_REAL_17_QUIET_NAN __builtin_nanf128 ("") | |
356 | # endif | |
80927a56 | 357 | #endif |
6de9cd9a DN |
358 | |
359 | typedef struct descriptor_dimension | |
360 | { | |
dfb55fdc | 361 | index_type _stride; |
21d1335b | 362 | index_type lower_bound; |
dfb55fdc | 363 | index_type _ubound; |
6de9cd9a DN |
364 | } |
365 | descriptor_dimension; | |
366 | ||
7fb43006 PT |
367 | typedef struct dtype_type |
368 | { | |
369 | size_t elem_len; | |
370 | int version; | |
371 | signed char rank; | |
372 | signed char type; | |
373 | signed short attribute; | |
374 | } | |
375 | dtype_type; | |
376 | ||
e9bfdf18 | 377 | #define GFC_ARRAY_DESCRIPTOR(type) \ |
6de9cd9a | 378 | struct {\ |
21d1335b | 379 | type *base_addr;\ |
efd4dc1a | 380 | size_t offset;\ |
7fb43006 | 381 | dtype_type dtype;\ |
ff3598bc | 382 | index_type span;\ |
e9bfdf18 | 383 | descriptor_dimension dim[];\ |
6de9cd9a DN |
384 | } |
385 | ||
386 | /* Commonly used array descriptor types. */ | |
e9bfdf18 TK |
387 | typedef GFC_ARRAY_DESCRIPTOR (void) gfc_array_void; |
388 | typedef GFC_ARRAY_DESCRIPTOR (char) gfc_array_char; | |
389 | typedef GFC_ARRAY_DESCRIPTOR (GFC_INTEGER_1) gfc_array_i1; | |
390 | typedef GFC_ARRAY_DESCRIPTOR (GFC_INTEGER_2) gfc_array_i2; | |
391 | typedef GFC_ARRAY_DESCRIPTOR (GFC_INTEGER_4) gfc_array_i4; | |
392 | typedef GFC_ARRAY_DESCRIPTOR (GFC_INTEGER_8) gfc_array_i8; | |
01ce9e31 | 393 | typedef GFC_ARRAY_DESCRIPTOR (index_type) gfc_array_index_type; |
644cb69f | 394 | #ifdef HAVE_GFC_INTEGER_16 |
e9bfdf18 | 395 | typedef GFC_ARRAY_DESCRIPTOR (GFC_INTEGER_16) gfc_array_i16; |
644cb69f | 396 | #endif |
e9bfdf18 TK |
397 | typedef GFC_ARRAY_DESCRIPTOR (GFC_REAL_4) gfc_array_r4; |
398 | typedef GFC_ARRAY_DESCRIPTOR (GFC_REAL_8) gfc_array_r8; | |
644cb69f | 399 | #ifdef HAVE_GFC_REAL_10 |
e9bfdf18 | 400 | typedef GFC_ARRAY_DESCRIPTOR (GFC_REAL_10) gfc_array_r10; |
644cb69f FXC |
401 | #endif |
402 | #ifdef HAVE_GFC_REAL_16 | |
e9bfdf18 | 403 | typedef GFC_ARRAY_DESCRIPTOR (GFC_REAL_16) gfc_array_r16; |
644cb69f | 404 | #endif |
49ad4d2c TK |
405 | #ifdef HAVE_GFC_REAL_17 |
406 | typedef GFC_ARRAY_DESCRIPTOR (GFC_REAL_17) gfc_array_r17; | |
407 | #endif | |
e9bfdf18 TK |
408 | typedef GFC_ARRAY_DESCRIPTOR (GFC_COMPLEX_4) gfc_array_c4; |
409 | typedef GFC_ARRAY_DESCRIPTOR (GFC_COMPLEX_8) gfc_array_c8; | |
644cb69f | 410 | #ifdef HAVE_GFC_COMPLEX_10 |
e9bfdf18 | 411 | typedef GFC_ARRAY_DESCRIPTOR (GFC_COMPLEX_10) gfc_array_c10; |
644cb69f FXC |
412 | #endif |
413 | #ifdef HAVE_GFC_COMPLEX_16 | |
e9bfdf18 | 414 | typedef GFC_ARRAY_DESCRIPTOR (GFC_COMPLEX_16) gfc_array_c16; |
644cb69f | 415 | #endif |
49ad4d2c TK |
416 | #ifdef HAVE_GFC_COMPLEX_17 |
417 | typedef GFC_ARRAY_DESCRIPTOR (GFC_COMPLEX_17) gfc_array_c17; | |
418 | #endif | |
e9bfdf18 TK |
419 | typedef GFC_ARRAY_DESCRIPTOR (GFC_LOGICAL_1) gfc_array_l1; |
420 | typedef GFC_ARRAY_DESCRIPTOR (GFC_LOGICAL_2) gfc_array_l2; | |
421 | typedef GFC_ARRAY_DESCRIPTOR (GFC_LOGICAL_4) gfc_array_l4; | |
422 | typedef GFC_ARRAY_DESCRIPTOR (GFC_LOGICAL_8) gfc_array_l8; | |
644cb69f | 423 | #ifdef HAVE_GFC_LOGICAL_16 |
e9bfdf18 | 424 | typedef GFC_ARRAY_DESCRIPTOR (GFC_LOGICAL_16) gfc_array_l16; |
644cb69f | 425 | #endif |
01ce9e31 TK |
426 | |
427 | typedef GFC_ARRAY_DESCRIPTOR (GFC_UINTEGER_1) gfc_array_s1; | |
428 | typedef GFC_ARRAY_DESCRIPTOR (GFC_UINTEGER_4) gfc_array_s4; | |
6de9cd9a | 429 | |
e9bfdf18 TK |
430 | /* These are for when you actually want to declare a descriptor, as |
431 | opposed to a pointer to it. */ | |
432 | ||
433 | #define GFC_FULL_ARRAY_DESCRIPTOR(r, type) \ | |
434 | struct {\ | |
435 | type *base_addr;\ | |
436 | size_t offset;\ | |
437 | dtype_type dtype;\ | |
438 | index_type span;\ | |
439 | descriptor_dimension dim[r];\ | |
440 | } | |
441 | ||
442 | typedef GFC_FULL_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, GFC_INTEGER_4) gfc_full_array_i4; | |
443 | ||
7fb43006 PT |
444 | #define GFC_DESCRIPTOR_RANK(desc) ((desc)->dtype.rank) |
445 | #define GFC_DESCRIPTOR_TYPE(desc) ((desc)->dtype.type) | |
446 | #define GFC_DESCRIPTOR_SIZE(desc) ((desc)->dtype.elem_len) | |
21d1335b | 447 | #define GFC_DESCRIPTOR_DATA(desc) ((desc)->base_addr) |
6de9cd9a | 448 | #define GFC_DESCRIPTOR_DTYPE(desc) ((desc)->dtype) |
d514626e | 449 | #define GFC_DESCRIPTOR_SPAN(desc) ((desc)->span) |
6de9cd9a | 450 | |
21d1335b | 451 | #define GFC_DIMENSION_LBOUND(dim) ((dim).lower_bound) |
dfb55fdc TK |
452 | #define GFC_DIMENSION_UBOUND(dim) ((dim)._ubound) |
453 | #define GFC_DIMENSION_STRIDE(dim) ((dim)._stride) | |
21d1335b | 454 | #define GFC_DIMENSION_EXTENT(dim) ((dim)._ubound + 1 - (dim).lower_bound) |
dfb55fdc TK |
455 | #define GFC_DIMENSION_SET(dim,lb,ub,str) \ |
456 | do \ | |
457 | { \ | |
21d1335b | 458 | (dim).lower_bound = lb; \ |
dfb55fdc TK |
459 | (dim)._ubound = ub; \ |
460 | (dim)._stride = str; \ | |
461 | } while (0) | |
462 | ||
463 | ||
21d1335b | 464 | #define GFC_DESCRIPTOR_LBOUND(desc,i) ((desc)->dim[i].lower_bound) |
dfb55fdc TK |
465 | #define GFC_DESCRIPTOR_UBOUND(desc,i) ((desc)->dim[i]._ubound) |
466 | #define GFC_DESCRIPTOR_EXTENT(desc,i) ((desc)->dim[i]._ubound + 1 \ | |
21d1335b | 467 | - (desc)->dim[i].lower_bound) |
dfb55fdc TK |
468 | #define GFC_DESCRIPTOR_EXTENT_BYTES(desc,i) \ |
469 | (GFC_DESCRIPTOR_EXTENT(desc,i) * GFC_DESCRIPTOR_SIZE(desc)) | |
470 | ||
471 | #define GFC_DESCRIPTOR_STRIDE(desc,i) ((desc)->dim[i]._stride) | |
472 | #define GFC_DESCRIPTOR_STRIDE_BYTES(desc,i) \ | |
473 | (GFC_DESCRIPTOR_STRIDE(desc,i) * GFC_DESCRIPTOR_SIZE(desc)) | |
474 | ||
75f2543f TK |
475 | /* Macros to get both the size and the type with a single masking operation */ |
476 | ||
c276d605 | 477 | #define GFC_DTYPE_SIZE_MASK (-((index_type) 1 << GFC_DTYPE_SIZE_SHIFT)) |
75f2543f TK |
478 | #define GFC_DTYPE_TYPE_SIZE_MASK (GFC_DTYPE_SIZE_MASK | GFC_DTYPE_TYPE_MASK) |
479 | ||
7fb43006 PT |
480 | #define GFC_DTYPE_TYPE_SIZE(desc) (( ((desc)->dtype.type << GFC_DTYPE_TYPE_SHIFT) \ |
481 | | ((desc)->dtype.elem_len << GFC_DTYPE_SIZE_SHIFT) ) & GFC_DTYPE_TYPE_SIZE_MASK) | |
75f2543f | 482 | |
fa3c4d47 TK |
483 | /* Macros to set size and type information. */ |
484 | ||
485 | #define GFC_DTYPE_COPY(a,b) do { (a)->dtype = (b)->dtype; } while(0) | |
7fb43006 PT |
486 | #define GFC_DTYPE_IS_UNSET(a) (unlikely((a)->dtype.elem_len == 0)) |
487 | #define GFC_DTYPE_CLEAR(a) do { (a)->dtype.elem_len = 0; \ | |
488 | (a)->dtype.version = 0; \ | |
489 | (a)->dtype.rank = 0; \ | |
490 | (a)->dtype.type = 0; \ | |
491 | (a)->dtype.attribute = 0; \ | |
492 | } while(0) | |
fa3c4d47 | 493 | |
a11930ba | 494 | #define GFC_DTYPE_INTEGER_1 ((BT_INTEGER << GFC_DTYPE_TYPE_SHIFT) \ |
75f2543f | 495 | | (sizeof(GFC_INTEGER_1) << GFC_DTYPE_SIZE_SHIFT)) |
a11930ba | 496 | #define GFC_DTYPE_INTEGER_2 ((BT_INTEGER << GFC_DTYPE_TYPE_SHIFT) \ |
75f2543f | 497 | | (sizeof(GFC_INTEGER_2) << GFC_DTYPE_SIZE_SHIFT)) |
a11930ba | 498 | #define GFC_DTYPE_INTEGER_4 ((BT_INTEGER << GFC_DTYPE_TYPE_SHIFT) \ |
75f2543f | 499 | | (sizeof(GFC_INTEGER_4) << GFC_DTYPE_SIZE_SHIFT)) |
a11930ba | 500 | #define GFC_DTYPE_INTEGER_8 ((BT_INTEGER << GFC_DTYPE_TYPE_SHIFT) \ |
75f2543f TK |
501 | | (sizeof(GFC_INTEGER_8) << GFC_DTYPE_SIZE_SHIFT)) |
502 | #ifdef HAVE_GFC_INTEGER_16 | |
a11930ba | 503 | #define GFC_DTYPE_INTEGER_16 ((BT_INTEGER << GFC_DTYPE_TYPE_SHIFT) \ |
75f2543f TK |
504 | | (sizeof(GFC_INTEGER_16) << GFC_DTYPE_SIZE_SHIFT)) |
505 | #endif | |
506 | ||
a11930ba | 507 | #define GFC_DTYPE_LOGICAL_1 ((BT_LOGICAL << GFC_DTYPE_TYPE_SHIFT) \ |
75f2543f | 508 | | (sizeof(GFC_LOGICAL_1) << GFC_DTYPE_SIZE_SHIFT)) |
a11930ba | 509 | #define GFC_DTYPE_LOGICAL_2 ((BT_LOGICAL << GFC_DTYPE_TYPE_SHIFT) \ |
75f2543f | 510 | | (sizeof(GFC_LOGICAL_2) << GFC_DTYPE_SIZE_SHIFT)) |
a11930ba | 511 | #define GFC_DTYPE_LOGICAL_4 ((BT_LOGICAL << GFC_DTYPE_TYPE_SHIFT) \ |
75f2543f | 512 | | (sizeof(GFC_LOGICAL_4) << GFC_DTYPE_SIZE_SHIFT)) |
a11930ba | 513 | #define GFC_DTYPE_LOGICAL_8 ((BT_LOGICAL << GFC_DTYPE_TYPE_SHIFT) \ |
75f2543f TK |
514 | | (sizeof(GFC_LOGICAL_8) << GFC_DTYPE_SIZE_SHIFT)) |
515 | #ifdef HAVE_GFC_LOGICAL_16 | |
a11930ba | 516 | #define GFC_DTYPE_LOGICAL_16 ((BT_LOGICAL << GFC_DTYPE_TYPE_SHIFT) \ |
75f2543f TK |
517 | | (sizeof(GFC_LOGICAL_16) << GFC_DTYPE_SIZE_SHIFT)) |
518 | #endif | |
519 | ||
a11930ba | 520 | #define GFC_DTYPE_REAL_4 ((BT_REAL << GFC_DTYPE_TYPE_SHIFT) \ |
75f2543f | 521 | | (sizeof(GFC_REAL_4) << GFC_DTYPE_SIZE_SHIFT)) |
a11930ba | 522 | #define GFC_DTYPE_REAL_8 ((BT_REAL << GFC_DTYPE_TYPE_SHIFT) \ |
75f2543f TK |
523 | | (sizeof(GFC_REAL_8) << GFC_DTYPE_SIZE_SHIFT)) |
524 | #ifdef HAVE_GFC_REAL_10 | |
a11930ba | 525 | #define GFC_DTYPE_REAL_10 ((BT_REAL << GFC_DTYPE_TYPE_SHIFT) \ |
75f2543f TK |
526 | | (sizeof(GFC_REAL_10) << GFC_DTYPE_SIZE_SHIFT)) |
527 | #endif | |
528 | #ifdef HAVE_GFC_REAL_16 | |
a11930ba | 529 | #define GFC_DTYPE_REAL_16 ((BT_REAL << GFC_DTYPE_TYPE_SHIFT) \ |
75f2543f TK |
530 | | (sizeof(GFC_REAL_16) << GFC_DTYPE_SIZE_SHIFT)) |
531 | #endif | |
49ad4d2c TK |
532 | #ifdef HAVE_GFC_REAL_17 |
533 | #define GFC_DTYPE_REAL_17 ((BT_REAL << GFC_DTYPE_TYPE_SHIFT) \ | |
534 | | (sizeof(GFC_REAL_17) << GFC_DTYPE_SIZE_SHIFT)) | |
535 | #endif | |
75f2543f | 536 | |
a11930ba | 537 | #define GFC_DTYPE_COMPLEX_4 ((BT_COMPLEX << GFC_DTYPE_TYPE_SHIFT) \ |
75f2543f | 538 | | (sizeof(GFC_COMPLEX_4) << GFC_DTYPE_SIZE_SHIFT)) |
a11930ba | 539 | #define GFC_DTYPE_COMPLEX_8 ((BT_COMPLEX << GFC_DTYPE_TYPE_SHIFT) \ |
75f2543f TK |
540 | | (sizeof(GFC_COMPLEX_8) << GFC_DTYPE_SIZE_SHIFT)) |
541 | #ifdef HAVE_GFC_COMPLEX_10 | |
a11930ba | 542 | #define GFC_DTYPE_COMPLEX_10 ((BT_COMPLEX << GFC_DTYPE_TYPE_SHIFT) \ |
75f2543f TK |
543 | | (sizeof(GFC_COMPLEX_10) << GFC_DTYPE_SIZE_SHIFT)) |
544 | #endif | |
545 | #ifdef HAVE_GFC_COMPLEX_16 | |
a11930ba | 546 | #define GFC_DTYPE_COMPLEX_16 ((BT_COMPLEX << GFC_DTYPE_TYPE_SHIFT) \ |
75f2543f TK |
547 | | (sizeof(GFC_COMPLEX_16) << GFC_DTYPE_SIZE_SHIFT)) |
548 | #endif | |
49ad4d2c TK |
549 | #ifdef HAVE_GFC_COMPLEX_17 |
550 | #define GFC_DTYPE_COMPLEX_17 ((BT_COMPLEX << GFC_DTYPE_TYPE_SHIFT) \ | |
551 | | (sizeof(GFC_COMPLEX_17) << GFC_DTYPE_SIZE_SHIFT)) | |
552 | #endif | |
75f2543f | 553 | |
c7d0f4d5 TK |
554 | /* Macros to determine the alignment of pointers. */ |
555 | ||
556 | #define GFC_UNALIGNED_2(x) (((uintptr_t)(x)) & \ | |
557 | (__alignof__(GFC_INTEGER_2) - 1)) | |
558 | #define GFC_UNALIGNED_4(x) (((uintptr_t)(x)) & \ | |
559 | (__alignof__(GFC_INTEGER_4) - 1)) | |
560 | #define GFC_UNALIGNED_8(x) (((uintptr_t)(x)) & \ | |
561 | (__alignof__(GFC_INTEGER_8) - 1)) | |
562 | #ifdef HAVE_GFC_INTEGER_16 | |
563 | #define GFC_UNALIGNED_16(x) (((uintptr_t)(x)) & \ | |
564 | (__alignof__(GFC_INTEGER_16) - 1)) | |
565 | #endif | |
566 | ||
c2b00cdc TK |
567 | #define GFC_UNALIGNED_C4(x) (((uintptr_t)(x)) & \ |
568 | (__alignof__(GFC_COMPLEX_4) - 1)) | |
569 | ||
570 | #define GFC_UNALIGNED_C8(x) (((uintptr_t)(x)) & \ | |
571 | (__alignof__(GFC_COMPLEX_8) - 1)) | |
572 | ||
6de9cd9a DN |
573 | /* Runtime library include. */ |
574 | #define stringize(x) expand_macro(x) | |
575 | #define expand_macro(x) # x | |
576 | ||
577 | /* Runtime options structure. */ | |
578 | ||
579 | typedef struct | |
580 | { | |
fbac3363 | 581 | int stdin_unit, stdout_unit, stderr_unit, optional_plus; |
6de9cd9a DN |
582 | int locus; |
583 | ||
584 | int separator_len; | |
585 | const char *separator; | |
586 | ||
67c24a8b | 587 | int all_unbuffered, unbuffered_preconnected; |
de8bd142 | 588 | int fpe, backtrace; |
c37b0163 | 589 | int unformatted_buffer_size, formatted_buffer_size; |
6de9cd9a DN |
590 | } |
591 | options_t; | |
592 | ||
6de9cd9a | 593 | extern options_t options; |
7d7b8bfe | 594 | internal_proto(options); |
6de9cd9a | 595 | |
de8bd142 JB |
596 | extern void backtrace_handler (int); |
597 | internal_proto(backtrace_handler); | |
2b840e50 | 598 | |
6de9cd9a | 599 | |
8b67b708 FXC |
600 | /* Compile-time options that will influence the library. */ |
601 | ||
602 | typedef struct | |
603 | { | |
604 | int warn_std; | |
605 | int allow_std; | |
5f8f5313 | 606 | int pedantic; |
eaa90d25 | 607 | int convert; |
868d75db | 608 | int backtrace; |
2bb6de3a | 609 | int sign_zero; |
d67ab5ee | 610 | size_t record_marker; |
07b3bbf2 | 611 | int max_subrecord_length; |
bdcfceb4 | 612 | int bounds_check; |
fa86f4f9 | 613 | int fpe_summary; |
8b67b708 FXC |
614 | } |
615 | compile_options_t; | |
616 | ||
617 | extern compile_options_t compile_options; | |
618 | internal_proto(compile_options); | |
619 | ||
e55a7487 AJ |
620 | extern void init_compile_options (void); |
621 | internal_proto(init_compile_options); | |
8b67b708 | 622 | |
07b3bbf2 | 623 | #define GFC_MAX_SUBRECORD_LENGTH 2147483639 /* 2**31 - 9 */ |
8b67b708 | 624 | |
6de9cd9a DN |
625 | /* Structure for statement options. */ |
626 | ||
627 | typedef struct | |
628 | { | |
629 | const char *name; | |
630 | int value; | |
631 | } | |
632 | st_option; | |
633 | ||
8b67b708 | 634 | |
8f0d39a8 FXC |
635 | /* This is returned by notification_std to know if, given the flags |
636 | that were given (-std=, -pedantic) we should issue an error, a warning | |
637 | or nothing. */ | |
638 | typedef enum | |
b2ef02df | 639 | { NOTIFICATION_SILENT, NOTIFICATION_WARNING, NOTIFICATION_ERROR } |
8f0d39a8 FXC |
640 | notification; |
641 | ||
2e444427 | 642 | |
6de9cd9a DN |
643 | /* The filename and line number don't go inside the globals structure. |
644 | They are set by the rest of the program and must be linked to. */ | |
645 | ||
7d7b8bfe RH |
646 | /* Location of the current library call (optional). */ |
647 | extern unsigned line; | |
648 | iexport_data_proto(line); | |
6de9cd9a | 649 | |
6de9cd9a | 650 | extern char *filename; |
7d7b8bfe | 651 | iexport_data_proto(filename); |
6de9cd9a DN |
652 | |
653 | ||
0dce3ca1 FXC |
654 | #define CHARACTER2(name) \ |
655 | gfc_charlen_type name ## _len; \ | |
656 | char * name | |
657 | ||
658 | typedef struct st_parameter_common | |
659 | { | |
660 | GFC_INTEGER_4 flags; | |
661 | GFC_INTEGER_4 unit; | |
662 | const char *filename; | |
663 | GFC_INTEGER_4 line; | |
664 | CHARACTER2 (iomsg); | |
665 | GFC_INTEGER_4 *iostat; | |
666 | } | |
667 | st_parameter_common; | |
668 | ||
669 | #undef CHARACTER2 | |
670 | ||
671 | #define IOPARM_LIBRETURN_MASK (3 << 0) | |
672 | #define IOPARM_LIBRETURN_OK (0 << 0) | |
673 | #define IOPARM_LIBRETURN_ERROR (1 << 0) | |
674 | #define IOPARM_LIBRETURN_END (2 << 0) | |
675 | #define IOPARM_LIBRETURN_EOR (3 << 0) | |
676 | #define IOPARM_ERR (1 << 2) | |
677 | #define IOPARM_END (1 << 3) | |
678 | #define IOPARM_EOR (1 << 4) | |
679 | #define IOPARM_HAS_IOSTAT (1 << 5) | |
680 | #define IOPARM_HAS_IOMSG (1 << 6) | |
681 | ||
682 | #define IOPARM_COMMON_MASK ((1 << 7) - 1) | |
683 | ||
0ef33d44 | 684 | /* Make sure to keep in sync with io/io.h (st_parameter_open). */ |
0dce3ca1 FXC |
685 | #define IOPARM_OPEN_HAS_RECL_IN (1 << 7) |
686 | #define IOPARM_OPEN_HAS_FILE (1 << 8) | |
687 | #define IOPARM_OPEN_HAS_STATUS (1 << 9) | |
688 | #define IOPARM_OPEN_HAS_ACCESS (1 << 10) | |
689 | #define IOPARM_OPEN_HAS_FORM (1 << 11) | |
690 | #define IOPARM_OPEN_HAS_BLANK (1 << 12) | |
691 | #define IOPARM_OPEN_HAS_POSITION (1 << 13) | |
692 | #define IOPARM_OPEN_HAS_ACTION (1 << 14) | |
693 | #define IOPARM_OPEN_HAS_DELIM (1 << 15) | |
694 | #define IOPARM_OPEN_HAS_PAD (1 << 16) | |
695 | #define IOPARM_OPEN_HAS_CONVERT (1 << 17) | |
10256cbe JD |
696 | #define IOPARM_OPEN_HAS_DECIMAL (1 << 18) |
697 | #define IOPARM_OPEN_HAS_ENCODING (1 << 19) | |
698 | #define IOPARM_OPEN_HAS_ROUND (1 << 20) | |
699 | #define IOPARM_OPEN_HAS_SIGN (1 << 21) | |
700 | #define IOPARM_OPEN_HAS_ASYNCHRONOUS (1 << 22) | |
dcfddbd4 | 701 | #define IOPARM_OPEN_HAS_NEWUNIT (1 << 23) |
0ef33d44 FR |
702 | #define IOPARM_OPEN_HAS_READONLY (1 << 24) |
703 | #define IOPARM_OPEN_HAS_CC (1 << 25) | |
704 | #define IOPARM_OPEN_HAS_SHARE (1 << 26) | |
0dce3ca1 | 705 | |
cb13c288 JD |
706 | /* library start function and end macro. These can be expanded if needed |
707 | in the future. cmp is st_parameter_common *cmp */ | |
f2ae4b2b | 708 | |
0dce3ca1 | 709 | extern void library_start (st_parameter_common *); |
7d7b8bfe | 710 | internal_proto(library_start); |
6de9cd9a | 711 | |
5e805e44 | 712 | #define library_end() |
6de9cd9a | 713 | |
cb13c288 JD |
714 | /* main.c */ |
715 | ||
716 | extern void stupid_function_name_for_static_linking (void); | |
717 | internal_proto(stupid_function_name_for_static_linking); | |
718 | ||
7d7b8bfe | 719 | extern void set_args (int, char **); |
fa10ccb2 | 720 | iexport_proto(set_args); |
6de9cd9a | 721 | |
7d7b8bfe RH |
722 | extern void get_args (int *, char ***); |
723 | internal_proto(get_args); | |
6de9cd9a | 724 | |
868d75db FXC |
725 | /* backtrace.c */ |
726 | ||
1b0b9fcb | 727 | extern void show_backtrace (bool); |
ad4f95e3 FXC |
728 | internal_proto(show_backtrace); |
729 | ||
868d75db | 730 | |
6de9cd9a | 731 | /* error.c */ |
6de9cd9a | 732 | |
486024b1 JD |
733 | #if defined(HAVE_GFC_REAL_16) |
734 | #define GFC_LARGEST_BUF (sizeof (GFC_REAL_16)) | |
b2ef02df KT |
735 | #elif defined(HAVE_GFC_INTEGER_16) |
736 | #define GFC_LARGEST_BUF (sizeof (GFC_INTEGER_LARGEST)) | |
486024b1 JD |
737 | #elif defined(HAVE_GFC_REAL_10) |
738 | #define GFC_LARGEST_BUF (sizeof (GFC_REAL_10)) | |
739 | #else | |
740 | #define GFC_LARGEST_BUF (sizeof (GFC_INTEGER_LARGEST)) | |
741 | #endif | |
742 | ||
4ae906e4 | 743 | #define GFC_ITOA_BUF_SIZE (sizeof (GFC_INTEGER_LARGEST) * 3 + 1) |
486024b1 JD |
744 | #define GFC_XTOA_BUF_SIZE (GFC_LARGEST_BUF * 2 + 1) |
745 | #define GFC_OTOA_BUF_SIZE (GFC_LARGEST_BUF * 3 + 1) | |
746 | #define GFC_BTOA_BUF_SIZE (GFC_LARGEST_BUF * 8 + 1) | |
1449b8cb | 747 | |
77777b33 | 748 | extern _Noreturn void sys_abort (void); |
de8bd142 | 749 | internal_proto(sys_abort); |
eedeea04 | 750 | |
71cda9ca JB |
751 | extern _Noreturn void exit_error (int); |
752 | internal_proto(exit_error); | |
753 | ||
1028b2bd JB |
754 | extern ssize_t estr_write (const char *); |
755 | internal_proto(estr_write); | |
756 | ||
edaaef60 JB |
757 | #if !defined(HAVE_WRITEV) && !defined(HAVE_SYS_UIO_H) |
758 | struct iovec { | |
759 | void *iov_base; /* Starting address */ | |
760 | size_t iov_len; /* Number of bytes to transfer */ | |
761 | }; | |
762 | #endif | |
763 | ||
764 | extern ssize_t estr_writev (const struct iovec *iov, int iovcnt); | |
765 | internal_proto(estr_writev); | |
1028b2bd JB |
766 | |
767 | extern int st_printf (const char *, ...) | |
768 | __attribute__((format (gfc_printf, 1, 2))); | |
769 | internal_proto(st_printf); | |
770 | ||
77777b33 | 771 | extern _Noreturn void os_error (const char *); |
1529b8d9 | 772 | iexport_proto(os_error); |
6de9cd9a | 773 | |
d74a8b05 JB |
774 | extern _Noreturn void os_error_at (const char *, const char *, ...) |
775 | __attribute__ ((format (gfc_printf, 2, 3))); | |
776 | iexport_proto(os_error_at); | |
777 | ||
0dce3ca1 | 778 | extern void show_locus (st_parameter_common *); |
7d7b8bfe | 779 | internal_proto(show_locus); |
6de9cd9a | 780 | |
77777b33 FXC |
781 | extern _Noreturn void runtime_error (const char *, ...) |
782 | __attribute__ ((format (gfc_printf, 1, 2))); | |
7d7b8bfe | 783 | iexport_proto(runtime_error); |
6de9cd9a | 784 | |
77777b33 FXC |
785 | extern _Noreturn void runtime_error_at (const char *, const char *, ...) |
786 | __attribute__ ((format (gfc_printf, 2, 3))); | |
cb13c288 JD |
787 | iexport_proto(runtime_error_at); |
788 | ||
9731c4a3 | 789 | extern void runtime_warning_at (const char *, const char *, ...) |
196c8bc8 | 790 | __attribute__ ((format (gfc_printf, 2, 3))); |
0d52899f TB |
791 | iexport_proto(runtime_warning_at); |
792 | ||
77777b33 | 793 | extern _Noreturn void internal_error (st_parameter_common *, const char *); |
7d7b8bfe | 794 | internal_proto(internal_error); |
6de9cd9a | 795 | |
7d7b8bfe RH |
796 | extern const char *translate_error (int); |
797 | internal_proto(translate_error); | |
6de9cd9a | 798 | |
0dce3ca1 | 799 | extern void generate_error (st_parameter_common *, int, const char *); |
cb13c288 | 800 | iexport_proto(generate_error); |
6de9cd9a | 801 | |
2b4c9065 NK |
802 | extern bool generate_error_common (st_parameter_common *, int, const char *); |
803 | iexport_proto(generate_error_common); | |
804 | ||
fc5f5bb7 JD |
805 | extern void generate_warning (st_parameter_common *, const char *); |
806 | internal_proto(generate_warning); | |
807 | ||
f5e3ed2d | 808 | extern bool notify_std (st_parameter_common *, int, const char *); |
2e444427 JD |
809 | internal_proto(notify_std); |
810 | ||
0dce3ca1 FXC |
811 | extern notification notification_std(int); |
812 | internal_proto(notification_std); | |
813 | ||
723553bd JB |
814 | extern char *gf_strerror (int, char *, size_t); |
815 | internal_proto(gf_strerror); | |
816 | ||
944b8b35 FXC |
817 | /* fpu.c */ |
818 | ||
819 | extern void set_fpu (void); | |
820 | internal_proto(set_fpu); | |
82a4f54c | 821 | |
8b198102 FXC |
822 | extern int get_fpu_trap_exceptions (void); |
823 | internal_proto(get_fpu_trap_exceptions); | |
824 | ||
825 | extern void set_fpu_trap_exceptions (int, int); | |
826 | internal_proto(set_fpu_trap_exceptions); | |
827 | ||
828 | extern int support_fpu_trap (int); | |
829 | internal_proto(support_fpu_trap); | |
830 | ||
fa86f4f9 TB |
831 | extern int get_fpu_except_flags (void); |
832 | internal_proto(get_fpu_except_flags); | |
944b8b35 | 833 | |
8b198102 FXC |
834 | extern void set_fpu_except_flags (int, int); |
835 | internal_proto(set_fpu_except_flags); | |
836 | ||
837 | extern int support_fpu_flag (int); | |
838 | internal_proto(support_fpu_flag); | |
839 | ||
840 | extern void set_fpu_rounding_mode (int); | |
82a4f54c TB |
841 | internal_proto(set_fpu_rounding_mode); |
842 | ||
843 | extern int get_fpu_rounding_mode (void); | |
844 | internal_proto(get_fpu_rounding_mode); | |
845 | ||
8b198102 FXC |
846 | extern int support_fpu_rounding_mode (int); |
847 | internal_proto(support_fpu_rounding_mode); | |
848 | ||
849 | extern void get_fpu_state (void *); | |
850 | internal_proto(get_fpu_state); | |
851 | ||
852 | extern void set_fpu_state (void *); | |
853 | internal_proto(set_fpu_state); | |
854 | ||
f5168e47 FXC |
855 | extern int get_fpu_underflow_mode (void); |
856 | internal_proto(get_fpu_underflow_mode); | |
857 | ||
858 | extern void set_fpu_underflow_mode (int); | |
859 | internal_proto(set_fpu_underflow_mode); | |
860 | ||
861 | extern int support_fpu_underflow_control (int); | |
862 | internal_proto(support_fpu_underflow_control); | |
863 | ||
6de9cd9a DN |
864 | /* memory.c */ |
865 | ||
1a0fd3d3 JB |
866 | extern void *xmalloc (size_t) __attribute__ ((malloc)); |
867 | internal_proto(xmalloc); | |
6de9cd9a | 868 | |
92e6f3a4 JB |
869 | extern void *xmallocarray (size_t, size_t) __attribute__ ((malloc)); |
870 | internal_proto(xmallocarray); | |
871 | ||
f4471acb JB |
872 | extern void *xcalloc (size_t, size_t) __attribute__ ((malloc)); |
873 | internal_proto(xcalloc); | |
874 | ||
d74fd3c7 JB |
875 | extern void *xrealloc (void *, size_t); |
876 | internal_proto(xrealloc); | |
f4471acb | 877 | |
6de9cd9a DN |
878 | /* environ.c */ |
879 | ||
7d7b8bfe RH |
880 | extern void init_variables (void); |
881 | internal_proto(init_variables); | |
6de9cd9a | 882 | |
0dce3ca1 FXC |
883 | unit_convert get_unformatted_convert (int); |
884 | internal_proto(get_unformatted_convert); | |
885 | ||
68ee9c08 | 886 | /* Secure getenv() which returns NULL if running as SUID/SGID. */ |
227e441f | 887 | #ifndef HAVE_SECURE_GETENV |
d86e68e2 | 888 | #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) \ |
68ee9c08 JB |
889 | && defined(HAVE_GETGID) && defined(HAVE_GETEGID) |
890 | #define FALLBACK_SECURE_GETENV | |
891 | extern char *secure_getenv (const char *); | |
892 | internal_proto(secure_getenv); | |
893 | #else | |
894 | #define secure_getenv getenv | |
895 | #endif | |
227e441f | 896 | #endif |
68ee9c08 | 897 | |
6de9cd9a DN |
898 | /* string.c */ |
899 | ||
88fdfd5a | 900 | extern int find_option (st_parameter_common *, const char *, gfc_charlen_type, |
5e805e44 | 901 | const st_option *, const char *); |
7d7b8bfe | 902 | internal_proto(find_option); |
6de9cd9a | 903 | |
88fdfd5a | 904 | extern gfc_charlen_type fstrlen (const char *, gfc_charlen_type); |
7d7b8bfe | 905 | internal_proto(fstrlen); |
6de9cd9a | 906 | |
88fdfd5a | 907 | extern gfc_charlen_type fstrcpy (char *, gfc_charlen_type, const char *, gfc_charlen_type); |
7d7b8bfe | 908 | internal_proto(fstrcpy); |
6de9cd9a | 909 | |
88fdfd5a | 910 | extern gfc_charlen_type cf_strcpy (char *, gfc_charlen_type, const char *); |
7d7b8bfe | 911 | internal_proto(cf_strcpy); |
6de9cd9a | 912 | |
79617d7e TK |
913 | extern gfc_charlen_type string_len_trim (gfc_charlen_type, const char *); |
914 | export_proto(string_len_trim); | |
915 | ||
916 | extern gfc_charlen_type string_len_trim_char4 (gfc_charlen_type, | |
917 | const gfc_char4_t *); | |
918 | export_proto(string_len_trim_char4); | |
919 | ||
4269f19c JB |
920 | extern char *fc_strdup(const char *, gfc_charlen_type); |
921 | internal_proto(fc_strdup); | |
922 | ||
581d2326 JB |
923 | extern char *fc_strdup_notrim(const char *, gfc_charlen_type); |
924 | internal_proto(fc_strdup_notrim); | |
925 | ||
4ae906e4 | 926 | extern const char *gfc_itoa(GFC_UINTEGER_LARGEST, char *, size_t); |
1b0b9fcb JB |
927 | internal_proto(gfc_itoa); |
928 | ||
25a5e756 FXC |
929 | /* io/intrinsics.c */ |
930 | ||
931 | extern void flush_all_units (void); | |
932 | internal_proto(flush_all_units); | |
933 | ||
6de9cd9a DN |
934 | /* io.c */ |
935 | ||
7d7b8bfe RH |
936 | extern void init_units (void); |
937 | internal_proto(init_units); | |
6de9cd9a | 938 | |
7d7b8bfe RH |
939 | extern void close_units (void); |
940 | internal_proto(close_units); | |
6de9cd9a | 941 | |
ee4ac5b0 FXC |
942 | extern int unit_to_fd (int); |
943 | internal_proto(unit_to_fd); | |
944 | ||
87557722 JD |
945 | extern char * filename_from_unit (int); |
946 | internal_proto(filename_from_unit); | |
947 | ||
6de9cd9a | 948 | /* stop.c */ |
7d7b8bfe | 949 | |
dffb1e22 | 950 | extern _Noreturn void stop_string (const char *, size_t, bool); |
6d1b0f92 | 951 | export_proto(stop_string); |
6de9cd9a DN |
952 | |
953 | /* reshape_packed.c */ | |
6de9cd9a | 954 | |
7d7b8bfe RH |
955 | extern void reshape_packed (char *, index_type, const char *, index_type, |
956 | const char *, index_type); | |
957 | internal_proto(reshape_packed); | |
6de9cd9a | 958 | |
8e1d7686 TK |
959 | /* Repacking functions. These are called internally by internal_pack |
960 | and internal_unpack. */ | |
961 | ||
962 | GFC_INTEGER_1 *internal_pack_1 (gfc_array_i1 *); | |
963 | internal_proto(internal_pack_1); | |
964 | ||
965 | GFC_INTEGER_2 *internal_pack_2 (gfc_array_i2 *); | |
966 | internal_proto(internal_pack_2); | |
6de9cd9a | 967 | |
6de9cd9a | 968 | GFC_INTEGER_4 *internal_pack_4 (gfc_array_i4 *); |
7d7b8bfe | 969 | internal_proto(internal_pack_4); |
6de9cd9a | 970 | |
6de9cd9a | 971 | GFC_INTEGER_8 *internal_pack_8 (gfc_array_i8 *); |
7d7b8bfe | 972 | internal_proto(internal_pack_8); |
6de9cd9a | 973 | |
0618ee31 | 974 | #if defined HAVE_GFC_INTEGER_16 |
e82726f9 AJ |
975 | GFC_INTEGER_16 *internal_pack_16 (gfc_array_i16 *); |
976 | internal_proto(internal_pack_16); | |
0618ee31 | 977 | #endif |
e82726f9 | 978 | |
8e1d7686 TK |
979 | GFC_REAL_4 *internal_pack_r4 (gfc_array_r4 *); |
980 | internal_proto(internal_pack_r4); | |
981 | ||
982 | GFC_REAL_8 *internal_pack_r8 (gfc_array_r8 *); | |
983 | internal_proto(internal_pack_r8); | |
984 | ||
985 | #if defined HAVE_GFC_REAL_10 | |
986 | GFC_REAL_10 *internal_pack_r10 (gfc_array_r10 *); | |
987 | internal_proto(internal_pack_r10); | |
988 | #endif | |
989 | ||
990 | #if defined HAVE_GFC_REAL_16 | |
991 | GFC_REAL_16 *internal_pack_r16 (gfc_array_r16 *); | |
992 | internal_proto(internal_pack_r16); | |
993 | #endif | |
994 | ||
23d11a0a JJ |
995 | #if defined HAVE_GFC_REAL_17 |
996 | GFC_REAL_17 *internal_pack_r17 (gfc_array_r17 *); | |
997 | internal_proto(internal_pack_r17); | |
998 | #endif | |
999 | ||
39328081 TK |
1000 | GFC_COMPLEX_4 *internal_pack_c4 (gfc_array_c4 *); |
1001 | internal_proto(internal_pack_c4); | |
1002 | ||
1003 | GFC_COMPLEX_8 *internal_pack_c8 (gfc_array_c8 *); | |
1004 | internal_proto(internal_pack_c8); | |
1005 | ||
0618ee31 | 1006 | #if defined HAVE_GFC_COMPLEX_10 |
e82726f9 AJ |
1007 | GFC_COMPLEX_10 *internal_pack_c10 (gfc_array_c10 *); |
1008 | internal_proto(internal_pack_c10); | |
0618ee31 | 1009 | #endif |
e82726f9 | 1010 | |
8e1d7686 TK |
1011 | #if defined HAVE_GFC_COMPLEX_16 |
1012 | GFC_COMPLEX_16 *internal_pack_c16 (gfc_array_c16 *); | |
1013 | internal_proto(internal_pack_c16); | |
1014 | #endif | |
1015 | ||
23d11a0a JJ |
1016 | #if defined HAVE_GFC_COMPLEX_17 |
1017 | GFC_COMPLEX_17 *internal_pack_c17 (gfc_array_c17 *); | |
1018 | internal_proto(internal_pack_c17); | |
1019 | #endif | |
1020 | ||
8e1d7686 TK |
1021 | extern void internal_unpack_1 (gfc_array_i1 *, const GFC_INTEGER_1 *); |
1022 | internal_proto(internal_unpack_1); | |
1023 | ||
1024 | extern void internal_unpack_2 (gfc_array_i2 *, const GFC_INTEGER_2 *); | |
1025 | internal_proto(internal_unpack_2); | |
1026 | ||
7d7b8bfe RH |
1027 | extern void internal_unpack_4 (gfc_array_i4 *, const GFC_INTEGER_4 *); |
1028 | internal_proto(internal_unpack_4); | |
6de9cd9a | 1029 | |
7d7b8bfe RH |
1030 | extern void internal_unpack_8 (gfc_array_i8 *, const GFC_INTEGER_8 *); |
1031 | internal_proto(internal_unpack_8); | |
f814193b | 1032 | |
0618ee31 | 1033 | #if defined HAVE_GFC_INTEGER_16 |
e82726f9 AJ |
1034 | extern void internal_unpack_16 (gfc_array_i16 *, const GFC_INTEGER_16 *); |
1035 | internal_proto(internal_unpack_16); | |
0618ee31 | 1036 | #endif |
e82726f9 | 1037 | |
8e1d7686 TK |
1038 | extern void internal_unpack_r4 (gfc_array_r4 *, const GFC_REAL_4 *); |
1039 | internal_proto(internal_unpack_r4); | |
1040 | ||
1041 | extern void internal_unpack_r8 (gfc_array_r8 *, const GFC_REAL_8 *); | |
1042 | internal_proto(internal_unpack_r8); | |
1043 | ||
1044 | #if defined HAVE_GFC_REAL_10 | |
1045 | extern void internal_unpack_r10 (gfc_array_r10 *, const GFC_REAL_10 *); | |
1046 | internal_proto(internal_unpack_r10); | |
1047 | #endif | |
1048 | ||
1049 | #if defined HAVE_GFC_REAL_16 | |
1050 | extern void internal_unpack_r16 (gfc_array_r16 *, const GFC_REAL_16 *); | |
1051 | internal_proto(internal_unpack_r16); | |
1052 | #endif | |
1053 | ||
23d11a0a JJ |
1054 | #if defined HAVE_GFC_REAL_17 |
1055 | extern void internal_unpack_r17 (gfc_array_r17 *, const GFC_REAL_17 *); | |
1056 | internal_proto(internal_unpack_r17); | |
1057 | #endif | |
1058 | ||
39328081 TK |
1059 | extern void internal_unpack_c4 (gfc_array_c4 *, const GFC_COMPLEX_4 *); |
1060 | internal_proto(internal_unpack_c4); | |
1061 | ||
1062 | extern void internal_unpack_c8 (gfc_array_c8 *, const GFC_COMPLEX_8 *); | |
1063 | internal_proto(internal_unpack_c8); | |
1064 | ||
0618ee31 | 1065 | #if defined HAVE_GFC_COMPLEX_10 |
e82726f9 AJ |
1066 | extern void internal_unpack_c10 (gfc_array_c10 *, const GFC_COMPLEX_10 *); |
1067 | internal_proto(internal_unpack_c10); | |
0618ee31 | 1068 | #endif |
e82726f9 | 1069 | |
f53c2bfa FXC |
1070 | #if defined HAVE_GFC_COMPLEX_16 |
1071 | extern void internal_unpack_c16 (gfc_array_c16 *, const GFC_COMPLEX_16 *); | |
1072 | internal_proto(internal_unpack_c16); | |
1073 | #endif | |
1074 | ||
23d11a0a JJ |
1075 | #if defined HAVE_GFC_COMPLEX_17 |
1076 | extern void internal_unpack_c17 (gfc_array_c17 *, const GFC_COMPLEX_17 *); | |
1077 | internal_proto(internal_unpack_c17); | |
1078 | #endif | |
1079 | ||
3ef2513a TK |
1080 | /* Internal auxiliary functions for the pack intrinsic. */ |
1081 | ||
1082 | extern void pack_i1 (gfc_array_i1 *, const gfc_array_i1 *, | |
1083 | const gfc_array_l1 *, const gfc_array_i1 *); | |
1084 | internal_proto(pack_i1); | |
1085 | ||
1086 | extern void pack_i2 (gfc_array_i2 *, const gfc_array_i2 *, | |
1087 | const gfc_array_l1 *, const gfc_array_i2 *); | |
1088 | internal_proto(pack_i2); | |
1089 | ||
1090 | extern void pack_i4 (gfc_array_i4 *, const gfc_array_i4 *, | |
1091 | const gfc_array_l1 *, const gfc_array_i4 *); | |
1092 | internal_proto(pack_i4); | |
1093 | ||
1094 | extern void pack_i8 (gfc_array_i8 *, const gfc_array_i8 *, | |
1095 | const gfc_array_l1 *, const gfc_array_i8 *); | |
1096 | internal_proto(pack_i8); | |
1097 | ||
1098 | #ifdef HAVE_GFC_INTEGER_16 | |
1099 | extern void pack_i16 (gfc_array_i16 *, const gfc_array_i16 *, | |
1100 | const gfc_array_l1 *, const gfc_array_i16 *); | |
1101 | internal_proto(pack_i16); | |
1102 | #endif | |
1103 | ||
1104 | extern void pack_r4 (gfc_array_r4 *, const gfc_array_r4 *, | |
1105 | const gfc_array_l1 *, const gfc_array_r4 *); | |
1106 | internal_proto(pack_r4); | |
1107 | ||
1108 | extern void pack_r8 (gfc_array_r8 *, const gfc_array_r8 *, | |
1109 | const gfc_array_l1 *, const gfc_array_r8 *); | |
1110 | internal_proto(pack_r8); | |
1111 | ||
1112 | #ifdef HAVE_GFC_REAL_10 | |
1113 | extern void pack_r10 (gfc_array_r10 *, const gfc_array_r10 *, | |
1114 | const gfc_array_l1 *, const gfc_array_r10 *); | |
1115 | internal_proto(pack_r10); | |
1116 | #endif | |
1117 | ||
1118 | #ifdef HAVE_GFC_REAL_16 | |
1119 | extern void pack_r16 (gfc_array_r16 *, const gfc_array_r16 *, | |
1120 | const gfc_array_l1 *, const gfc_array_r16 *); | |
1121 | internal_proto(pack_r16); | |
1122 | #endif | |
1123 | ||
23d11a0a JJ |
1124 | #ifdef HAVE_GFC_REAL_17 |
1125 | extern void pack_r17 (gfc_array_r17 *, const gfc_array_r17 *, | |
1126 | const gfc_array_l1 *, const gfc_array_r17 *); | |
1127 | internal_proto(pack_r17); | |
1128 | #endif | |
1129 | ||
3ef2513a TK |
1130 | extern void pack_c4 (gfc_array_c4 *, const gfc_array_c4 *, |
1131 | const gfc_array_l1 *, const gfc_array_c4 *); | |
1132 | internal_proto(pack_c4); | |
1133 | ||
1134 | extern void pack_c8 (gfc_array_c8 *, const gfc_array_c8 *, | |
1135 | const gfc_array_l1 *, const gfc_array_c8 *); | |
1136 | internal_proto(pack_c8); | |
1137 | ||
1138 | #ifdef HAVE_GFC_REAL_10 | |
1139 | extern void pack_c10 (gfc_array_c10 *, const gfc_array_c10 *, | |
1140 | const gfc_array_l1 *, const gfc_array_c10 *); | |
1141 | internal_proto(pack_c10); | |
1142 | #endif | |
1143 | ||
1144 | #ifdef HAVE_GFC_REAL_16 | |
1145 | extern void pack_c16 (gfc_array_c16 *, const gfc_array_c16 *, | |
1146 | const gfc_array_l1 *, const gfc_array_c16 *); | |
1147 | internal_proto(pack_c16); | |
1148 | #endif | |
1149 | ||
23d11a0a JJ |
1150 | #ifdef HAVE_GFC_REAL_17 |
1151 | extern void pack_c17 (gfc_array_c17 *, const gfc_array_c17 *, | |
1152 | const gfc_array_l1 *, const gfc_array_c17 *); | |
1153 | internal_proto(pack_c17); | |
1154 | #endif | |
1155 | ||
3478bba4 TK |
1156 | /* Internal auxiliary functions for the unpack intrinsic. */ |
1157 | ||
1158 | extern void unpack0_i1 (gfc_array_i1 *, const gfc_array_i1 *, | |
1159 | const gfc_array_l1 *, const GFC_INTEGER_1 *); | |
1160 | internal_proto(unpack0_i1); | |
1161 | ||
1162 | extern void unpack0_i2 (gfc_array_i2 *, const gfc_array_i2 *, | |
1163 | const gfc_array_l1 *, const GFC_INTEGER_2 *); | |
1164 | internal_proto(unpack0_i2); | |
1165 | ||
1166 | extern void unpack0_i4 (gfc_array_i4 *, const gfc_array_i4 *, | |
1167 | const gfc_array_l1 *, const GFC_INTEGER_4 *); | |
1168 | internal_proto(unpack0_i4); | |
1169 | ||
1170 | extern void unpack0_i8 (gfc_array_i8 *, const gfc_array_i8 *, | |
1171 | const gfc_array_l1 *, const GFC_INTEGER_8 *); | |
1172 | internal_proto(unpack0_i8); | |
1173 | ||
1174 | #ifdef HAVE_GFC_INTEGER_16 | |
1175 | ||
1176 | extern void unpack0_i16 (gfc_array_i16 *, const gfc_array_i16 *, | |
1177 | const gfc_array_l1 *, const GFC_INTEGER_16 *); | |
1178 | internal_proto(unpack0_i16); | |
1179 | ||
1180 | #endif | |
1181 | ||
1182 | extern void unpack0_r4 (gfc_array_r4 *, const gfc_array_r4 *, | |
1183 | const gfc_array_l1 *, const GFC_REAL_4 *); | |
1184 | internal_proto(unpack0_r4); | |
1185 | ||
1186 | extern void unpack0_r8 (gfc_array_r8 *, const gfc_array_r8 *, | |
1187 | const gfc_array_l1 *, const GFC_REAL_8 *); | |
1188 | internal_proto(unpack0_r8); | |
1189 | ||
1190 | #ifdef HAVE_GFC_REAL_10 | |
1191 | ||
1192 | extern void unpack0_r10 (gfc_array_r10 *, const gfc_array_r10 *, | |
1193 | const gfc_array_l1 *, const GFC_REAL_10 *); | |
1194 | internal_proto(unpack0_r10); | |
1195 | ||
1196 | #endif | |
1197 | ||
1198 | #ifdef HAVE_GFC_REAL_16 | |
1199 | ||
1200 | extern void unpack0_r16 (gfc_array_r16 *, const gfc_array_r16 *, | |
1201 | const gfc_array_l1 *, const GFC_REAL_16 *); | |
1202 | internal_proto(unpack0_r16); | |
1203 | ||
1204 | #endif | |
1205 | ||
23d11a0a JJ |
1206 | #ifdef HAVE_GFC_REAL_17 |
1207 | ||
1208 | extern void unpack0_r17 (gfc_array_r17 *, const gfc_array_r17 *, | |
1209 | const gfc_array_l1 *, const GFC_REAL_17 *); | |
1210 | internal_proto(unpack0_r17); | |
1211 | ||
1212 | #endif | |
1213 | ||
3478bba4 TK |
1214 | extern void unpack0_c4 (gfc_array_c4 *, const gfc_array_c4 *, |
1215 | const gfc_array_l1 *, const GFC_COMPLEX_4 *); | |
1216 | internal_proto(unpack0_c4); | |
1217 | ||
1218 | extern void unpack0_c8 (gfc_array_c8 *, const gfc_array_c8 *, | |
1219 | const gfc_array_l1 *, const GFC_COMPLEX_8 *); | |
1220 | internal_proto(unpack0_c8); | |
1221 | ||
1222 | #ifdef HAVE_GFC_COMPLEX_10 | |
1223 | ||
1224 | extern void unpack0_c10 (gfc_array_c10 *, const gfc_array_c10 *, | |
1225 | const gfc_array_l1 *mask, const GFC_COMPLEX_10 *); | |
1226 | internal_proto(unpack0_c10); | |
1227 | ||
1228 | #endif | |
1229 | ||
1230 | #ifdef HAVE_GFC_COMPLEX_16 | |
1231 | ||
1232 | extern void unpack0_c16 (gfc_array_c16 *, const gfc_array_c16 *, | |
1233 | const gfc_array_l1 *, const GFC_COMPLEX_16 *); | |
1234 | internal_proto(unpack0_c16); | |
1235 | ||
1236 | #endif | |
1237 | ||
23d11a0a JJ |
1238 | #ifdef HAVE_GFC_COMPLEX_17 |
1239 | ||
1240 | extern void unpack0_c17 (gfc_array_c17 *, const gfc_array_c17 *, | |
1241 | const gfc_array_l1 *, const GFC_COMPLEX_17 *); | |
1242 | internal_proto(unpack0_c17); | |
1243 | ||
1244 | #endif | |
1245 | ||
3478bba4 TK |
1246 | extern void unpack1_i1 (gfc_array_i1 *, const gfc_array_i1 *, |
1247 | const gfc_array_l1 *, const gfc_array_i1 *); | |
1248 | internal_proto(unpack1_i1); | |
1249 | ||
1250 | extern void unpack1_i2 (gfc_array_i2 *, const gfc_array_i2 *, | |
1251 | const gfc_array_l1 *, const gfc_array_i2 *); | |
1252 | internal_proto(unpack1_i2); | |
1253 | ||
1254 | extern void unpack1_i4 (gfc_array_i4 *, const gfc_array_i4 *, | |
1255 | const gfc_array_l1 *, const gfc_array_i4 *); | |
1256 | internal_proto(unpack1_i4); | |
1257 | ||
1258 | extern void unpack1_i8 (gfc_array_i8 *, const gfc_array_i8 *, | |
1259 | const gfc_array_l1 *, const gfc_array_i8 *); | |
1260 | internal_proto(unpack1_i8); | |
1261 | ||
1262 | #ifdef HAVE_GFC_INTEGER_16 | |
1263 | extern void unpack1_i16 (gfc_array_i16 *, const gfc_array_i16 *, | |
1264 | const gfc_array_l1 *, const gfc_array_i16 *); | |
1265 | internal_proto(unpack1_i16); | |
1266 | #endif | |
1267 | ||
1268 | extern void unpack1_r4 (gfc_array_r4 *, const gfc_array_r4 *, | |
1269 | const gfc_array_l1 *, const gfc_array_r4 *); | |
1270 | internal_proto(unpack1_r4); | |
1271 | ||
1272 | extern void unpack1_r8 (gfc_array_r8 *, const gfc_array_r8 *, | |
1273 | const gfc_array_l1 *, const gfc_array_r8 *); | |
1274 | internal_proto(unpack1_r8); | |
1275 | ||
1276 | #ifdef HAVE_GFC_REAL_10 | |
1277 | extern void unpack1_r10 (gfc_array_r10 *, const gfc_array_r10 *, | |
1278 | const gfc_array_l1 *, const gfc_array_r10 *); | |
1279 | internal_proto(unpack1_r10); | |
1280 | #endif | |
1281 | ||
1282 | #ifdef HAVE_GFC_REAL_16 | |
1283 | extern void unpack1_r16 (gfc_array_r16 *, const gfc_array_r16 *, | |
1284 | const gfc_array_l1 *, const gfc_array_r16 *); | |
1285 | internal_proto(unpack1_r16); | |
1286 | #endif | |
1287 | ||
23d11a0a JJ |
1288 | #ifdef HAVE_GFC_REAL_17 |
1289 | extern void unpack1_r17 (gfc_array_r17 *, const gfc_array_r17 *, | |
1290 | const gfc_array_l1 *, const gfc_array_r17 *); | |
1291 | internal_proto(unpack1_r17); | |
1292 | #endif | |
1293 | ||
3478bba4 TK |
1294 | extern void unpack1_c4 (gfc_array_c4 *, const gfc_array_c4 *, |
1295 | const gfc_array_l1 *, const gfc_array_c4 *); | |
1296 | internal_proto(unpack1_c4); | |
1297 | ||
1298 | extern void unpack1_c8 (gfc_array_c8 *, const gfc_array_c8 *, | |
1299 | const gfc_array_l1 *, const gfc_array_c8 *); | |
1300 | internal_proto(unpack1_c8); | |
1301 | ||
1302 | #ifdef HAVE_GFC_COMPLEX_10 | |
1303 | extern void unpack1_c10 (gfc_array_c10 *, const gfc_array_c10 *, | |
1304 | const gfc_array_l1 *, const gfc_array_c10 *); | |
1305 | internal_proto(unpack1_c10); | |
1306 | #endif | |
1307 | ||
1308 | #ifdef HAVE_GFC_COMPLEX_16 | |
1309 | extern void unpack1_c16 (gfc_array_c16 *, const gfc_array_c16 *, | |
1310 | const gfc_array_l1 *, const gfc_array_c16 *); | |
1311 | internal_proto(unpack1_c16); | |
1312 | #endif | |
1313 | ||
23d11a0a JJ |
1314 | #ifdef HAVE_GFC_COMPLEX_17 |
1315 | extern void unpack1_c17 (gfc_array_c17 *, const gfc_array_c17 *, | |
1316 | const gfc_array_l1 *, const gfc_array_c17 *); | |
1317 | internal_proto(unpack1_c17); | |
1318 | #endif | |
1319 | ||
75f2543f TK |
1320 | /* Helper functions for spread. */ |
1321 | ||
1322 | extern void spread_i1 (gfc_array_i1 *, const gfc_array_i1 *, | |
1323 | const index_type, const index_type); | |
1324 | internal_proto(spread_i1); | |
1325 | ||
1326 | extern void spread_i2 (gfc_array_i2 *, const gfc_array_i2 *, | |
1327 | const index_type, const index_type); | |
1328 | internal_proto(spread_i2); | |
1329 | ||
1330 | extern void spread_i4 (gfc_array_i4 *, const gfc_array_i4 *, | |
1331 | const index_type, const index_type); | |
1332 | internal_proto(spread_i4); | |
1333 | ||
1334 | extern void spread_i8 (gfc_array_i8 *, const gfc_array_i8 *, | |
1335 | const index_type, const index_type); | |
1336 | internal_proto(spread_i8); | |
1337 | ||
1338 | #ifdef HAVE_GFC_INTEGER_16 | |
1339 | extern void spread_i16 (gfc_array_i16 *, const gfc_array_i16 *, | |
1340 | const index_type, const index_type); | |
1341 | internal_proto(spread_i16); | |
1342 | ||
1343 | #endif | |
1344 | ||
1345 | extern void spread_r4 (gfc_array_r4 *, const gfc_array_r4 *, | |
1346 | const index_type, const index_type); | |
1347 | internal_proto(spread_r4); | |
1348 | ||
1349 | extern void spread_r8 (gfc_array_r8 *, const gfc_array_r8 *, | |
1350 | const index_type, const index_type); | |
1351 | internal_proto(spread_r8); | |
1352 | ||
1353 | #ifdef HAVE_GFC_REAL_10 | |
1354 | extern void spread_r10 (gfc_array_r10 *, const gfc_array_r10 *, | |
1355 | const index_type, const index_type); | |
1356 | internal_proto(spread_r10); | |
1357 | ||
1358 | #endif | |
1359 | ||
1360 | #ifdef HAVE_GFC_REAL_16 | |
1361 | extern void spread_r16 (gfc_array_r16 *, const gfc_array_r16 *, | |
1362 | const index_type, const index_type); | |
1363 | internal_proto(spread_r16); | |
1364 | ||
1365 | #endif | |
1366 | ||
23d11a0a JJ |
1367 | #ifdef HAVE_GFC_REAL_17 |
1368 | extern void spread_r17 (gfc_array_r17 *, const gfc_array_r17 *, | |
1369 | const index_type, const index_type); | |
1370 | internal_proto(spread_r17); | |
1371 | ||
1372 | #endif | |
1373 | ||
75f2543f TK |
1374 | extern void spread_c4 (gfc_array_c4 *, const gfc_array_c4 *, |
1375 | const index_type, const index_type); | |
1376 | internal_proto(spread_c4); | |
1377 | ||
1378 | extern void spread_c8 (gfc_array_c8 *, const gfc_array_c8 *, | |
1379 | const index_type, const index_type); | |
1380 | internal_proto(spread_c8); | |
1381 | ||
1382 | #ifdef HAVE_GFC_COMPLEX_10 | |
1383 | extern void spread_c10 (gfc_array_c10 *, const gfc_array_c10 *, | |
1384 | const index_type, const index_type); | |
1385 | internal_proto(spread_c10); | |
1386 | ||
1387 | #endif | |
1388 | ||
1389 | #ifdef HAVE_GFC_COMPLEX_16 | |
1390 | extern void spread_c16 (gfc_array_c16 *, const gfc_array_c16 *, | |
1391 | const index_type, const index_type); | |
1392 | internal_proto(spread_c16); | |
1393 | ||
1394 | #endif | |
1395 | ||
23d11a0a JJ |
1396 | #ifdef HAVE_GFC_COMPLEX_17 |
1397 | extern void spread_c17 (gfc_array_c17 *, const gfc_array_c17 *, | |
1398 | const index_type, const index_type); | |
1399 | internal_proto(spread_c17); | |
1400 | ||
1401 | #endif | |
1402 | ||
75f2543f TK |
1403 | extern void spread_scalar_i1 (gfc_array_i1 *, const GFC_INTEGER_1 *, |
1404 | const index_type, const index_type); | |
1405 | internal_proto(spread_scalar_i1); | |
1406 | ||
1407 | extern void spread_scalar_i2 (gfc_array_i2 *, const GFC_INTEGER_2 *, | |
1408 | const index_type, const index_type); | |
1409 | internal_proto(spread_scalar_i2); | |
1410 | ||
1411 | extern void spread_scalar_i4 (gfc_array_i4 *, const GFC_INTEGER_4 *, | |
1412 | const index_type, const index_type); | |
1413 | internal_proto(spread_scalar_i4); | |
1414 | ||
1415 | extern void spread_scalar_i8 (gfc_array_i8 *, const GFC_INTEGER_8 *, | |
1416 | const index_type, const index_type); | |
1417 | internal_proto(spread_scalar_i8); | |
1418 | ||
1419 | #ifdef HAVE_GFC_INTEGER_16 | |
1420 | extern void spread_scalar_i16 (gfc_array_i16 *, const GFC_INTEGER_16 *, | |
1421 | const index_type, const index_type); | |
1422 | internal_proto(spread_scalar_i16); | |
1423 | ||
1424 | #endif | |
1425 | ||
1426 | extern void spread_scalar_r4 (gfc_array_r4 *, const GFC_REAL_4 *, | |
1427 | const index_type, const index_type); | |
1428 | internal_proto(spread_scalar_r4); | |
1429 | ||
1430 | extern void spread_scalar_r8 (gfc_array_r8 *, const GFC_REAL_8 *, | |
1431 | const index_type, const index_type); | |
1432 | internal_proto(spread_scalar_r8); | |
1433 | ||
1434 | #ifdef HAVE_GFC_REAL_10 | |
1435 | extern void spread_scalar_r10 (gfc_array_r10 *, const GFC_REAL_10 *, | |
1436 | const index_type, const index_type); | |
1437 | internal_proto(spread_scalar_r10); | |
1438 | ||
1439 | #endif | |
1440 | ||
1441 | #ifdef HAVE_GFC_REAL_16 | |
1442 | extern void spread_scalar_r16 (gfc_array_r16 *, const GFC_REAL_16 *, | |
1443 | const index_type, const index_type); | |
1444 | internal_proto(spread_scalar_r16); | |
1445 | ||
1446 | #endif | |
1447 | ||
23d11a0a JJ |
1448 | #ifdef HAVE_GFC_REAL_17 |
1449 | extern void spread_scalar_r17 (gfc_array_r17 *, const GFC_REAL_17 *, | |
1450 | const index_type, const index_type); | |
1451 | internal_proto(spread_scalar_r17); | |
1452 | ||
1453 | #endif | |
1454 | ||
75f2543f TK |
1455 | extern void spread_scalar_c4 (gfc_array_c4 *, const GFC_COMPLEX_4 *, |
1456 | const index_type, const index_type); | |
1457 | internal_proto(spread_scalar_c4); | |
1458 | ||
1459 | extern void spread_scalar_c8 (gfc_array_c8 *, const GFC_COMPLEX_8 *, | |
1460 | const index_type, const index_type); | |
1461 | internal_proto(spread_scalar_c8); | |
1462 | ||
1463 | #ifdef HAVE_GFC_COMPLEX_10 | |
1464 | extern void spread_scalar_c10 (gfc_array_c10 *, const GFC_COMPLEX_10 *, | |
1465 | const index_type, const index_type); | |
1466 | internal_proto(spread_scalar_c10); | |
1467 | ||
1468 | #endif | |
1469 | ||
1470 | #ifdef HAVE_GFC_COMPLEX_16 | |
1471 | extern void spread_scalar_c16 (gfc_array_c16 *, const GFC_COMPLEX_16 *, | |
1472 | const index_type, const index_type); | |
1473 | internal_proto(spread_scalar_c16); | |
1474 | ||
1475 | #endif | |
1476 | ||
23d11a0a JJ |
1477 | #ifdef HAVE_GFC_COMPLEX_17 |
1478 | extern void spread_scalar_c17 (gfc_array_c17 *, const GFC_COMPLEX_17 *, | |
1479 | const index_type, const index_type); | |
1480 | internal_proto(spread_scalar_c17); | |
1481 | ||
1482 | #endif | |
1483 | ||
6de9cd9a DN |
1484 | /* string_intrinsics.c */ |
1485 | ||
4b267817 FXC |
1486 | extern int compare_string (gfc_charlen_type, const char *, |
1487 | gfc_charlen_type, const char *); | |
7d7b8bfe | 1488 | iexport_proto(compare_string); |
6de9cd9a | 1489 | |
4b267817 FXC |
1490 | extern int compare_string_char4 (gfc_charlen_type, const gfc_char4_t *, |
1491 | gfc_charlen_type, const gfc_char4_t *); | |
1492 | iexport_proto(compare_string_char4); | |
1493 | ||
e7898e54 TK |
1494 | extern int memcmp_char4 (const void *, const void *, size_t); |
1495 | internal_proto(memcmp_char4); | |
1496 | ||
1497 | ||
abdef811 BD |
1498 | /* random.c */ |
1499 | ||
34b4bc5c FXC |
1500 | extern void random_seed_i4 (GFC_INTEGER_4 * size, gfc_array_i4 * put, |
1501 | gfc_array_i4 * get); | |
1502 | iexport_proto(random_seed_i4); | |
1503 | extern void random_seed_i8 (GFC_INTEGER_8 * size, gfc_array_i8 * put, | |
1504 | gfc_array_i8 * get); | |
1505 | iexport_proto(random_seed_i8); | |
abdef811 | 1506 | |
6c167c45 VL |
1507 | /* size.c */ |
1508 | ||
e9bfdf18 | 1509 | typedef GFC_ARRAY_DESCRIPTOR (void) array_t; |
6c167c45 | 1510 | |
7d7b8bfe RH |
1511 | extern index_type size0 (const array_t * array); |
1512 | iexport_proto(size0); | |
6c167c45 | 1513 | |
419af57c TK |
1514 | /* is_contiguous.c */ |
1515 | ||
1516 | extern GFC_LOGICAL_4 is_contiguous0 (const array_t * const restrict array); | |
1517 | iexport_proto(is_contiguous0); | |
1518 | ||
16bff921 TK |
1519 | /* bounds.c */ |
1520 | ||
1521 | extern void bounds_equal_extents (array_t *, array_t *, const char *, | |
1522 | const char *); | |
1523 | internal_proto(bounds_equal_extents); | |
1524 | ||
1525 | extern void bounds_reduced_extents (array_t *, array_t *, int, const char *, | |
1526 | const char *intrinsic); | |
1527 | internal_proto(bounds_reduced_extents); | |
1528 | ||
1529 | extern void bounds_iforeach_return (array_t *, array_t *, const char *); | |
1530 | internal_proto(bounds_iforeach_return); | |
1531 | ||
1532 | extern void bounds_ifunction_return (array_t *, const index_type *, | |
1533 | const char *, const char *); | |
1534 | internal_proto(bounds_ifunction_return); | |
1535 | ||
8c39b987 TK |
1536 | extern index_type count_0 (const gfc_array_l1 *); |
1537 | ||
1538 | internal_proto(count_0); | |
1539 | ||
c2b00cdc TK |
1540 | /* Internal auxiliary functions for cshift */ |
1541 | ||
44720bef | 1542 | void cshift0_i1 (gfc_array_i1 *, const gfc_array_i1 *, ptrdiff_t, int); |
c2b00cdc TK |
1543 | internal_proto(cshift0_i1); |
1544 | ||
44720bef | 1545 | void cshift0_i2 (gfc_array_i2 *, const gfc_array_i2 *, ptrdiff_t, int); |
c2b00cdc TK |
1546 | internal_proto(cshift0_i2); |
1547 | ||
44720bef | 1548 | void cshift0_i4 (gfc_array_i4 *, const gfc_array_i4 *, ptrdiff_t, int); |
c2b00cdc TK |
1549 | internal_proto(cshift0_i4); |
1550 | ||
44720bef | 1551 | void cshift0_i8 (gfc_array_i8 *, const gfc_array_i8 *, ptrdiff_t, int); |
c2b00cdc TK |
1552 | internal_proto(cshift0_i8); |
1553 | ||
1554 | #ifdef HAVE_GFC_INTEGER_16 | |
44720bef | 1555 | void cshift0_i16 (gfc_array_i16 *, const gfc_array_i16 *, ptrdiff_t, int); |
c2b00cdc TK |
1556 | internal_proto(cshift0_i16); |
1557 | #endif | |
1558 | ||
44720bef | 1559 | void cshift0_r4 (gfc_array_r4 *, const gfc_array_r4 *, ptrdiff_t, int); |
c2b00cdc TK |
1560 | internal_proto(cshift0_r4); |
1561 | ||
44720bef | 1562 | void cshift0_r8 (gfc_array_r8 *, const gfc_array_r8 *, ptrdiff_t, int); |
c2b00cdc TK |
1563 | internal_proto(cshift0_r8); |
1564 | ||
1565 | #ifdef HAVE_GFC_REAL_10 | |
44720bef | 1566 | void cshift0_r10 (gfc_array_r10 *, const gfc_array_r10 *, ptrdiff_t, int); |
c2b00cdc TK |
1567 | internal_proto(cshift0_r10); |
1568 | #endif | |
1569 | ||
1570 | #ifdef HAVE_GFC_REAL_16 | |
44720bef | 1571 | void cshift0_r16 (gfc_array_r16 *, const gfc_array_r16 *, ptrdiff_t, int); |
c2b00cdc TK |
1572 | internal_proto(cshift0_r16); |
1573 | #endif | |
1574 | ||
23d11a0a JJ |
1575 | #ifdef HAVE_GFC_REAL_17 |
1576 | void cshift0_r17 (gfc_array_r17 *, const gfc_array_r17 *, ptrdiff_t, int); | |
1577 | internal_proto(cshift0_r17); | |
1578 | #endif | |
1579 | ||
44720bef | 1580 | void cshift0_c4 (gfc_array_c4 *, const gfc_array_c4 *, ptrdiff_t, int); |
c2b00cdc TK |
1581 | internal_proto(cshift0_c4); |
1582 | ||
44720bef | 1583 | void cshift0_c8 (gfc_array_c8 *, const gfc_array_c8 *, ptrdiff_t, int); |
c2b00cdc TK |
1584 | internal_proto(cshift0_c8); |
1585 | ||
1586 | #ifdef HAVE_GFC_COMPLEX_10 | |
44720bef | 1587 | void cshift0_c10 (gfc_array_c10 *, const gfc_array_c10 *, ptrdiff_t, int); |
c2b00cdc TK |
1588 | internal_proto(cshift0_c10); |
1589 | #endif | |
1590 | ||
1591 | #ifdef HAVE_GFC_COMPLEX_16 | |
44720bef | 1592 | void cshift0_c16 (gfc_array_c16 *, const gfc_array_c16 *, ptrdiff_t, int); |
c2b00cdc TK |
1593 | internal_proto(cshift0_c16); |
1594 | #endif | |
1595 | ||
23d11a0a JJ |
1596 | #ifdef HAVE_GFC_COMPLEX_17 |
1597 | void cshift0_c17 (gfc_array_c17 *, const gfc_array_c17 *, ptrdiff_t, int); | |
1598 | internal_proto(cshift0_c17); | |
1599 | #endif | |
1600 | ||
e56e3fda TK |
1601 | #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_1) |
1602 | void cshift1_4_i1 (gfc_array_i1 * const restrict, | |
1603 | const gfc_array_i1 * const restrict, | |
1604 | const gfc_array_i4 * const restrict, | |
1605 | const GFC_INTEGER_4 * const restrict); | |
1606 | internal_proto(cshift1_4_i1); | |
1607 | #endif | |
1608 | ||
1609 | #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_2) | |
1610 | void cshift1_4_i2 (gfc_array_i2 * const restrict, | |
1611 | const gfc_array_i2 * const restrict, | |
1612 | const gfc_array_i4 * const restrict, | |
1613 | const GFC_INTEGER_4 * const restrict); | |
1614 | internal_proto(cshift1_4_i2); | |
1615 | #endif | |
1616 | ||
1617 | #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_4) | |
1618 | void cshift1_4_i4 (gfc_array_i4 * const restrict, | |
1619 | const gfc_array_i4 * const restrict, | |
1620 | const gfc_array_i4 * const restrict, | |
1621 | const GFC_INTEGER_4 * const restrict); | |
1622 | internal_proto(cshift1_4_i4); | |
1623 | #endif | |
1624 | ||
1625 | #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_8) | |
1626 | void cshift1_4_i8 (gfc_array_i8 * const restrict, | |
1627 | const gfc_array_i8 * const restrict, | |
1628 | const gfc_array_i4 * const restrict, | |
1629 | const GFC_INTEGER_4 * const restrict); | |
1630 | internal_proto(cshift1_4_i8); | |
1631 | #endif | |
1632 | ||
1633 | #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_INTEGER_16) | |
1634 | void cshift1_4_i16 (gfc_array_i16 * const restrict, | |
1635 | const gfc_array_i16 * const restrict, | |
1636 | const gfc_array_i4 * const restrict, | |
1637 | const GFC_INTEGER_4 * const restrict); | |
1638 | internal_proto(cshift1_4_i16); | |
1639 | #endif | |
1640 | ||
1641 | #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_1) | |
1642 | void cshift1_8_i1 (gfc_array_i1 * const restrict, | |
1643 | const gfc_array_i1 * const restrict, | |
1644 | const gfc_array_i8 * const restrict, | |
1645 | const GFC_INTEGER_8 * const restrict); | |
1646 | internal_proto(cshift1_8_i1); | |
1647 | #endif | |
1648 | ||
1649 | #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_2) | |
1650 | void cshift1_8_i2 (gfc_array_i2 * const restrict, | |
1651 | const gfc_array_i2 * const restrict, | |
1652 | const gfc_array_i8 * const restrict, | |
1653 | const GFC_INTEGER_8 * const restrict); | |
1654 | internal_proto(cshift1_8_i2); | |
1655 | #endif | |
1656 | ||
1657 | #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_4) | |
1658 | void cshift1_8_i4 (gfc_array_i4 * const restrict, | |
1659 | const gfc_array_i4 * const restrict, | |
1660 | const gfc_array_i8 * const restrict, | |
1661 | const GFC_INTEGER_8 * const restrict); | |
1662 | internal_proto(cshift1_8_i4); | |
1663 | #endif | |
1664 | ||
1665 | #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_8) | |
1666 | void cshift1_8_i8 (gfc_array_i8 * const restrict, | |
1667 | const gfc_array_i8 * const restrict, | |
1668 | const gfc_array_i8 * const restrict, | |
1669 | const GFC_INTEGER_8 * const restrict); | |
1670 | internal_proto(cshift1_8_i8); | |
1671 | #endif | |
1672 | ||
1673 | #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_INTEGER_16) | |
1674 | void cshift1_8_i16 (gfc_array_i16 * const restrict, | |
1675 | const gfc_array_i16 * const restrict, | |
1676 | const gfc_array_i8 * const restrict, | |
1677 | const GFC_INTEGER_8 * const restrict); | |
1678 | internal_proto(cshift1_8_i16); | |
1679 | #endif | |
1680 | ||
1681 | #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_1) | |
1682 | void cshift1_16_i1 (gfc_array_i1 * const restrict, | |
1683 | const gfc_array_i1 * const restrict, | |
1684 | const gfc_array_i16 * const restrict, | |
1685 | const GFC_INTEGER_16 * const restrict); | |
1686 | internal_proto(cshift1_16_i1); | |
1687 | #endif | |
1688 | ||
1689 | #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_2) | |
1690 | void cshift1_16_i2 (gfc_array_i2 * const restrict, | |
1691 | const gfc_array_i2 * const restrict, | |
1692 | const gfc_array_i16 * const restrict, | |
1693 | const GFC_INTEGER_16 * const restrict); | |
1694 | internal_proto(cshift1_16_i2); | |
1695 | #endif | |
1696 | ||
1697 | #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_4) | |
1698 | void cshift1_16_i4 (gfc_array_i4 * const restrict, | |
1699 | const gfc_array_i4 * const restrict, | |
1700 | const gfc_array_i16 * const restrict, | |
1701 | const GFC_INTEGER_16 * const restrict); | |
1702 | internal_proto(cshift1_16_i4); | |
1703 | #endif | |
1704 | ||
1705 | #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_8) | |
1706 | void cshift1_16_i8 (gfc_array_i8 * const restrict, | |
1707 | const gfc_array_i8 * const restrict, | |
1708 | const gfc_array_i16 * const restrict, | |
1709 | const GFC_INTEGER_16 * const restrict); | |
1710 | internal_proto(cshift1_16_i8); | |
1711 | #endif | |
1712 | ||
1713 | #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_INTEGER_16) | |
1714 | void cshift1_16_i16 (gfc_array_i16 * const restrict, | |
1715 | const gfc_array_i16 * const restrict, | |
1716 | const gfc_array_i16 * const restrict, | |
1717 | const GFC_INTEGER_16 * const restrict); | |
1718 | internal_proto(cshift1_16_i16); | |
1719 | #endif | |
1720 | ||
1721 | #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_REAL_4) | |
1722 | void cshift1_4_r4 (gfc_array_r4 * const restrict, | |
1723 | const gfc_array_r4 * const restrict, | |
1724 | const gfc_array_i4 * const restrict, | |
1725 | const GFC_INTEGER_4 * const restrict); | |
1726 | internal_proto(cshift1_4_r4); | |
1727 | #endif | |
1728 | ||
1729 | #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_REAL_8) | |
1730 | void cshift1_4_r8 (gfc_array_r8 * const restrict, | |
1731 | const gfc_array_r8 * const restrict, | |
1732 | const gfc_array_i4 * const restrict, | |
1733 | const GFC_INTEGER_4 * const restrict); | |
1734 | internal_proto(cshift1_4_r8); | |
1735 | #endif | |
1736 | ||
1737 | #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_REAL_10) | |
1738 | void cshift1_4_r10 (gfc_array_r10 * const restrict, | |
1739 | const gfc_array_r10 * const restrict, | |
1740 | const gfc_array_i4 * const restrict, | |
1741 | const GFC_INTEGER_4 * const restrict); | |
1742 | internal_proto(cshift1_4_r10); | |
1743 | #endif | |
1744 | ||
1745 | #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_REAL_16) | |
1746 | void cshift1_4_r16 (gfc_array_r16 * const restrict, | |
1747 | const gfc_array_r16 * const restrict, | |
1748 | const gfc_array_i4 * const restrict, | |
1749 | const GFC_INTEGER_4 * const restrict); | |
1750 | internal_proto(cshift1_4_r16); | |
1751 | #endif | |
1752 | ||
23d11a0a JJ |
1753 | #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_REAL_17) |
1754 | void cshift1_4_r17 (gfc_array_r17 * const restrict, | |
1755 | const gfc_array_r17 * const restrict, | |
1756 | const gfc_array_i4 * const restrict, | |
1757 | const GFC_INTEGER_4 * const restrict); | |
1758 | internal_proto(cshift1_4_r17); | |
1759 | #endif | |
1760 | ||
e56e3fda TK |
1761 | #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_REAL_4) |
1762 | void cshift1_8_r4 (gfc_array_r4 * const restrict, | |
1763 | const gfc_array_r4 * const restrict, | |
1764 | const gfc_array_i8 * const restrict, | |
1765 | const GFC_INTEGER_8 * const restrict); | |
1766 | internal_proto(cshift1_8_r4); | |
1767 | #endif | |
1768 | ||
1769 | #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_REAL_8) | |
1770 | void cshift1_8_r8 (gfc_array_r8 * const restrict, | |
1771 | const gfc_array_r8 * const restrict, | |
1772 | const gfc_array_i8 * const restrict, | |
1773 | const GFC_INTEGER_8 * const restrict); | |
1774 | internal_proto(cshift1_8_r8); | |
1775 | #endif | |
1776 | ||
1777 | #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_REAL_10) | |
1778 | void cshift1_8_r10 (gfc_array_r10 * const restrict, | |
1779 | const gfc_array_r10 * const restrict, | |
1780 | const gfc_array_i8 * const restrict, | |
1781 | const GFC_INTEGER_8 * const restrict); | |
1782 | internal_proto(cshift1_8_r10); | |
1783 | #endif | |
1784 | ||
1785 | #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_REAL_16) | |
1786 | void cshift1_8_r16 (gfc_array_r16 * const restrict, | |
1787 | const gfc_array_r16 * const restrict, | |
1788 | const gfc_array_i8 * const restrict, | |
1789 | const GFC_INTEGER_8 * const restrict); | |
1790 | internal_proto(cshift1_8_r16); | |
1791 | #endif | |
1792 | ||
23d11a0a JJ |
1793 | #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_REAL_17) |
1794 | void cshift1_8_r17 (gfc_array_r17 * const restrict, | |
1795 | const gfc_array_r17 * const restrict, | |
1796 | const gfc_array_i8 * const restrict, | |
1797 | const GFC_INTEGER_8 * const restrict); | |
1798 | internal_proto(cshift1_8_r17); | |
1799 | #endif | |
1800 | ||
e56e3fda TK |
1801 | #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_REAL_4) |
1802 | void cshift1_16_r4 (gfc_array_r4 * const restrict, | |
1803 | const gfc_array_r4 * const restrict, | |
1804 | const gfc_array_i16 * const restrict, | |
1805 | const GFC_INTEGER_16 * const restrict); | |
1806 | internal_proto(cshift1_16_r4); | |
1807 | #endif | |
1808 | ||
1809 | #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_REAL_8) | |
1810 | void cshift1_16_r8 (gfc_array_r8 * const restrict, | |
1811 | const gfc_array_r8 * const restrict, | |
1812 | const gfc_array_i16 * const restrict, | |
1813 | const GFC_INTEGER_16 * const restrict); | |
1814 | internal_proto(cshift1_16_r8); | |
1815 | #endif | |
1816 | ||
1817 | #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_REAL_10) | |
1818 | void cshift1_16_r10 (gfc_array_r10 * const restrict, | |
1819 | const gfc_array_r10 * const restrict, | |
1820 | const gfc_array_i16 * const restrict, | |
1821 | const GFC_INTEGER_16 * const restrict); | |
1822 | internal_proto(cshift1_16_r10); | |
1823 | #endif | |
1824 | ||
1825 | #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_REAL_16) | |
1826 | void cshift1_16_r16 (gfc_array_r16 * const restrict, | |
1827 | const gfc_array_r16 * const restrict, | |
1828 | const gfc_array_i16 * const restrict, | |
1829 | const GFC_INTEGER_16 * const restrict); | |
1830 | internal_proto(cshift1_16_r16); | |
1831 | #endif | |
1832 | ||
23d11a0a JJ |
1833 | #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_REAL_17) |
1834 | void cshift1_16_r17 (gfc_array_r17 * const restrict, | |
1835 | const gfc_array_r17 * const restrict, | |
1836 | const gfc_array_i16 * const restrict, | |
1837 | const GFC_INTEGER_16 * const restrict); | |
1838 | internal_proto(cshift1_16_r17); | |
1839 | #endif | |
1840 | ||
e56e3fda TK |
1841 | #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_COMPLEX_4) |
1842 | void cshift1_4_c4 (gfc_array_c4 * const restrict, | |
1843 | const gfc_array_c4 * const restrict, | |
1844 | const gfc_array_i4 * const restrict, | |
1845 | const GFC_INTEGER_4 * const restrict); | |
1846 | internal_proto(cshift1_4_c4); | |
1847 | #endif | |
1848 | ||
1849 | #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_COMPLEX_8) | |
1850 | void cshift1_4_c8 (gfc_array_c8 * const restrict, | |
1851 | const gfc_array_c8 * const restrict, | |
1852 | const gfc_array_i4 * const restrict, | |
1853 | const GFC_INTEGER_4 * const restrict); | |
1854 | internal_proto(cshift1_4_c8); | |
1855 | #endif | |
1856 | ||
1857 | #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_COMPLEX_10) | |
1858 | void cshift1_4_c10 (gfc_array_c10 * const restrict, | |
1859 | const gfc_array_c10 * const restrict, | |
1860 | const gfc_array_i4 * const restrict, | |
1861 | const GFC_INTEGER_4 * const restrict); | |
1862 | internal_proto(cshift1_4_c10); | |
1863 | #endif | |
1864 | ||
1865 | #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_COMPLEX_16) | |
1866 | void cshift1_4_c16 (gfc_array_c16 * const restrict, | |
1867 | const gfc_array_c16 * const restrict, | |
1868 | const gfc_array_i4 * const restrict, | |
1869 | const GFC_INTEGER_4 * const restrict); | |
1870 | internal_proto(cshift1_4_c16); | |
1871 | #endif | |
1872 | ||
23d11a0a JJ |
1873 | #if defined (HAVE_GFC_INTEGER_4) && defined (HAVE_GFC_COMPLEX_17) |
1874 | void cshift1_4_c17 (gfc_array_c17 * const restrict, | |
1875 | const gfc_array_c17 * const restrict, | |
1876 | const gfc_array_i4 * const restrict, | |
1877 | const GFC_INTEGER_4 * const restrict); | |
1878 | internal_proto(cshift1_4_c17); | |
1879 | #endif | |
1880 | ||
e56e3fda TK |
1881 | #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_COMPLEX_4) |
1882 | void cshift1_8_c4 (gfc_array_c4 * const restrict, | |
1883 | const gfc_array_c4 * const restrict, | |
1884 | const gfc_array_i8 * const restrict, | |
1885 | const GFC_INTEGER_8 * const restrict); | |
1886 | internal_proto(cshift1_8_c4); | |
1887 | #endif | |
1888 | ||
1889 | #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_COMPLEX_8) | |
1890 | void cshift1_8_c8 (gfc_array_c8 * const restrict, | |
1891 | const gfc_array_c8 * const restrict, | |
1892 | const gfc_array_i8 * const restrict, | |
1893 | const GFC_INTEGER_8 * const restrict); | |
1894 | internal_proto(cshift1_8_c8); | |
1895 | #endif | |
1896 | ||
1897 | #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_COMPLEX_10) | |
1898 | void cshift1_8_c10 (gfc_array_c10 * const restrict, | |
1899 | const gfc_array_c10 * const restrict, | |
1900 | const gfc_array_i8 * const restrict, | |
1901 | const GFC_INTEGER_8 * const restrict); | |
1902 | internal_proto(cshift1_8_c10); | |
1903 | #endif | |
1904 | ||
1905 | #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_COMPLEX_16) | |
1906 | void cshift1_8_c16 (gfc_array_c16 * const restrict, | |
1907 | const gfc_array_c16 * const restrict, | |
1908 | const gfc_array_i8 * const restrict, | |
1909 | const GFC_INTEGER_8 * const restrict); | |
1910 | internal_proto(cshift1_8_c16); | |
1911 | #endif | |
1912 | ||
23d11a0a JJ |
1913 | #if defined (HAVE_GFC_INTEGER_8) && defined (HAVE_GFC_COMPLEX_17) |
1914 | void cshift1_8_c17 (gfc_array_c17 * const restrict, | |
1915 | const gfc_array_c17 * const restrict, | |
1916 | const gfc_array_i8 * const restrict, | |
1917 | const GFC_INTEGER_8 * const restrict); | |
1918 | internal_proto(cshift1_8_c17); | |
1919 | #endif | |
1920 | ||
e56e3fda TK |
1921 | #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_COMPLEX_4) |
1922 | void cshift1_16_c4 (gfc_array_c4 * const restrict, | |
1923 | const gfc_array_c4 * const restrict, | |
1924 | const gfc_array_i16 * const restrict, | |
1925 | const GFC_INTEGER_16 * const restrict); | |
1926 | internal_proto(cshift1_16_c4); | |
1927 | #endif | |
1928 | ||
1929 | #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_COMPLEX_8) | |
1930 | void cshift1_16_c8 (gfc_array_c8 * const restrict, | |
1931 | const gfc_array_c8 * const restrict, | |
1932 | const gfc_array_i16 * const restrict, | |
1933 | const GFC_INTEGER_16 * const restrict); | |
1934 | internal_proto(cshift1_16_c8); | |
1935 | #endif | |
1936 | ||
1937 | #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_COMPLEX_10) | |
1938 | void cshift1_16_c10 (gfc_array_c10 * const restrict, | |
1939 | const gfc_array_c10 * const restrict, | |
1940 | const gfc_array_i16 * const restrict, | |
1941 | const GFC_INTEGER_16 * const restrict); | |
1942 | internal_proto(cshift1_16_c10); | |
1943 | #endif | |
1944 | ||
1945 | #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_COMPLEX_16) | |
1946 | void cshift1_16_c16 (gfc_array_c16 * const restrict, | |
1947 | const gfc_array_c16 * const restrict, | |
1948 | const gfc_array_i16 * const restrict, | |
1949 | const GFC_INTEGER_16 * const restrict); | |
1950 | internal_proto(cshift1_16_c16); | |
1951 | #endif | |
1952 | ||
23d11a0a JJ |
1953 | #if defined (HAVE_GFC_INTEGER_16) && defined (HAVE_GFC_COMPLEX_17) |
1954 | void cshift1_16_c17 (gfc_array_c17 * const restrict, | |
1955 | const gfc_array_c17 * const restrict, | |
1956 | const gfc_array_i16 * const restrict, | |
1957 | const GFC_INTEGER_16 * const restrict); | |
1958 | internal_proto(cshift1_16_c17); | |
1959 | #endif | |
1960 | ||
49ad4d2c TK |
1961 | /* Prototypes for the POWER __ieee128 functions. */ |
1962 | #ifdef POWER_IEEE128 | |
5097cdf9 | 1963 | extern _Float128 __acoshieee128 (_Float128) |
07c60b8e | 1964 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 1965 | extern _Float128 __acosieee128 (_Float128) |
07c60b8e | 1966 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 1967 | extern _Float128 __asinhieee128 (_Float128) |
07c60b8e | 1968 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 1969 | extern _Float128 __asinieee128 (_Float128) |
07c60b8e | 1970 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 1971 | extern _Float128 __atan2ieee128 (_Float128) |
07c60b8e | 1972 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 1973 | extern _Float128 __atanhieee128 (_Float128) |
07c60b8e | 1974 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 1975 | extern _Float128 __atanieee128 (_Float128) |
07c60b8e | 1976 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 1977 | extern _Float128 __copysignieee128 (_Float128, _Float128) |
4d0e778f | 1978 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 1979 | extern _Float128 __coshieee128 (_Float128) |
07c60b8e | 1980 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 1981 | extern _Float128 __cosieee128 (_Float128) |
07c60b8e | 1982 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 1983 | extern _Float128 __erfcieee128 (_Float128) |
5db042b2 | 1984 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 1985 | extern _Float128 __erfieee128 (_Float128) |
07c60b8e | 1986 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 1987 | extern _Float128 __expieee128 (_Float128) |
07c60b8e | 1988 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 1989 | extern _Float128 __fabsieee128 (_Float128) |
07c60b8e | 1990 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 1991 | extern _Float128 __fmaieee128 (_Float128, _Float128, _Float128) |
4d0e778f | 1992 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 1993 | extern _Float128 __fmodieee128 (_Float128, _Float128) |
4d0e778f | 1994 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 1995 | extern _Float128 __jnieee128 (int, _Float128) |
07c60b8e | 1996 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 1997 | extern _Float128 __log10ieee128 (_Float128) |
07c60b8e | 1998 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 1999 | extern _Float128 __logieee128 (_Float128) |
07c60b8e | 2000 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 2001 | extern _Float128 __powieee128 (_Float128) |
07c60b8e | 2002 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 2003 | extern _Float128 __sinhieee128 (_Float128) |
07c60b8e | 2004 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 2005 | extern _Float128 __sinieee128 (_Float128) |
07c60b8e | 2006 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 2007 | extern _Float128 __sqrtieee128 (_Float128) |
07c60b8e | 2008 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 2009 | extern _Float128 __tanhieee128 (_Float128) |
07c60b8e | 2010 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 2011 | extern _Float128 __tanieee128 (_Float128) |
07c60b8e | 2012 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 2013 | extern _Float128 __ynieee128 (int , _Float128) |
07c60b8e | 2014 | __attribute__ ((__nothrow__, __leaf__)); |
5097cdf9 | 2015 | extern _Float128 __strtoieee128 (const char *, char **) |
07c60b8e JJ |
2016 | __attribute__ ((__nothrow__, __leaf__)); |
2017 | extern int __snprintfieee128 (char *, size_t, const char *, ...) | |
2018 | __attribute__ ((__nothrow__)); | |
49ad4d2c TK |
2019 | |
2020 | #endif | |
2021 | ||
01ce9e31 TK |
2022 | /* We always have these. */ |
2023 | ||
2024 | #define HAVE_GFC_UINTEGER_1 1 | |
2025 | #define HAVE_GFC_UINTEGER_4 1 | |
e56e3fda | 2026 | |
69d3c9a4 | 2027 | #endif /* LIBGFOR_H */ |