1 /* Declarations of various C99 functions
2 Copyright (C) 2004-2022 Free Software Foundation, Inc.
4 This file is part of the GNU Fortran 95 runtime library (libgfortran).
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)
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.
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.
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/>. */
26 #define C99_PROTOS_H 1
28 /* float variants of libm functions */
31 extern float acosf(float);
34 #if HAVE_ACOSH && !HAVE_ACOSHF
36 extern float acoshf(float);
41 extern float asinf(float);
44 #if HAVE_ASINH && !HAVE_ASINHF
46 extern float asinhf(float);
51 extern float atan2f(float, float);
56 extern float atanf(float);
59 #if HAVE_ATANH && !HAVE_ATANHF
61 extern float atanhf(float);
66 extern float ceilf(float);
69 #ifndef HAVE_COPYSIGNF
70 #define HAVE_COPYSIGNF 1
71 extern float copysignf(float, float);
74 #if !defined(HAVE_COPYSIGN) && defined(HAVE_INLINE_BUILTIN_COPYSIGN)
75 #define HAVE_COPYSIGN 1
76 extern double copysign(double, double);
79 #if !defined(HAVE_COPYSIGNL) && defined(HAVE_INLINE_BUILTIN_COPYSIGNL)
80 #define HAVE_COPYSIGNL 1
81 extern long double copysignl(long double, long double);
86 extern float cosf(float);
91 extern float coshf(float);
96 extern float expf(float);
101 extern float fabsf(float);
104 #if !defined(HAVE_FABS) && defined(HAVE_INLINE_BUILTIN_FABS)
106 extern double fabs(double);
109 #if !defined(HAVE_FABSL) && defined(HAVE_INLINE_BUILTIN_FABSL)
111 extern long double fabsl(long double);
115 #define HAVE_FLOORF 1
116 extern float floorf(float);
120 #define HAVE_FLOORL 1
121 extern long double floorl (long double x
);
126 extern float fmodf (float x
, float y
);
131 extern long double fmodl (long double x
, long double y
);
135 #define HAVE_FREXPF 1
136 extern float frexpf(float, int *);
140 #define HAVE_HYPOTF 1
141 extern float hypotf(float, float);
146 extern float logf(float);
150 #define HAVE_LOG10F 1
151 extern float log10f(float);
155 #define HAVE_SCALBN 1
156 extern double scalbn(double, int);
160 #define HAVE_SCALBNF 1
161 extern float scalbnf(float, int);
166 extern float sinf(float);
171 extern float sinhf(float);
176 extern float sqrtf(float);
181 extern float tanf(float);
186 extern float tanhf(float);
191 extern double trunc(double);
195 #define HAVE_TRUNCF 1
196 extern float truncf(float);
199 #ifndef HAVE_NEXTAFTERF
200 #define HAVE_NEXTAFTERF 1
201 extern float nextafterf(float, float);
206 extern float powf(float, float);
211 extern double round(double);
215 #define HAVE_ROUNDF 1
216 extern float roundf(float);
219 #if !defined(HAVE_ROUNDL)
220 #define HAVE_ROUNDL 1
221 extern long double roundl(long double);
226 #if !defined(HAVE_LROUNDF) && defined(HAVE_ROUNDF)
227 #define HAVE_LROUNDF 1
228 long int lroundf (float);
231 #if !defined(HAVE_LROUND) && defined(HAVE_ROUND)
232 #define HAVE_LROUND 1
233 long int lround (double);
236 #if !defined(HAVE_LROUNDL) && defined(HAVE_ROUNDL)
237 #define HAVE_LROUNDL 1
238 long int lroundl (long double);
241 #if !defined(HAVE_LLROUNDF) && defined(HAVE_ROUNDF)
242 #define HAVE_LLROUNDF 1
243 long long int llroundf (float);
246 #if !defined(HAVE_LLROUND) && defined(HAVE_ROUND)
247 #define HAVE_LLROUND 1
248 long long int llround (double);
251 #if !defined(HAVE_LLROUNDL) && defined(HAVE_ROUNDL)
252 #define HAVE_LLROUNDL 1
253 long long int llroundl (long double);
256 /* Wrappers for systems without the various C99 single precision Bessel
259 #if defined(HAVE_J0) && ! defined(HAVE_J0F)
261 extern float j0f (float);
264 #if defined(HAVE_J1) && !defined(HAVE_J1F)
266 extern float j1f (float);
269 #if defined(HAVE_JN) && !defined(HAVE_JNF)
271 extern float jnf (int, float);
274 #if defined(HAVE_Y0) && !defined(HAVE_Y0F)
276 extern float y0f (float);
279 #if defined(HAVE_Y1) && !defined(HAVE_Y1F)
281 extern float y1f (float);
284 #if defined(HAVE_YN) && !defined(HAVE_YNF)
286 extern float ynf (int, float);
290 /* Wrappers for systems without the C99 erff() and erfcf() functions. */
292 #if defined(HAVE_ERF) && !defined(HAVE_ERFF)
294 extern float erff (float);
297 #if defined(HAVE_ERFC) && !defined(HAVE_ERFCF)
299 extern float erfcf (float);
304 /* log10l is needed on all platforms for decimal I/O */
306 #define HAVE_LOG10L 1
307 extern long double log10l(long double);
311 /* complex math functions */
313 #if !defined(HAVE_CABSF)
315 extern float cabsf (float complex);
318 #if !defined(HAVE_CABS)
320 extern double cabs (double complex);
323 #if !defined(HAVE_CABSL) && defined(HAVE_HYPOTL)
325 extern long double cabsl (long double complex);
329 #if !defined(HAVE_CARGF)
331 extern float cargf (float complex);
334 #if !defined(HAVE_CARG)
336 extern double carg (double complex);
339 #if !defined(HAVE_CARGL) && defined(HAVE_ATAN2L)
341 extern long double cargl (long double complex);
345 #if !defined(HAVE_CEXPF)
347 extern float complex cexpf (float complex);
350 #if !defined(HAVE_CEXP)
352 extern double complex cexp (double complex);
355 #if !defined(HAVE_CEXPL) && defined(HAVE_COSL) && defined(HAVE_SINL) && defined(HAVE_EXPL)
357 extern long double complex cexpl (long double complex);
361 #if !defined(HAVE_CLOGF)
363 extern float complex clogf (float complex);
366 #if !defined(HAVE_CLOG)
368 extern double complex clog (double complex);
371 #if !defined(HAVE_CLOGL) && defined(HAVE_LOGL) && defined(HAVE_CABSL) && defined(HAVE_CARGL)
373 extern long double complex clogl (long double complex);
377 #if !defined(HAVE_CLOG10F)
378 #define HAVE_CLOG10F 1
379 extern float complex clog10f (float complex);
382 #if !defined(HAVE_CLOG10)
383 #define HAVE_CLOG10 1
384 extern double complex clog10 (double complex);
387 #if !defined(HAVE_CLOG10L) && defined(HAVE_LOG10L) && defined(HAVE_CABSL) && defined(HAVE_CARGL)
388 #define HAVE_CLOG10L 1
389 extern long double complex clog10l (long double complex);
393 #if !defined(HAVE_CPOWF)
395 extern float complex cpowf (float complex, float complex);
398 #if !defined(HAVE_CPOW)
400 extern double complex cpow (double complex, double complex);
403 #if !defined(HAVE_CPOWL) && defined(HAVE_CEXPL) && defined(HAVE_CLOGL)
405 extern long double complex cpowl (long double complex, long double complex);
409 #if !defined(HAVE_CSQRTF)
410 #define HAVE_CSQRTF 1
411 extern float complex csqrtf (float complex);
414 #if !defined(HAVE_CSQRT)
416 extern double complex csqrt (double complex);
419 #if !defined(HAVE_CSQRTL) && defined(HAVE_COPYSIGNL) && defined(HAVE_SQRTL) && defined(HAVE_FABSL) && defined(HAVE_HYPOTL)
420 #define HAVE_CSQRTL 1
421 extern long double complex csqrtl (long double complex);
425 #if !defined(HAVE_CSINHF)
426 #define HAVE_CSINHF 1
427 extern float complex csinhf (float complex);
430 #if !defined(HAVE_CSINH)
432 extern double complex csinh (double complex);
435 #if !defined(HAVE_CSINHL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
436 #define HAVE_CSINHL 1
437 extern long double complex csinhl (long double complex);
441 #if !defined(HAVE_CCOSHF)
442 #define HAVE_CCOSHF 1
443 extern float complex ccoshf (float complex);
446 #if !defined(HAVE_CCOSH)
448 extern double complex ccosh (double complex);
451 #if !defined(HAVE_CCOSHL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
452 #define HAVE_CCOSHL 1
453 extern long double complex ccoshl (long double complex);
457 #if !defined(HAVE_CTANHF)
458 #define HAVE_CTANHF 1
459 extern float complex ctanhf (float complex);
462 #if !defined(HAVE_CTANH)
464 extern double complex ctanh (double complex);
467 #if !defined(HAVE_CTANHL) && defined(HAVE_TANL) && defined(HAVE_TANHL)
468 #define HAVE_CTANHL 1
469 extern long double complex ctanhl (long double complex);
473 #if !defined(HAVE_CSINF)
475 extern float complex csinf (float complex);
478 #if !defined(HAVE_CSIN)
480 extern double complex csin (double complex);
483 #if !defined(HAVE_CSINL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
485 extern long double complex csinl (long double complex);
489 #if !defined(HAVE_CCOSF)
491 extern float complex ccosf (float complex);
494 #if !defined(HAVE_CCOS)
496 extern double complex ccos (double complex);
499 #if !defined(HAVE_CCOSL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
501 extern long double complex ccosl (long double complex);
505 #if !defined(HAVE_CTANF)
507 extern float complex ctanf (float complex);
510 #if !defined(HAVE_CTAN)
512 extern double complex ctan (double complex);
515 #if !defined(HAVE_CTANL) && defined(HAVE_TANL) && defined(HAVE_TANHL)
517 extern long double complex ctanl (long double complex);
523 #if !defined(HAVE_CACOSF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
524 #define HAVE_CACOSF 1
525 extern complex float cacosf (complex float z
);
528 #if !defined(HAVE_CACOS) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
530 extern complex double cacos (complex double z
);
533 #if !defined(HAVE_CACOSL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
534 #define HAVE_CACOSL 1
535 extern complex long double cacosl (complex long double z
);
541 #if !defined(HAVE_CASINF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
542 #define HAVE_CASINF 1
543 extern complex float casinf (complex float z
);
546 #if !defined(HAVE_CASIN) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
548 extern complex double casin (complex double z
);
551 #if !defined(HAVE_CASINL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
552 #define HAVE_CASINL 1
553 extern complex long double casinl (complex long double z
);
559 #if !defined(HAVE_CATANF) && defined(HAVE_CLOGF)
560 #define HAVE_CATANF 1
561 extern complex float catanf (complex float z
);
564 #if !defined(HAVE_CATAN) && defined(HAVE_CLOG)
566 extern complex double catan (complex double z
);
569 #if !defined(HAVE_CATANL) && defined(HAVE_CLOGL)
570 #define HAVE_CATANL 1
571 extern complex long double catanl (complex long double z
);
577 #if !defined(HAVE_CASINHF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
578 #define HAVE_CASINHF 1
579 extern complex float casinhf (complex float z
);
583 #if !defined(HAVE_CASINH) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
584 #define HAVE_CASINH 1
585 extern complex double casinh (complex double z
);
588 #if !defined(HAVE_CASINHL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
589 #define HAVE_CASINHL 1
590 extern complex long double casinhl (complex long double z
);
596 #if !defined(HAVE_CACOSHF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
597 #define HAVE_CACOSHF 1
598 extern complex float cacoshf (complex float z
);
601 #if !defined(HAVE_CACOSH) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
602 #define HAVE_CACOSH 1
603 extern complex double cacosh (complex double z
);
606 #if !defined(HAVE_CACOSHL) && defined(HAVE_CLOGL) && defined(HAVE_CSQRTL)
607 #define HAVE_CACOSHL 1
608 extern complex long double cacoshl (complex long double z
);
614 #if !defined(HAVE_CATANHF) && defined(HAVE_CLOGF)
615 #define HAVE_CATANHF 1
616 extern complex float catanhf (complex float z
);
619 #if !defined(HAVE_CATANH) && defined(HAVE_CLOG)
620 #define HAVE_CATANH 1
621 extern complex double catanh (complex double z
);
624 #if !defined(HAVE_CATANHL) && defined(HAVE_CLOGL)
625 #define HAVE_CATANHL 1
626 extern complex long double catanhl (complex long double z
);
630 /* Gamma-related prototypes. */
631 #if !defined(HAVE_TGAMMA)
632 #define HAVE_TGAMMA 1
633 extern double tgamma (double);
636 #if !defined(HAVE_LGAMMA)
637 #define HAVE_LGAMMA 1
638 extern double lgamma (double);
641 #if defined(HAVE_TGAMMA) && !defined(HAVE_TGAMMAF)
642 #define HAVE_TGAMMAF 1
643 extern float tgammaf (float);
646 #if defined(HAVE_LGAMMA) && !defined(HAVE_LGAMMAF)
647 #define HAVE_LGAMMAF 1
648 extern float lgammaf (float);
653 extern double fma(double, double, double);
658 extern float fmaf(float, float, float);
663 extern long double fmal(long double, long double, long double);
666 #endif /* C99_PROTOS_H */