1 /* Declarations of various C99 functions
2    Copyright (C) 2004-2018 Free Software Foundation, Inc.
3 
4 This file is part of the GNU Fortran 95 runtime library (libgfortran).
5 
6 Libgfortran is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
9 any later version.
10 
11 Libgfortran is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15 
16 Under Section 7 of GPL version 3, you are granted additional
17 permissions described in the GCC Runtime Library Exception, version
18 3.1, as published by the Free Software Foundation.
19 
20 You should have received a copy of the GNU General Public License and
21 a copy of the GCC Runtime Library Exception along with this program;
22 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
23 <http://www.gnu.org/licenses/>.  */
24 
25 #ifndef C99_PROTOS_H
26 #define C99_PROTOS_H 1
27 
28 /* float variants of libm functions */
29 #ifndef HAVE_ACOSF
30 #define HAVE_ACOSF 1
31 extern float acosf(float);
32 #endif
33 
34 #if HAVE_ACOSH && !HAVE_ACOSHF
35 #define HAVE_ACOSHF 1
36 extern float acoshf(float);
37 #endif
38 
39 #ifndef HAVE_ASINF
40 #define HAVE_ASINF 1
41 extern float asinf(float);
42 #endif
43 
44 #if HAVE_ASINH && !HAVE_ASINHF
45 #define HAVE_ASINHF 1
46 extern float asinhf(float);
47 #endif
48 
49 #ifndef HAVE_ATAN2F
50 #define HAVE_ATAN2F 1
51 extern float atan2f(float, float);
52 #endif
53 
54 #ifndef HAVE_ATANF
55 #define HAVE_ATANF 1
56 extern float atanf(float);
57 #endif
58 
59 #if HAVE_ATANH && !HAVE_ATANHF
60 #define HAVE_ATANHF 1
61 extern float atanhf(float);
62 #endif
63 
64 #ifndef HAVE_CEILF
65 #define HAVE_CEILF 1
66 extern float ceilf(float);
67 #endif
68 
69 #ifndef HAVE_COPYSIGNF
70 #define HAVE_COPYSIGNF 1
71 extern float copysignf(float, float);
72 #endif
73 
74 #ifndef HAVE_COSF
75 #define HAVE_COSF 1
76 extern float cosf(float);
77 #endif
78 
79 #ifndef HAVE_COSHF
80 #define HAVE_COSHF 1
81 extern float coshf(float);
82 #endif
83 
84 #ifndef HAVE_EXPF
85 #define HAVE_EXPF 1
86 extern float expf(float);
87 #endif
88 
89 #ifndef HAVE_FABSF
90 #define HAVE_FABSF 1
91 extern float fabsf(float);
92 #endif
93 
94 #ifndef HAVE_FLOORF
95 #define HAVE_FLOORF 1
96 extern float floorf(float);
97 #endif
98 
99 #ifndef HAVE_FLOORL
100 #define HAVE_FLOORL 1
101 extern long double floorl (long double x);
102 #endif
103 
104 #ifndef HAVE_FMODF
105 #define HAVE_FMODF 1
106 extern float fmodf (float x, float y);
107 #endif
108 
109 #ifndef HAVE_FMODL
110 #define HAVE_FMODL 1
111 extern long double fmodl (long double x, long double y);
112 #endif
113 
114 #ifndef HAVE_FREXPF
115 #define HAVE_FREXPF 1
116 extern float frexpf(float, int *);
117 #endif
118 
119 #ifndef HAVE_HYPOTF
120 #define HAVE_HYPOTF 1
121 extern float hypotf(float, float);
122 #endif
123 
124 #ifndef HAVE_LOGF
125 #define HAVE_LOGF 1
126 extern float logf(float);
127 #endif
128 
129 #ifndef HAVE_LOG10F
130 #define HAVE_LOG10F 1
131 extern float log10f(float);
132 #endif
133 
134 #ifndef HAVE_SCALBN
135 #define HAVE_SCALBN 1
136 extern double scalbn(double, int);
137 #endif
138 
139 #ifndef HAVE_SCALBNF
140 #define HAVE_SCALBNF 1
141 extern float scalbnf(float, int);
142 #endif
143 
144 #ifndef HAVE_SINF
145 #define HAVE_SINF 1
146 extern float sinf(float);
147 #endif
148 
149 #ifndef HAVE_SINHF
150 #define HAVE_SINHF 1
151 extern float sinhf(float);
152 #endif
153 
154 #ifndef HAVE_SQRTF
155 #define HAVE_SQRTF 1
156 extern float sqrtf(float);
157 #endif
158 
159 #ifndef HAVE_TANF
160 #define HAVE_TANF 1
161 extern float tanf(float);
162 #endif
163 
164 #ifndef HAVE_TANHF
165 #define HAVE_TANHF 1
166 extern float tanhf(float);
167 #endif
168 
169 #ifndef HAVE_TRUNC
170 #define HAVE_TRUNC 1
171 extern double trunc(double);
172 #endif
173 
174 #ifndef HAVE_TRUNCF
175 #define HAVE_TRUNCF 1
176 extern float truncf(float);
177 #endif
178 
179 #ifndef HAVE_NEXTAFTERF
180 #define HAVE_NEXTAFTERF 1
181 extern float nextafterf(float, float);
182 #endif
183 
184 #ifndef HAVE_POWF
185 #define HAVE_POWF 1
186 extern float powf(float, float);
187 #endif
188 
189 #ifndef HAVE_ROUND
190 #define HAVE_ROUND 1
191 extern double round(double);
192 #endif
193 
194 #ifndef HAVE_ROUNDF
195 #define HAVE_ROUNDF 1
196 extern float roundf(float);
197 #endif
198 
199 #if !defined(HAVE_ROUNDL)
200 #define HAVE_ROUNDL 1
201 extern long double roundl(long double);
202 #endif
203 
204 
205 
206 #if !defined(HAVE_LROUNDF) && defined(HAVE_ROUNDF)
207 #define HAVE_LROUNDF 1
208 long int lroundf (float);
209 #endif
210 
211 #if !defined(HAVE_LROUND) && defined(HAVE_ROUND)
212 #define HAVE_LROUND 1
213 long int lround (double);
214 #endif
215 
216 #if !defined(HAVE_LROUNDL) && defined(HAVE_ROUNDL)
217 #define HAVE_LROUNDL 1
218 long int lroundl (long double);
219 #endif
220 
221 #if !defined(HAVE_LLROUNDF) && defined(HAVE_ROUNDF)
222 #define HAVE_LLROUNDF 1
223 long long int llroundf (float);
224 #endif
225 
226 #if !defined(HAVE_LLROUND) && defined(HAVE_ROUND)
227 #define HAVE_LLROUND 1
228 long long int llround (double);
229 #endif
230 
231 #if !defined(HAVE_LLROUNDL) && defined(HAVE_ROUNDL)
232 #define HAVE_LLROUNDL 1
233 long long int llroundl (long double);
234 #endif
235 
236 /* Wrappers for systems without the various C99 single precision Bessel
237    functions.  */
238 
239 #if defined(HAVE_J0) && ! defined(HAVE_J0F)
240 #define HAVE_J0F 1
241 extern float j0f (float);
242 #endif
243 
244 #if defined(HAVE_J1) && !defined(HAVE_J1F)
245 #define HAVE_J1F 1
246 extern float j1f (float);
247 #endif
248 
249 #if defined(HAVE_JN) && !defined(HAVE_JNF)
250 #define HAVE_JNF 1
251 extern float jnf (int, float);
252 #endif
253 
254 #if defined(HAVE_Y0) && !defined(HAVE_Y0F)
255 #define HAVE_Y0F 1
256 extern float y0f (float);
257 #endif
258 
259 #if defined(HAVE_Y1) && !defined(HAVE_Y1F)
260 #define HAVE_Y1F 1
261 extern float y1f (float);
262 #endif
263 
264 #if defined(HAVE_YN) && !defined(HAVE_YNF)
265 #define HAVE_YNF 1
266 extern float ynf (int, float);
267 #endif
268 
269 
270 /* Wrappers for systems without the C99 erff() and erfcf() functions.  */
271 
272 #if defined(HAVE_ERF) && !defined(HAVE_ERFF)
273 #define HAVE_ERFF 1
274 extern float erff (float);
275 #endif
276 
277 #if defined(HAVE_ERFC) && !defined(HAVE_ERFCF)
278 #define HAVE_ERFCF 1
279 extern float erfcf (float);
280 #endif
281 
282 
283 
284 /* log10l is needed on all platforms for decimal I/O */
285 #ifndef HAVE_LOG10L
286 #define HAVE_LOG10L 1
287 extern long double log10l(long double);
288 #endif
289 
290 
291 /* complex math functions */
292 
293 #if !defined(HAVE_CABSF)
294 #define HAVE_CABSF 1
295 extern float cabsf (float complex);
296 #endif
297 
298 #if !defined(HAVE_CABS)
299 #define HAVE_CABS 1
300 extern double cabs (double complex);
301 #endif
302 
303 #if !defined(HAVE_CABSL) && defined(HAVE_HYPOTL)
304 #define HAVE_CABSL 1
305 extern long double cabsl (long double complex);
306 #endif
307 
308 
309 #if !defined(HAVE_CARGF)
310 #define HAVE_CARGF 1
311 extern float cargf (float complex);
312 #endif
313 
314 #if !defined(HAVE_CARG)
315 #define HAVE_CARG 1
316 extern double carg (double complex);
317 #endif
318 
319 #if !defined(HAVE_CARGL) && defined(HAVE_ATAN2L)
320 #define HAVE_CARGL 1
321 extern long double cargl (long double complex);
322 #endif
323 
324 
325 #if !defined(HAVE_CEXPF)
326 #define HAVE_CEXPF 1
327 extern float complex cexpf (float complex);
328 #endif
329 
330 #if !defined(HAVE_CEXP)
331 #define HAVE_CEXP 1
332 extern double complex cexp (double complex);
333 #endif
334 
335 #if !defined(HAVE_CEXPL) && defined(HAVE_COSL) && defined(HAVE_SINL) && defined(HAVE_EXPL)
336 #define HAVE_CEXPL 1
337 extern long double complex cexpl (long double complex);
338 #endif
339 
340 
341 #if !defined(HAVE_CLOGF)
342 #define HAVE_CLOGF 1
343 extern float complex clogf (float complex);
344 #endif
345 
346 #if !defined(HAVE_CLOG)
347 #define HAVE_CLOG 1
348 extern double complex clog (double complex);
349 #endif
350 
351 #if !defined(HAVE_CLOGL) && defined(HAVE_LOGL) && defined(HAVE_CABSL) && defined(HAVE_CARGL)
352 #define HAVE_CLOGL 1
353 extern long double complex clogl (long double complex);
354 #endif
355 
356 
357 #if !defined(HAVE_CLOG10F)
358 #define HAVE_CLOG10F 1
359 extern float complex clog10f (float complex);
360 #endif
361 
362 #if !defined(HAVE_CLOG10)
363 #define HAVE_CLOG10 1
364 extern double complex clog10 (double complex);
365 #endif
366 
367 #if !defined(HAVE_CLOG10L) && defined(HAVE_LOG10L) && defined(HAVE_CABSL) && defined(HAVE_CARGL)
368 #define HAVE_CLOG10L 1
369 extern long double complex clog10l (long double complex);
370 #endif
371 
372 
373 #if !defined(HAVE_CPOWF)
374 #define HAVE_CPOWF 1
375 extern float complex cpowf (float complex, float complex);
376 #endif
377 
378 #if !defined(HAVE_CPOW)
379 #define HAVE_CPOW 1
380 extern double complex cpow (double complex, double complex);
381 #endif
382 
383 #if !defined(HAVE_CPOWL) && defined(HAVE_CEXPL) && defined(HAVE_CLOGL)
384 #define HAVE_CPOWL 1
385 extern long double complex cpowl (long double complex, long double complex);
386 #endif
387 
388 
389 #if !defined(HAVE_CSQRTF)
390 #define HAVE_CSQRTF 1
391 extern float complex csqrtf (float complex);
392 #endif
393 
394 #if !defined(HAVE_CSQRT)
395 #define HAVE_CSQRT 1
396 extern double complex csqrt (double complex);
397 #endif
398 
399 #if !defined(HAVE_CSQRTL) && defined(HAVE_COPYSIGNL) && defined(HAVE_SQRTL) && defined(HAVE_FABSL) && defined(HAVE_HYPOTL)
400 #define HAVE_CSQRTL 1
401 extern long double complex csqrtl (long double complex);
402 #endif
403 
404 
405 #if !defined(HAVE_CSINHF)
406 #define HAVE_CSINHF 1
407 extern float complex csinhf (float complex);
408 #endif
409 
410 #if !defined(HAVE_CSINH)
411 #define HAVE_CSINH 1
412 extern double complex csinh (double complex);
413 #endif
414 
415 #if !defined(HAVE_CSINHL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
416 #define HAVE_CSINHL 1
417 extern long double complex csinhl (long double complex);
418 #endif
419 
420 
421 #if !defined(HAVE_CCOSHF)
422 #define HAVE_CCOSHF 1
423 extern float complex ccoshf (float complex);
424 #endif
425 
426 #if !defined(HAVE_CCOSH)
427 #define HAVE_CCOSH 1
428 extern double complex ccosh (double complex);
429 #endif
430 
431 #if !defined(HAVE_CCOSHL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
432 #define HAVE_CCOSHL 1
433 extern long double complex ccoshl (long double complex);
434 #endif
435 
436 
437 #if !defined(HAVE_CTANHF)
438 #define HAVE_CTANHF 1
439 extern float complex ctanhf (float complex);
440 #endif
441 
442 #if !defined(HAVE_CTANH)
443 #define HAVE_CTANH 1
444 extern double complex ctanh (double complex);
445 #endif
446 
447 #if !defined(HAVE_CTANHL) && defined(HAVE_TANL) && defined(HAVE_TANHL)
448 #define HAVE_CTANHL 1
449 extern long double complex ctanhl (long double complex);
450 #endif
451 
452 
453 #if !defined(HAVE_CSINF)
454 #define HAVE_CSINF 1
455 extern float complex csinf (float complex);
456 #endif
457 
458 #if !defined(HAVE_CSIN)
459 #define HAVE_CSIN 1
460 extern double complex csin (double complex);
461 #endif
462 
463 #if !defined(HAVE_CSINL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
464 #define HAVE_CSINL 1
465 extern long double complex csinl (long double complex);
466 #endif
467 
468 
469 #if !defined(HAVE_CCOSF)
470 #define HAVE_CCOSF 1
471 extern float complex ccosf (float complex);
472 #endif
473 
474 #if !defined(HAVE_CCOS)
475 #define HAVE_CCOS 1
476 extern double complex ccos (double complex);
477 #endif
478 
479 #if !defined(HAVE_CCOSL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
480 #define HAVE_CCOSL 1
481 extern long double complex ccosl (long double complex);
482 #endif
483 
484 
485 #if !defined(HAVE_CTANF)
486 #define HAVE_CTANF 1
487 extern float complex ctanf (float complex);
488 #endif
489 
490 #if !defined(HAVE_CTAN)
491 #define HAVE_CTAN 1
492 extern double complex ctan (double complex);
493 #endif
494 
495 #if !defined(HAVE_CTANL) && defined(HAVE_TANL) && defined(HAVE_TANHL)
496 #define HAVE_CTANL 1
497 extern long double complex ctanl (long double complex);
498 #endif
499 
500 
501 /* Complex ACOS.  */
502 
503 #if !defined(HAVE_CACOSF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
504 #define HAVE_CACOSF 1
505 extern complex float cacosf (complex float z);
506 #endif
507 
508 #if !defined(HAVE_CACOS) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
509 #define HAVE_CACOS 1
510 extern complex double cacos (complex double z);
511 #endif
512 
513 #if !defined(HAVE_CACOSL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
514 #define HAVE_CACOSL 1
515 extern complex long double cacosl (complex long double z);
516 #endif
517 
518 
519 /* Complex ASIN.  */
520 
521 #if !defined(HAVE_CASINF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
522 #define HAVE_CASINF 1
523 extern complex float casinf (complex float z);
524 #endif
525 
526 #if !defined(HAVE_CASIN) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
527 #define HAVE_CASIN 1
528 extern complex double casin (complex double z);
529 #endif
530 
531 #if !defined(HAVE_CASINL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
532 #define HAVE_CASINL 1
533 extern complex long double casinl (complex long double z);
534 #endif
535 
536 
537 /* Complex ATAN.  */
538 
539 #if !defined(HAVE_CATANF) && defined(HAVE_CLOGF)
540 #define HAVE_CATANF 1
541 extern complex float catanf (complex float z);
542 #endif
543 
544 #if !defined(HAVE_CATAN) && defined(HAVE_CLOG)
545 #define HAVE_CATAN 1
546 extern complex double catan (complex double z);
547 #endif
548 
549 #if !defined(HAVE_CATANL) && defined(HAVE_CLOGL)
550 #define HAVE_CATANL 1
551 extern complex long double catanl (complex long double z);
552 #endif
553 
554 
555 /* Complex ASINH.  */
556 
557 #if !defined(HAVE_CASINHF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
558 #define HAVE_CASINHF 1
559 extern complex float casinhf (complex float z);
560 #endif
561 
562 
563 #if !defined(HAVE_CASINH) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
564 #define HAVE_CASINH 1
565 extern complex double casinh (complex double z);
566 #endif
567 
568 #if !defined(HAVE_CASINHL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
569 #define HAVE_CASINHL 1
570 extern complex long double casinhl (complex long double z);
571 #endif
572 
573 
574 /* Complex ACOSH.  */
575 
576 #if !defined(HAVE_CACOSHF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
577 #define HAVE_CACOSHF 1
578 extern complex float cacoshf (complex float z);
579 #endif
580 
581 #if !defined(HAVE_CACOSH) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
582 #define HAVE_CACOSH 1
583 extern complex double cacosh (complex double z);
584 #endif
585 
586 #if !defined(HAVE_CACOSHL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
587 #define HAVE_CACOSHL 1
588 extern complex long double cacoshl (complex long double z);
589 #endif
590 
591 
592 /* Complex ATANH.  */
593 
594 #if !defined(HAVE_CATANHF) && defined(HAVE_CLOGF)
595 #define HAVE_CATANHF 1
596 extern complex float catanhf (complex float z);
597 #endif
598 
599 #if !defined(HAVE_CATANH) && defined(HAVE_CLOG)
600 #define HAVE_CATANH 1
601 extern complex double catanh (complex double z);
602 #endif
603 
604 #if !defined(HAVE_CATANHL) && defined(HAVE_CLOGL)
605 #define HAVE_CATANHL 1
606 extern complex long double catanhl (complex long double z);
607 #endif
608 
609 
610 /* Gamma-related prototypes.  */
611 #if !defined(HAVE_TGAMMA)
612 #define HAVE_TGAMMA 1
613 extern double tgamma (double);
614 #endif
615 
616 #if !defined(HAVE_LGAMMA)
617 #define HAVE_LGAMMA 1
618 extern double lgamma (double);
619 #endif
620 
621 #if defined(HAVE_TGAMMA) && !defined(HAVE_TGAMMAF)
622 #define HAVE_TGAMMAF 1
623 extern float tgammaf (float);
624 #endif
625 
626 #if defined(HAVE_LGAMMA) && !defined(HAVE_LGAMMAF)
627 #define HAVE_LGAMMAF 1
628 extern float lgammaf (float);
629 #endif
630 
631 
632 #endif  /* C99_PROTOS_H  */
633 
634