1 /* Declarations of various C99 functions
2 Copyright (C) 2004-2019 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);
76 extern float cosf(float);
81 extern float coshf(float);
86 extern float expf(float);
91 extern float fabsf(float);
96 extern float floorf(float);
100 #define HAVE_FLOORL 1
101 extern long double floorl (long double x
);
106 extern float fmodf (float x
, float y
);
111 extern long double fmodl (long double x
, long double y
);
115 #define HAVE_FREXPF 1
116 extern float frexpf(float, int *);
120 #define HAVE_HYPOTF 1
121 extern float hypotf(float, float);
126 extern float logf(float);
130 #define HAVE_LOG10F 1
131 extern float log10f(float);
135 #define HAVE_SCALBN 1
136 extern double scalbn(double, int);
140 #define HAVE_SCALBNF 1
141 extern float scalbnf(float, int);
146 extern float sinf(float);
151 extern float sinhf(float);
156 extern float sqrtf(float);
161 extern float tanf(float);
166 extern float tanhf(float);
171 extern double trunc(double);
175 #define HAVE_TRUNCF 1
176 extern float truncf(float);
179 #ifndef HAVE_NEXTAFTERF
180 #define HAVE_NEXTAFTERF 1
181 extern float nextafterf(float, float);
186 extern float powf(float, float);
191 extern double round(double);
195 #define HAVE_ROUNDF 1
196 extern float roundf(float);
199 #if !defined(HAVE_ROUNDL)
200 #define HAVE_ROUNDL 1
201 extern long double roundl(long double);
206 #if !defined(HAVE_LROUNDF) && defined(HAVE_ROUNDF)
207 #define HAVE_LROUNDF 1
208 long int lroundf (float);
211 #if !defined(HAVE_LROUND) && defined(HAVE_ROUND)
212 #define HAVE_LROUND 1
213 long int lround (double);
216 #if !defined(HAVE_LROUNDL) && defined(HAVE_ROUNDL)
217 #define HAVE_LROUNDL 1
218 long int lroundl (long double);
221 #if !defined(HAVE_LLROUNDF) && defined(HAVE_ROUNDF)
222 #define HAVE_LLROUNDF 1
223 long long int llroundf (float);
226 #if !defined(HAVE_LLROUND) && defined(HAVE_ROUND)
227 #define HAVE_LLROUND 1
228 long long int llround (double);
231 #if !defined(HAVE_LLROUNDL) && defined(HAVE_ROUNDL)
232 #define HAVE_LLROUNDL 1
233 long long int llroundl (long double);
236 /* Wrappers for systems without the various C99 single precision Bessel
239 #if defined(HAVE_J0) && ! defined(HAVE_J0F)
241 extern float j0f (float);
244 #if defined(HAVE_J1) && !defined(HAVE_J1F)
246 extern float j1f (float);
249 #if defined(HAVE_JN) && !defined(HAVE_JNF)
251 extern float jnf (int, float);
254 #if defined(HAVE_Y0) && !defined(HAVE_Y0F)
256 extern float y0f (float);
259 #if defined(HAVE_Y1) && !defined(HAVE_Y1F)
261 extern float y1f (float);
264 #if defined(HAVE_YN) && !defined(HAVE_YNF)
266 extern float ynf (int, float);
270 /* Wrappers for systems without the C99 erff() and erfcf() functions. */
272 #if defined(HAVE_ERF) && !defined(HAVE_ERFF)
274 extern float erff (float);
277 #if defined(HAVE_ERFC) && !defined(HAVE_ERFCF)
279 extern float erfcf (float);
284 /* log10l is needed on all platforms for decimal I/O */
286 #define HAVE_LOG10L 1
287 extern long double log10l(long double);
291 /* complex math functions */
293 #if !defined(HAVE_CABSF)
295 extern float cabsf (float complex);
298 #if !defined(HAVE_CABS)
300 extern double cabs (double complex);
303 #if !defined(HAVE_CABSL) && defined(HAVE_HYPOTL)
305 extern long double cabsl (long double complex);
309 #if !defined(HAVE_CARGF)
311 extern float cargf (float complex);
314 #if !defined(HAVE_CARG)
316 extern double carg (double complex);
319 #if !defined(HAVE_CARGL) && defined(HAVE_ATAN2L)
321 extern long double cargl (long double complex);
325 #if !defined(HAVE_CEXPF)
327 extern float complex cexpf (float complex);
330 #if !defined(HAVE_CEXP)
332 extern double complex cexp (double complex);
335 #if !defined(HAVE_CEXPL) && defined(HAVE_COSL) && defined(HAVE_SINL) && defined(HAVE_EXPL)
337 extern long double complex cexpl (long double complex);
341 #if !defined(HAVE_CLOGF)
343 extern float complex clogf (float complex);
346 #if !defined(HAVE_CLOG)
348 extern double complex clog (double complex);
351 #if !defined(HAVE_CLOGL) && defined(HAVE_LOGL) && defined(HAVE_CABSL) && defined(HAVE_CARGL)
353 extern long double complex clogl (long double complex);
357 #if !defined(HAVE_CLOG10F)
358 #define HAVE_CLOG10F 1
359 extern float complex clog10f (float complex);
362 #if !defined(HAVE_CLOG10)
363 #define HAVE_CLOG10 1
364 extern double complex clog10 (double complex);
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);
373 #if !defined(HAVE_CPOWF)
375 extern float complex cpowf (float complex, float complex);
378 #if !defined(HAVE_CPOW)
380 extern double complex cpow (double complex, double complex);
383 #if !defined(HAVE_CPOWL) && defined(HAVE_CEXPL) && defined(HAVE_CLOGL)
385 extern long double complex cpowl (long double complex, long double complex);
389 #if !defined(HAVE_CSQRTF)
390 #define HAVE_CSQRTF 1
391 extern float complex csqrtf (float complex);
394 #if !defined(HAVE_CSQRT)
396 extern double complex csqrt (double complex);
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);
405 #if !defined(HAVE_CSINHF)
406 #define HAVE_CSINHF 1
407 extern float complex csinhf (float complex);
410 #if !defined(HAVE_CSINH)
412 extern double complex csinh (double complex);
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);
421 #if !defined(HAVE_CCOSHF)
422 #define HAVE_CCOSHF 1
423 extern float complex ccoshf (float complex);
426 #if !defined(HAVE_CCOSH)
428 extern double complex ccosh (double complex);
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);
437 #if !defined(HAVE_CTANHF)
438 #define HAVE_CTANHF 1
439 extern float complex ctanhf (float complex);
442 #if !defined(HAVE_CTANH)
444 extern double complex ctanh (double complex);
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);
453 #if !defined(HAVE_CSINF)
455 extern float complex csinf (float complex);
458 #if !defined(HAVE_CSIN)
460 extern double complex csin (double complex);
463 #if !defined(HAVE_CSINL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
465 extern long double complex csinl (long double complex);
469 #if !defined(HAVE_CCOSF)
471 extern float complex ccosf (float complex);
474 #if !defined(HAVE_CCOS)
476 extern double complex ccos (double complex);
479 #if !defined(HAVE_CCOSL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
481 extern long double complex ccosl (long double complex);
485 #if !defined(HAVE_CTANF)
487 extern float complex ctanf (float complex);
490 #if !defined(HAVE_CTAN)
492 extern double complex ctan (double complex);
495 #if !defined(HAVE_CTANL) && defined(HAVE_TANL) && defined(HAVE_TANHL)
497 extern long double complex ctanl (long double complex);
503 #if !defined(HAVE_CACOSF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
504 #define HAVE_CACOSF 1
505 extern complex float cacosf (complex float z
);
508 #if !defined(HAVE_CACOS) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
510 extern complex double cacos (complex double z
);
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
);
521 #if !defined(HAVE_CASINF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
522 #define HAVE_CASINF 1
523 extern complex float casinf (complex float z
);
526 #if !defined(HAVE_CASIN) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
528 extern complex double casin (complex double z
);
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
);
539 #if !defined(HAVE_CATANF) && defined(HAVE_CLOGF)
540 #define HAVE_CATANF 1
541 extern complex float catanf (complex float z
);
544 #if !defined(HAVE_CATAN) && defined(HAVE_CLOG)
546 extern complex double catan (complex double z
);
549 #if !defined(HAVE_CATANL) && defined(HAVE_CLOGL)
550 #define HAVE_CATANL 1
551 extern complex long double catanl (complex long double z
);
557 #if !defined(HAVE_CASINHF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
558 #define HAVE_CASINHF 1
559 extern complex float casinhf (complex float z
);
563 #if !defined(HAVE_CASINH) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
564 #define HAVE_CASINH 1
565 extern complex double casinh (complex double z
);
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
);
576 #if !defined(HAVE_CACOSHF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
577 #define HAVE_CACOSHF 1
578 extern complex float cacoshf (complex float z
);
581 #if !defined(HAVE_CACOSH) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
582 #define HAVE_CACOSH 1
583 extern complex double cacosh (complex double z
);
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
);
594 #if !defined(HAVE_CATANHF) && defined(HAVE_CLOGF)
595 #define HAVE_CATANHF 1
596 extern complex float catanhf (complex float z
);
599 #if !defined(HAVE_CATANH) && defined(HAVE_CLOG)
600 #define HAVE_CATANH 1
601 extern complex double catanh (complex double z
);
604 #if !defined(HAVE_CATANHL) && defined(HAVE_CLOGL)
605 #define HAVE_CATANHL 1
606 extern complex long double catanhl (complex long double z
);
610 /* Gamma-related prototypes. */
611 #if !defined(HAVE_TGAMMA)
612 #define HAVE_TGAMMA 1
613 extern double tgamma (double);
616 #if !defined(HAVE_LGAMMA)
617 #define HAVE_LGAMMA 1
618 extern double lgamma (double);
621 #if defined(HAVE_TGAMMA) && !defined(HAVE_TGAMMAF)
622 #define HAVE_TGAMMAF 1
623 extern float tgammaf (float);
626 #if defined(HAVE_LGAMMA) && !defined(HAVE_LGAMMAF)
627 #define HAVE_LGAMMAF 1
628 extern float lgammaf (float);
632 #endif /* C99_PROTOS_H */