AVR: target/114981 - Tweak __builtin_powif / __powisf2
[official-gcc.git] / libgfortran / c99_protos.h
blob43e73a7232d52db9c0772bfbb64ae79ce3703122
1 /* Declarations of various C99 functions
2 Copyright (C) 2004-2024 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)
9 any later version.
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/>. */
25 #ifndef C99_PROTOS_H
26 #define C99_PROTOS_H 1
28 /* float variants of libm functions */
29 #ifndef HAVE_ACOSF
30 #define HAVE_ACOSF 1
31 extern float acosf(float);
32 #endif
34 #if HAVE_ACOSH && !HAVE_ACOSHF
35 #define HAVE_ACOSHF 1
36 extern float acoshf(float);
37 #endif
39 #ifndef HAVE_ASINF
40 #define HAVE_ASINF 1
41 extern float asinf(float);
42 #endif
44 #if HAVE_ASINH && !HAVE_ASINHF
45 #define HAVE_ASINHF 1
46 extern float asinhf(float);
47 #endif
49 #ifndef HAVE_ATAN2F
50 #define HAVE_ATAN2F 1
51 extern float atan2f(float, float);
52 #endif
54 #ifndef HAVE_ATANF
55 #define HAVE_ATANF 1
56 extern float atanf(float);
57 #endif
59 #if HAVE_ATANH && !HAVE_ATANHF
60 #define HAVE_ATANHF 1
61 extern float atanhf(float);
62 #endif
64 #ifndef HAVE_CEILF
65 #define HAVE_CEILF 1
66 extern float ceilf(float);
67 #endif
69 #ifndef HAVE_COPYSIGNF
70 #define HAVE_COPYSIGNF 1
71 extern float copysignf(float, float);
72 #endif
74 #if !defined(HAVE_COPYSIGN) && defined(HAVE_INLINE_BUILTIN_COPYSIGN)
75 #define HAVE_COPYSIGN 1
76 extern double copysign(double, double);
77 #endif
79 #if !defined(HAVE_COPYSIGNL) && defined(HAVE_INLINE_BUILTIN_COPYSIGNL)
80 #define HAVE_COPYSIGNL 1
81 extern long double copysignl(long double, long double);
82 #endif
84 #ifndef HAVE_COSF
85 #define HAVE_COSF 1
86 extern float cosf(float);
87 #endif
89 #ifndef HAVE_COSHF
90 #define HAVE_COSHF 1
91 extern float coshf(float);
92 #endif
94 #ifndef HAVE_EXPF
95 #define HAVE_EXPF 1
96 extern float expf(float);
97 #endif
99 #ifndef HAVE_FABSF
100 #define HAVE_FABSF 1
101 extern float fabsf(float);
102 #endif
104 #if !defined(HAVE_FABS) && defined(HAVE_INLINE_BUILTIN_FABS)
105 #define HAVE_FABS 1
106 extern double fabs(double);
107 #endif
109 #if !defined(HAVE_FABSL) && defined(HAVE_INLINE_BUILTIN_FABSL)
110 #define HAVE_FABSL 1
111 extern long double fabsl(long double);
112 #endif
114 #ifndef HAVE_FLOORF
115 #define HAVE_FLOORF 1
116 extern float floorf(float);
117 #endif
119 #ifndef HAVE_FLOORL
120 #define HAVE_FLOORL 1
121 extern long double floorl (long double x);
122 #endif
124 #ifndef HAVE_FMODF
125 #define HAVE_FMODF 1
126 extern float fmodf (float x, float y);
127 #endif
129 #ifndef HAVE_FMODL
130 #define HAVE_FMODL 1
131 extern long double fmodl (long double x, long double y);
132 #endif
134 #ifndef HAVE_FREXPF
135 #define HAVE_FREXPF 1
136 extern float frexpf(float, int *);
137 #endif
139 #ifndef HAVE_HYPOTF
140 #define HAVE_HYPOTF 1
141 extern float hypotf(float, float);
142 #endif
144 #ifndef HAVE_LOGF
145 #define HAVE_LOGF 1
146 extern float logf(float);
147 #endif
149 #ifndef HAVE_LOG10F
150 #define HAVE_LOG10F 1
151 extern float log10f(float);
152 #endif
154 #ifndef HAVE_SCALBN
155 #define HAVE_SCALBN 1
156 extern double scalbn(double, int);
157 #endif
159 #ifndef HAVE_SCALBNF
160 #define HAVE_SCALBNF 1
161 extern float scalbnf(float, int);
162 #endif
164 #ifndef HAVE_SINF
165 #define HAVE_SINF 1
166 extern float sinf(float);
167 #endif
169 #ifndef HAVE_SINHF
170 #define HAVE_SINHF 1
171 extern float sinhf(float);
172 #endif
174 #ifndef HAVE_SQRTF
175 #define HAVE_SQRTF 1
176 extern float sqrtf(float);
177 #endif
179 #ifndef HAVE_TANF
180 #define HAVE_TANF 1
181 extern float tanf(float);
182 #endif
184 #ifndef HAVE_TANHF
185 #define HAVE_TANHF 1
186 extern float tanhf(float);
187 #endif
189 #ifndef HAVE_TRUNC
190 #define HAVE_TRUNC 1
191 extern double trunc(double);
192 #endif
194 #ifndef HAVE_TRUNCF
195 #define HAVE_TRUNCF 1
196 extern float truncf(float);
197 #endif
199 #ifndef HAVE_NEXTAFTERF
200 #define HAVE_NEXTAFTERF 1
201 extern float nextafterf(float, float);
202 #endif
204 #ifndef HAVE_POWF
205 #define HAVE_POWF 1
206 extern float powf(float, float);
207 #endif
209 #ifndef HAVE_ROUND
210 #define HAVE_ROUND 1
211 extern double round(double);
212 #endif
214 #ifndef HAVE_ROUNDF
215 #define HAVE_ROUNDF 1
216 extern float roundf(float);
217 #endif
219 #if !defined(HAVE_ROUNDL)
220 #define HAVE_ROUNDL 1
221 extern long double roundl(long double);
222 #endif
226 #if !defined(HAVE_LROUNDF) && defined(HAVE_ROUNDF)
227 #define HAVE_LROUNDF 1
228 long int lroundf (float);
229 #endif
231 #if !defined(HAVE_LROUND) && defined(HAVE_ROUND)
232 #define HAVE_LROUND 1
233 long int lround (double);
234 #endif
236 #if !defined(HAVE_LROUNDL) && defined(HAVE_ROUNDL)
237 #define HAVE_LROUNDL 1
238 long int lroundl (long double);
239 #endif
241 #if !defined(HAVE_LLROUNDF) && defined(HAVE_ROUNDF)
242 #define HAVE_LLROUNDF 1
243 long long int llroundf (float);
244 #endif
246 #if !defined(HAVE_LLROUND) && defined(HAVE_ROUND)
247 #define HAVE_LLROUND 1
248 long long int llround (double);
249 #endif
251 #if !defined(HAVE_LLROUNDL) && defined(HAVE_ROUNDL)
252 #define HAVE_LLROUNDL 1
253 long long int llroundl (long double);
254 #endif
256 /* Wrappers for systems without the various C99 single precision Bessel
257 functions. */
259 #if defined(HAVE_J0) && ! defined(HAVE_J0F)
260 #define HAVE_J0F 1
261 extern float j0f (float);
262 #endif
264 #if defined(HAVE_J1) && !defined(HAVE_J1F)
265 #define HAVE_J1F 1
266 extern float j1f (float);
267 #endif
269 #if defined(HAVE_JN) && !defined(HAVE_JNF)
270 #define HAVE_JNF 1
271 extern float jnf (int, float);
272 #endif
274 #if defined(HAVE_Y0) && !defined(HAVE_Y0F)
275 #define HAVE_Y0F 1
276 extern float y0f (float);
277 #endif
279 #if defined(HAVE_Y1) && !defined(HAVE_Y1F)
280 #define HAVE_Y1F 1
281 extern float y1f (float);
282 #endif
284 #if defined(HAVE_YN) && !defined(HAVE_YNF)
285 #define HAVE_YNF 1
286 extern float ynf (int, float);
287 #endif
290 /* Wrappers for systems without the C99 erff() and erfcf() functions. */
292 #if defined(HAVE_ERF) && !defined(HAVE_ERFF)
293 #define HAVE_ERFF 1
294 extern float erff (float);
295 #endif
297 #if defined(HAVE_ERFC) && !defined(HAVE_ERFCF)
298 #define HAVE_ERFCF 1
299 extern float erfcf (float);
300 #endif
304 /* log10l is needed on all platforms for decimal I/O */
305 #ifndef HAVE_LOG10L
306 #define HAVE_LOG10L 1
307 extern long double log10l(long double);
308 #endif
311 /* complex math functions */
313 #if !defined(HAVE_CABSF)
314 #define HAVE_CABSF 1
315 extern float cabsf (float complex);
316 #endif
318 #if !defined(HAVE_CABS)
319 #define HAVE_CABS 1
320 extern double cabs (double complex);
321 #endif
323 #if !defined(HAVE_CABSL) && defined(HAVE_HYPOTL)
324 #define HAVE_CABSL 1
325 extern long double cabsl (long double complex);
326 #endif
329 #if !defined(HAVE_CARGF)
330 #define HAVE_CARGF 1
331 extern float cargf (float complex);
332 #endif
334 #if !defined(HAVE_CARG)
335 #define HAVE_CARG 1
336 extern double carg (double complex);
337 #endif
339 #if !defined(HAVE_CARGL) && defined(HAVE_ATAN2L)
340 #define HAVE_CARGL 1
341 extern long double cargl (long double complex);
342 #endif
345 #if !defined(HAVE_CEXPF)
346 #define HAVE_CEXPF 1
347 extern float complex cexpf (float complex);
348 #endif
350 #if !defined(HAVE_CEXP)
351 #define HAVE_CEXP 1
352 extern double complex cexp (double complex);
353 #endif
355 #if !defined(HAVE_CEXPL) && defined(HAVE_COSL) && defined(HAVE_SINL) && defined(HAVE_EXPL)
356 #define HAVE_CEXPL 1
357 extern long double complex cexpl (long double complex);
358 #endif
361 #if !defined(HAVE_CLOGF)
362 #define HAVE_CLOGF 1
363 extern float complex clogf (float complex);
364 #endif
366 #if !defined(HAVE_CLOG)
367 #define HAVE_CLOG 1
368 extern double complex clog (double complex);
369 #endif
371 #if !defined(HAVE_CLOGL) && defined(HAVE_LOGL) && defined(HAVE_CABSL) && defined(HAVE_CARGL)
372 #define HAVE_CLOGL 1
373 extern long double complex clogl (long double complex);
374 #endif
377 #if !defined(HAVE_CLOG10F)
378 #define HAVE_CLOG10F 1
379 extern float complex clog10f (float complex);
380 #endif
382 #if !defined(HAVE_CLOG10)
383 #define HAVE_CLOG10 1
384 extern double complex clog10 (double complex);
385 #endif
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);
390 #endif
393 #if !defined(HAVE_CPOWF)
394 #define HAVE_CPOWF 1
395 extern float complex cpowf (float complex, float complex);
396 #endif
398 #if !defined(HAVE_CPOW)
399 #define HAVE_CPOW 1
400 extern double complex cpow (double complex, double complex);
401 #endif
403 #if !defined(HAVE_CPOWL) && defined(HAVE_CEXPL) && defined(HAVE_CLOGL)
404 #define HAVE_CPOWL 1
405 extern long double complex cpowl (long double complex, long double complex);
406 #endif
409 #if !defined(HAVE_CSQRTF)
410 #define HAVE_CSQRTF 1
411 extern float complex csqrtf (float complex);
412 #endif
414 #if !defined(HAVE_CSQRT)
415 #define HAVE_CSQRT 1
416 extern double complex csqrt (double complex);
417 #endif
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);
422 #endif
425 #if !defined(HAVE_CSINHF)
426 #define HAVE_CSINHF 1
427 extern float complex csinhf (float complex);
428 #endif
430 #if !defined(HAVE_CSINH)
431 #define HAVE_CSINH 1
432 extern double complex csinh (double complex);
433 #endif
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);
438 #endif
441 #if !defined(HAVE_CCOSHF)
442 #define HAVE_CCOSHF 1
443 extern float complex ccoshf (float complex);
444 #endif
446 #if !defined(HAVE_CCOSH)
447 #define HAVE_CCOSH 1
448 extern double complex ccosh (double complex);
449 #endif
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);
454 #endif
457 #if !defined(HAVE_CTANHF)
458 #define HAVE_CTANHF 1
459 extern float complex ctanhf (float complex);
460 #endif
462 #if !defined(HAVE_CTANH)
463 #define HAVE_CTANH 1
464 extern double complex ctanh (double complex);
465 #endif
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);
470 #endif
473 #if !defined(HAVE_CSINF)
474 #define HAVE_CSINF 1
475 extern float complex csinf (float complex);
476 #endif
478 #if !defined(HAVE_CSIN)
479 #define HAVE_CSIN 1
480 extern double complex csin (double complex);
481 #endif
483 #if !defined(HAVE_CSINL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
484 #define HAVE_CSINL 1
485 extern long double complex csinl (long double complex);
486 #endif
489 #if !defined(HAVE_CCOSF)
490 #define HAVE_CCOSF 1
491 extern float complex ccosf (float complex);
492 #endif
494 #if !defined(HAVE_CCOS)
495 #define HAVE_CCOS 1
496 extern double complex ccos (double complex);
497 #endif
499 #if !defined(HAVE_CCOSL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
500 #define HAVE_CCOSL 1
501 extern long double complex ccosl (long double complex);
502 #endif
505 #if !defined(HAVE_CTANF)
506 #define HAVE_CTANF 1
507 extern float complex ctanf (float complex);
508 #endif
510 #if !defined(HAVE_CTAN)
511 #define HAVE_CTAN 1
512 extern double complex ctan (double complex);
513 #endif
515 #if !defined(HAVE_CTANL) && defined(HAVE_TANL) && defined(HAVE_TANHL)
516 #define HAVE_CTANL 1
517 extern long double complex ctanl (long double complex);
518 #endif
521 /* Complex ACOS. */
523 #if !defined(HAVE_CACOSF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
524 #define HAVE_CACOSF 1
525 extern complex float cacosf (complex float z);
526 #endif
528 #if !defined(HAVE_CACOS) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
529 #define HAVE_CACOS 1
530 extern complex double cacos (complex double z);
531 #endif
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);
536 #endif
539 /* Complex ASIN. */
541 #if !defined(HAVE_CASINF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
542 #define HAVE_CASINF 1
543 extern complex float casinf (complex float z);
544 #endif
546 #if !defined(HAVE_CASIN) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
547 #define HAVE_CASIN 1
548 extern complex double casin (complex double z);
549 #endif
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);
554 #endif
557 /* Complex ATAN. */
559 #if !defined(HAVE_CATANF) && defined(HAVE_CLOGF)
560 #define HAVE_CATANF 1
561 extern complex float catanf (complex float z);
562 #endif
564 #if !defined(HAVE_CATAN) && defined(HAVE_CLOG)
565 #define HAVE_CATAN 1
566 extern complex double catan (complex double z);
567 #endif
569 #if !defined(HAVE_CATANL) && defined(HAVE_CLOGL)
570 #define HAVE_CATANL 1
571 extern complex long double catanl (complex long double z);
572 #endif
575 /* Complex ASINH. */
577 #if !defined(HAVE_CASINHF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
578 #define HAVE_CASINHF 1
579 extern complex float casinhf (complex float z);
580 #endif
583 #if !defined(HAVE_CASINH) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
584 #define HAVE_CASINH 1
585 extern complex double casinh (complex double z);
586 #endif
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);
591 #endif
594 /* Complex ACOSH. */
596 #if !defined(HAVE_CACOSHF) && defined(HAVE_CLOGF) && defined(HAVE_CSQRTF)
597 #define HAVE_CACOSHF 1
598 extern complex float cacoshf (complex float z);
599 #endif
601 #if !defined(HAVE_CACOSH) && defined(HAVE_CLOG) && defined(HAVE_CSQRT)
602 #define HAVE_CACOSH 1
603 extern complex double cacosh (complex double z);
604 #endif
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);
609 #endif
612 /* Complex ATANH. */
614 #if !defined(HAVE_CATANHF) && defined(HAVE_CLOGF)
615 #define HAVE_CATANHF 1
616 extern complex float catanhf (complex float z);
617 #endif
619 #if !defined(HAVE_CATANH) && defined(HAVE_CLOG)
620 #define HAVE_CATANH 1
621 extern complex double catanh (complex double z);
622 #endif
624 #if !defined(HAVE_CATANHL) && defined(HAVE_CLOGL)
625 #define HAVE_CATANHL 1
626 extern complex long double catanhl (complex long double z);
627 #endif
630 /* Gamma-related prototypes. */
631 #if !defined(HAVE_TGAMMA)
632 #define HAVE_TGAMMA 1
633 extern double tgamma (double);
634 #endif
636 #if !defined(HAVE_LGAMMA)
637 #define HAVE_LGAMMA 1
638 extern double lgamma (double);
639 #endif
641 #if defined(HAVE_TGAMMA) && !defined(HAVE_TGAMMAF)
642 #define HAVE_TGAMMAF 1
643 extern float tgammaf (float);
644 #endif
646 #if defined(HAVE_LGAMMA) && !defined(HAVE_LGAMMAF)
647 #define HAVE_LGAMMAF 1
648 extern float lgammaf (float);
649 #endif
651 #ifndef HAVE_FMA
652 #define HAVE_FMA 1
653 extern double fma(double, double, double);
654 #endif
656 #ifndef HAVE_FMAF
657 #define HAVE_FMAF 1
658 extern float fmaf(float, float, float);
659 #endif
661 #ifndef HAVE_FMAL
662 #define HAVE_FMAL 1
663 extern long double fmal(long double, long double, long double);
664 #endif
666 #endif /* C99_PROTOS_H */