2 * Copyright (C) 2024 Mikulas Patocka
4 * This file is part of Ajla.
6 * Ajla is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, either version 3 of the License, or (at your option) any later
11 * Ajla is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along with
16 * Ajla. If not, see <https://www.gnu.org/licenses/>.
19 /* gcc 2.7.2.1 will throw "internal error--unrecognizable insn" if we enable this
20 #ifndef HAVE_LONG_DOUBLE
21 #if defined(ARCH_X86) && defined(HAVE_REAL_GNUC)
22 #define HAVE_LONG_DOUBLE 1
28 char *getenv(const char *name
);
32 void *mempcpy(void *dst
, const void *src
, size_t length
);
35 #if defined(__EMX__) || defined(__BORLANDC__)
36 #define strcasecmp stricmp
40 #define strcasecmp _stricmp
44 char *strerror(int errnum
);
49 #define strnlen my_strnlen
53 size_t strnlen(const char *s
, size_t maxlen
);
56 #if !defined(HAVE_CBRT)
57 double cbrt(double x
);
60 #if !defined(HAVE_CBRTF)
64 #if defined(HAVE_LONG_DOUBLE) && !defined(HAVE_CBRTL)
65 #define cbrtl my_cbrtl /* fix conflicting types for built-in function cbrtl */
69 #if !defined(HAVE_ASINH)
70 double asinh(double x
);
73 #if defined(HAVE_LONG_DOUBLE) && !defined(HAVE_ASINHL)
74 long double asinhl(long double x
);
77 #if !defined(HAVE_ACOSH)
78 double acosh(double x
);
81 #if defined(HAVE_LONG_DOUBLE) && !defined(HAVE_ACOSHL)
82 long double acoshl(long double x
);
85 #if !defined(HAVE_ATANH)
86 double atanh(double x
);
89 #if defined(HAVE_LONG_DOUBLE) && !defined(HAVE_ATANHL)
90 long double atanhl(long double x
);
93 #if !defined(HAVE_EXP2)
94 double exp2(double x
);
97 #if !defined(HAVE_EXP2F)
101 #if defined(HAVE_LONG_DOUBLE) && !defined(HAVE_EXP2L)
102 long double exp2l(long double x
);
105 #if defined(HAVE___FLOAT128) && defined(HAVE_LIBQUADMATH) && defined(HAVE_QUADMATH_H) && !defined(HAVE_EXP2Q)
106 __float128
exp2q(__float128 x
);
109 #if !defined(HAVE_EXP10)
110 double exp10(double x
);
112 #if !defined(HAVE_EXP10F)
113 float exp10f(float x
);
115 #if defined(HAVE_LONG_DOUBLE) && !defined(HAVE_EXP10L)
116 long double exp10l(long double x
);
118 #if defined(HAVE___FLOAT128) && defined(HAVE_LIBQUADMATH) && defined(HAVE_QUADMATH_H) && !defined(HAVE_EXP10Q)
119 __float128
exp10q(__float128 x
);
122 #if !defined(HAVE_LOG2)
123 double log2(double x
);
126 #if !defined(HAVE_LOG2F)
127 float log2f(float x
);
130 #if defined(HAVE_LONG_DOUBLE) && !defined(HAVE_LOG2L)
131 long double log2l(long double x
);
134 #if !defined(HAVE_TRUNC)
135 double trunc(double x
);
138 #if !defined(HAVE_TRUNCF)
139 float truncf(float x
);
142 #if defined(HAVE_LONG_DOUBLE) && !defined(HAVE_TRUNCL)
143 long double truncl(long double x
);
146 #if !defined(HAVE_RINT)
147 double rint(double x
);
150 #if !defined(HAVE_RINTF)
151 float rintf(float x
);
154 #if !defined(HAVE_MODFF)
155 float modff(float x
, float *iflt
);