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