1 /* Declarations of various C99 functions
2 Copyright (C) 2004, 2006, 2007 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
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) 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 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with libgfortran; see the file COPYING.LIB. If not,
18 write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA. */
21 /* As a special exception, if you link this library with other files,
22 some of which are compiled with GCC, to produce an executable,
23 this library does not by itself cause the resulting executable
24 to be covered by the GNU General Public License.
25 This exception does not however invalidate any other reasons why
26 the executable file might be covered by the GNU General Public License. */
30 #define C99_PROTOS_H 1
32 /* float variants of libm functions */
35 extern float acosf(float);
38 #if HAVE_ACOSH && !HAVE_ACOSHF
40 extern float acoshf(float);
45 extern float asinf(float);
48 #if HAVE_ASINH && !HAVE_ASINHF
50 extern float asinhf(float);
55 extern float atan2f(float, float);
60 extern float atanf(float);
63 #if HAVE_ATANH && !HAVE_ATANHF
65 extern float atanhf(float);
70 extern float ceilf(float);
73 #ifndef HAVE_COPYSIGNF
74 #define HAVE_COPYSIGNF 1
75 extern float copysignf(float, float);
80 extern float cosf(float);
85 extern float coshf(float);
90 extern float expf(float);
95 extern float fabsf(float);
100 extern float floorf(float);
104 #define HAVE_FLOORL 1
105 extern long double floorl (long double x
);
110 extern float fmodf (float x
, float y
);
115 extern long double fmodl (long double x
, long double y
);
119 #define HAVE_FREXPF 1
120 extern float frexpf(float, int *);
124 #define HAVE_HYPOTF 1
125 extern float hypotf(float, float);
130 extern float logf(float);
134 #define HAVE_LOG10F 1
135 extern float log10f(float);
139 #define HAVE_SCALBN 1
140 extern double scalbn(double, int);
144 #define HAVE_SCALBNF 1
145 extern float scalbnf(float, int);
150 extern float sinf(float);
155 extern float sinhf(float);
160 extern float sqrtf(float);
165 extern float tanf(float);
170 extern float tanhf(float);
175 extern double trunc(double);
179 #define HAVE_TRUNCF 1
180 extern float truncf(float);
183 #ifndef HAVE_NEXTAFTERF
184 #define HAVE_NEXTAFTERF 1
185 extern float nextafterf(float, float);
190 extern float powf(float, float);
195 extern double round(double);
199 #define HAVE_ROUNDF 1
200 extern float roundf(float);
203 #if !defined(HAVE_ROUNDL)
204 #define HAVE_ROUNDL 1
205 extern long double roundl(long double);
210 #if !defined(HAVE_LROUNDF) && defined(HAVE_ROUNDF)
211 #define HAVE_LROUNDF 1
212 long int lroundf (float);
215 #if !defined(HAVE_LROUND) && defined(HAVE_ROUND)
216 #define HAVE_LROUND 1
217 long int lround (double);
220 #if !defined(HAVE_LROUNDL) && defined(HAVE_ROUNDL)
221 #define HAVE_LROUNDL 1
222 long int lroundl (long double);
225 #if !defined(HAVE_LLROUNDF) && defined(HAVE_ROUNDF)
226 #define HAVE_LLROUNDF 1
227 long long int llroundf (float);
230 #if !defined(HAVE_LLROUND) && defined(HAVE_ROUND)
231 #define HAVE_LLROUND 1
232 long long int llround (double);
235 #if !defined(HAVE_LLROUNDL) && defined(HAVE_ROUNDL)
236 #define HAVE_LLROUNDL 1
237 long long int llroundl (long double);
240 /* Wrappers for systems without the various C99 single precision Bessel
243 #if defined(HAVE_J0) && ! defined(HAVE_J0F)
245 extern float j0f (float);
248 #if defined(HAVE_J1) && !defined(HAVE_J1F)
250 extern float j1f (float);
253 #if defined(HAVE_JN) && !defined(HAVE_JNF)
255 extern float jnf (int, float);
258 #if defined(HAVE_Y0) && !defined(HAVE_Y0F)
260 extern float y0f (float);
263 #if defined(HAVE_Y1) && !defined(HAVE_Y1F)
265 extern float y1f (float);
268 #if defined(HAVE_YN) && !defined(HAVE_YNF)
270 extern float ynf (int, float);
274 /* Wrappers for systems without the C99 erff() and erfcf() functions. */
276 #if defined(HAVE_ERF) && !defined(HAVE_ERFF)
278 extern float erff (float);
281 #if defined(HAVE_ERFC) && !defined(HAVE_ERFCF)
283 extern float erfcf (float);
288 /* log10l is needed on all platforms for decimal I/O */
290 #define HAVE_LOG10L 1
291 extern long double log10l(long double);
295 /* complex math functions */
297 #if !defined(HAVE_CABSF)
299 extern float cabsf (float complex);
302 #if !defined(HAVE_CABS)
304 extern double cabs (double complex);
307 #if !defined(HAVE_CABSL) && defined(HAVE_HYPOTL)
309 extern long double cabsl (long double complex);
313 #if !defined(HAVE_CARGF)
315 extern float cargf (float complex);
318 #if !defined(HAVE_CARG)
320 extern double carg (double complex);
323 #if !defined(HAVE_CARGL) && defined(HAVE_ATAN2L)
325 extern long double cargl (long double complex);
329 #if !defined(HAVE_CEXPF)
331 extern float complex cexpf (float complex);
334 #if !defined(HAVE_CEXP)
336 extern double complex cexp (double complex);
339 #if !defined(HAVE_CEXPL) && defined(HAVE_COSL) && defined(HAVE_SINL) && defined(EXPL)
341 extern long double complex cexpl (long double complex);
345 #if !defined(HAVE_CLOGF)
347 extern float complex clogf (float complex);
350 #if !defined(HAVE_CLOG)
352 extern double complex clog (double complex);
355 #if !defined(HAVE_CLOGL) && defined(HAVE_LOGL) && defined(HAVE_CABSL) && defined(HAVE_CARGL)
357 extern long double complex clogl (long double complex);
361 #if !defined(HAVE_CLOG10F)
362 #define HAVE_CLOG10F 1
363 extern float complex clog10f (float complex);
366 #if !defined(HAVE_CLOG10)
367 #define HAVE_CLOG10 1
368 extern double complex clog10 (double complex);
371 #if !defined(HAVE_CLOG10L) && defined(HAVE_LOG10L) && defined(HAVE_CABSL) && defined(HAVE_CARGL)
372 #define HAVE_CLOG10L 1
373 extern long double complex clog10l (long double complex);
377 #if !defined(HAVE_CPOWF)
379 extern float complex cpowf (float complex, float complex);
382 #if !defined(HAVE_CPOW)
384 extern double complex cpow (double complex, double complex);
387 #if !defined(HAVE_CPOWL) && defined(HAVE_CEXPL) && defined(HAVE_CLOGL)
389 extern long double complex cpowl (long double complex, long double complex);
393 #if !defined(HAVE_CSQRTF)
394 #define HAVE_CSQRTF 1
395 extern float complex csqrtf (float complex);
398 #if !defined(HAVE_CSQRT)
400 extern double complex csqrt (double complex);
403 #if !defined(HAVE_CSQRTL) && defined(HAVE_COPYSIGNL) && defined(HAVE_SQRTL) && defined(HAVE_FABSL) && defined(HAVE_HYPOTL)
404 #define HAVE_CSQRTL 1
405 extern long double complex csqrtl (long double complex);
409 #if !defined(HAVE_CSINHF)
410 #define HAVE_CSINHF 1
411 extern float complex csinhf (float complex);
414 #if !defined(HAVE_CSINH)
416 extern double complex csinh (double complex);
419 #if !defined(HAVE_CSINHL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
420 #define HAVE_CSINHL 1
421 extern long double complex csinhl (long double complex);
425 #if !defined(HAVE_CCOSHF)
426 #define HAVE_CCOSHF 1
427 extern float complex ccoshf (float complex);
430 #if !defined(HAVE_CCOSH)
432 extern double complex ccosh (double complex);
435 #if !defined(HAVE_CCOSHL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
436 #define HAVE_CCOSHL 1
437 extern long double complex ccoshl (long double complex);
441 #if !defined(HAVE_CTANHF)
442 #define HAVE_CTANHF 1
443 extern float complex ctanhf (float complex);
446 #if !defined(HAVE_CTANH)
448 extern double complex ctanh (double complex);
451 #if !defined(HAVE_CTANHL) && defined(HAVE_TANL) && defined(HAVE_TANHL)
452 #define HAVE_CTANHL 1
453 extern long double complex ctanhl (long double complex);
457 #if !defined(HAVE_CSINF)
459 extern float complex csinf (float complex);
462 #if !defined(HAVE_CSIN)
464 extern double complex csin (double complex);
467 #if !defined(HAVE_CSINL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
469 extern long double complex csinl (long double complex);
473 #if !defined(HAVE_CCOSF)
475 extern float complex ccosf (float complex);
478 #if !defined(HAVE_CCOS)
480 extern double complex ccos (double complex);
483 #if !defined(HAVE_CCOSL) && defined(HAVE_COSL) && defined(HAVE_COSHL) && defined(HAVE_SINL) && defined(HAVE_SINHL)
485 extern long double complex ccosl (long double complex);
489 #if !defined(HAVE_CTANF)
491 extern float complex ctanf (float complex);
494 #if !defined(HAVE_CTAN)
496 extern double complex ctan (double complex);
499 #if !defined(HAVE_CTANL) && defined(HAVE_TANL) && defined(HAVE_TANHL)
501 extern long double complex ctanl (long double complex);
505 /* Gamma-related prototypes. */
506 #if !defined(HAVE_TGAMMA)
507 #define HAVE_TGAMMA 1
508 extern double tgamma (double);
511 #if !defined(HAVE_LGAMMA)
512 #define HAVE_LGAMMA 1
513 extern double lgamma (double);
516 #if defined(HAVE_TGAMMA) && !defined(HAVE_TGAMMAF)
517 #define HAVE_TGAMMAF 1
518 extern float tgammaf (float);
521 #if defined(HAVE_LGAMMA) && !defined(HAVE_LGAMMAF)
522 #define HAVE_LGAMMAF 1
523 extern float lgammaf (float);
527 #endif /* C99_PROTOS_H */