Bug 1931913 - [wpt-sync] Update web-platform-tests to fb6c27f65c829cea708e497db128f58...
[gecko.git] / modules / fdlibm / patches / 01_remove_unused_declarations_from_fdlibm_h.patch
blob1488ef51c6d955536b95adb6b0c7bb3223aca960
1 diff --git a/fdlibm.h b/fdlibm.h
2 --- a/fdlibm.h
3 +++ b/fdlibm.h
4 @@ -12,504 +12,68 @@
5 /*
6 * from: @(#)fdlibm.h 5.1 93/09/24
7 * $FreeBSD$
8 */
10 #ifndef _MATH_H_
11 #define _MATH_H_
13 -#include <sys/cdefs.h>
14 -#include <sys/_types.h>
15 -#include <machine/_limits.h>
17 -/*
18 - * ANSI/POSIX
19 - */
20 -extern const union __infinity_un {
21 - unsigned char __uc[8];
22 - double __ud;
23 -} __infinity;
25 -extern const union __nan_un {
26 - unsigned char __uc[sizeof(float)];
27 - float __uf;
28 -} __nan;
30 -#if __GNUC_PREREQ__(3, 3)
31 -#define __MATH_BUILTIN_CONSTANTS
32 -#endif
34 -#if __GNUC_PREREQ__(3, 0)
35 -#define __MATH_BUILTIN_RELOPS
36 -#endif
38 -#ifdef __MATH_BUILTIN_CONSTANTS
39 -#define HUGE_VAL __builtin_huge_val()
40 -#else
41 -#define HUGE_VAL (__infinity.__ud)
42 -#endif
44 -#if __ISO_C_VISIBLE >= 1999
45 -#define FP_ILOGB0 (-__INT_MAX)
46 -#define FP_ILOGBNAN __INT_MAX
48 -#ifdef __MATH_BUILTIN_CONSTANTS
49 -#define HUGE_VALF __builtin_huge_valf()
50 -#define HUGE_VALL __builtin_huge_vall()
51 -#define INFINITY __builtin_inff()
52 -#define NAN __builtin_nanf("")
53 -#else
54 -#define HUGE_VALF (float)HUGE_VAL
55 -#define HUGE_VALL (long double)HUGE_VAL
56 -#define INFINITY HUGE_VALF
57 -#define NAN (__nan.__uf)
58 -#endif /* __MATH_BUILTIN_CONSTANTS */
60 -#define MATH_ERRNO 1
61 -#define MATH_ERREXCEPT 2
62 -#define math_errhandling MATH_ERREXCEPT
64 -#define FP_FAST_FMAF 1
66 -/* Symbolic constants to classify floating point numbers. */
67 -#define FP_INFINITE 0x01
68 -#define FP_NAN 0x02
69 -#define FP_NORMAL 0x04
70 -#define FP_SUBNORMAL 0x08
71 -#define FP_ZERO 0x10
73 -#if __STDC_VERSION__ >= 201112L || __has_extension(c_generic_selections)
74 -#define __fp_type_select(x, f, d, ld) __extension__ _Generic((x), \
75 - float: f(x), \
76 - double: d(x), \
77 - long double: ld(x))
78 -#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus)
79 -#define __fp_type_select(x, f, d, ld) __builtin_choose_expr( \
80 - __builtin_types_compatible_p(__typeof(x), long double), ld(x), \
81 - __builtin_choose_expr( \
82 - __builtin_types_compatible_p(__typeof(x), double), d(x), \
83 - __builtin_choose_expr( \
84 - __builtin_types_compatible_p(__typeof(x), float), f(x), (void)0)))
85 -#else
86 -#define __fp_type_select(x, f, d, ld) \
87 - ((sizeof(x) == sizeof(float)) ? f(x) \
88 - : (sizeof(x) == sizeof(double)) ? d(x) \
89 - : ld(x))
90 -#endif
92 -#define fpclassify(x) \
93 - __fp_type_select(x, __fpclassifyf, __fpclassifyd, __fpclassifyl)
94 -#define isfinite(x) __fp_type_select(x, __isfinitef, __isfinite, __isfinitel)
95 -#define isinf(x) __fp_type_select(x, __isinff, __isinf, __isinfl)
96 -#define isnan(x) \
97 - __fp_type_select(x, __inline_isnanf, __inline_isnan, __inline_isnanl)
98 -#define isnormal(x) __fp_type_select(x, __isnormalf, __isnormal, __isnormall)
100 -#ifdef __MATH_BUILTIN_RELOPS
101 -#define isgreater(x, y) __builtin_isgreater((x), (y))
102 -#define isgreaterequal(x, y) __builtin_isgreaterequal((x), (y))
103 -#define isless(x, y) __builtin_isless((x), (y))
104 -#define islessequal(x, y) __builtin_islessequal((x), (y))
105 -#define islessgreater(x, y) __builtin_islessgreater((x), (y))
106 -#define isunordered(x, y) __builtin_isunordered((x), (y))
107 -#else
108 -#define isgreater(x, y) (!isunordered((x), (y)) && (x) > (y))
109 -#define isgreaterequal(x, y) (!isunordered((x), (y)) && (x) >= (y))
110 -#define isless(x, y) (!isunordered((x), (y)) && (x) < (y))
111 -#define islessequal(x, y) (!isunordered((x), (y)) && (x) <= (y))
112 -#define islessgreater(x, y) (!isunordered((x), (y)) && \
113 - ((x) > (y) || (y) > (x)))
114 -#define isunordered(x, y) (isnan(x) || isnan(y))
115 -#endif /* __MATH_BUILTIN_RELOPS */
117 -#define signbit(x) __fp_type_select(x, __signbitf, __signbit, __signbitl)
119 -typedef __double_t double_t;
120 -typedef __float_t float_t;
121 -#endif /* __ISO_C_VISIBLE >= 1999 */
124 - * XOPEN/SVID
125 - */
126 -#if __BSD_VISIBLE || __XSI_VISIBLE
127 -#define M_E 2.7182818284590452354 /* e */
128 -#define M_LOG2E 1.4426950408889634074 /* log 2e */
129 -#define M_LOG10E 0.43429448190325182765 /* log 10e */
130 -#define M_LN2 0.69314718055994530942 /* log e2 */
131 -#define M_LN10 2.30258509299404568402 /* log e10 */
132 -#define M_PI 3.14159265358979323846 /* pi */
133 #define M_PI_2 1.57079632679489661923 /* pi/2 */
134 -#define M_PI_4 0.78539816339744830962 /* pi/4 */
135 -#define M_1_PI 0.31830988618379067154 /* 1/pi */
136 -#define M_2_PI 0.63661977236758134308 /* 2/pi */
137 -#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
138 -#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
139 -#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
141 -#define MAXFLOAT ((float)3.40282346638528860e+38)
142 -extern int signgam;
143 -#endif /* __BSD_VISIBLE || __XSI_VISIBLE */
145 -#if __BSD_VISIBLE
146 -#if 0
147 -/* Old value from 4.4BSD-Lite math.h; this is probably better. */
148 -#define HUGE HUGE_VAL
149 -#else
150 -#define HUGE MAXFLOAT
151 -#endif
152 -#endif /* __BSD_VISIBLE */
155 - * Most of these functions depend on the rounding mode and have the side
156 - * effect of raising floating-point exceptions, so they are not declared
157 - * as __pure2. In C99, FENV_ACCESS affects the purity of these functions.
158 - */
159 -__BEGIN_DECLS
161 - * ANSI/POSIX
162 - */
163 -int __fpclassifyd(double) __pure2;
164 -int __fpclassifyf(float) __pure2;
165 -int __fpclassifyl(long double) __pure2;
166 -int __isfinitef(float) __pure2;
167 -int __isfinite(double) __pure2;
168 -int __isfinitel(long double) __pure2;
169 -int __isinff(float) __pure2;
170 -int __isinf(double) __pure2;
171 -int __isinfl(long double) __pure2;
172 -int __isnormalf(float) __pure2;
173 -int __isnormal(double) __pure2;
174 -int __isnormall(long double) __pure2;
175 -int __signbit(double) __pure2;
176 -int __signbitf(float) __pure2;
177 -int __signbitl(long double) __pure2;
179 -static __inline int
180 -__inline_isnan(__const double __x)
183 - return (__x != __x);
186 -static __inline int
187 -__inline_isnanf(__const float __x)
190 - return (__x != __x);
193 -static __inline int
194 -__inline_isnanl(__const long double __x)
197 - return (__x != __x);
201 - * Define the following aliases, for compatibility with glibc and CUDA.
202 - */
203 -#define __isnan __inline_isnan
204 -#define __isnanf __inline_isnanf
207 - * Version 2 of the Single UNIX Specification (UNIX98) defined isnan() and
208 - * isinf() as functions taking double. C99, and the subsequent POSIX revisions
209 - * (SUSv3, POSIX.1-2001, define it as a macro that accepts any real floating
210 - * point type. If we are targeting SUSv2 and C99 or C11 (or C++11) then we
211 - * expose the newer definition, assuming that the language spec takes
212 - * precedence over the operating system interface spec.
213 - */
214 -#if __XSI_VISIBLE > 0 && __XSI_VISIBLE < 600 && __ISO_C_VISIBLE < 1999
215 -#undef isinf
216 -#undef isnan
217 -int isinf(double);
218 -int isnan(double);
219 -#endif
221 double acos(double);
222 double asin(double);
223 double atan(double);
224 double atan2(double, double);
225 double cos(double);
226 double sin(double);
227 double tan(double);
229 double cosh(double);
230 double sinh(double);
231 double tanh(double);
233 double exp(double);
234 -double frexp(double, int *); /* fundamentally !__pure2 */
235 -double ldexp(double, int);
236 double log(double);
237 double log10(double);
238 -double modf(double, double *); /* fundamentally !__pure2 */
240 double pow(double, double);
241 -double sqrt(double);
243 double ceil(double);
244 -double fabs(double) __pure2;
245 +double fabs(double);
246 double floor(double);
247 -double fmod(double, double);
250 - * These functions are not in C90.
251 - */
252 -#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE
253 double acosh(double);
254 double asinh(double);
255 double atanh(double);
256 double cbrt(double);
257 -double erf(double);
258 -double erfc(double);
259 double exp2(double);
260 double expm1(double);
261 -double fma(double, double, double);
262 double hypot(double, double);
263 -int ilogb(double) __pure2;
264 -double lgamma(double);
265 -long long llrint(double);
266 -long long llround(double);
267 double log1p(double);
268 double log2(double);
269 -double logb(double);
270 -long lrint(double);
271 -long lround(double);
272 -double nan(const char *) __pure2;
273 -double nextafter(double, double);
274 -double remainder(double, double);
275 -double remquo(double, double, int *);
276 double rint(double);
277 -#endif /* __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE */
279 -#if __BSD_VISIBLE || __XSI_VISIBLE
280 -double j0(double);
281 -double j1(double);
282 -double jn(int, double);
283 -double y0(double);
284 -double y1(double);
285 -double yn(int, double);
287 -#if __XSI_VISIBLE <= 500 || __BSD_VISIBLE
288 -double gamma(double);
289 -#endif
291 -#if __XSI_VISIBLE <= 600 || __BSD_VISIBLE
292 -double scalb(double, double);
293 -#endif
294 -#endif /* __BSD_VISIBLE || __XSI_VISIBLE */
296 -#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999
297 -double copysign(double, double) __pure2;
298 -double fdim(double, double);
299 -double fmax(double, double) __pure2;
300 -double fmin(double, double) __pure2;
301 +double copysign(double, double);
302 double nearbyint(double);
303 -double round(double);
304 -double scalbln(double, long);
305 double scalbn(double, int);
306 -double tgamma(double);
307 double trunc(double);
308 -#endif
311 - * BSD math library entry points
312 - */
313 -#if __BSD_VISIBLE
314 -double drem(double, double);
315 -int finite(double) __pure2;
316 -int isnanf(float) __pure2;
319 - * Reentrant version of gamma & lgamma; passes signgam back by reference
320 - * as the second argument; user must allocate space for signgam.
321 - */
322 -double gamma_r(double, int *);
323 -double lgamma_r(double, int *);
326 - * IEEE Test Vector
327 - */
328 -double significand(double);
329 -#endif /* __BSD_VISIBLE */
331 -/* float versions of ANSI/POSIX functions */
332 -#if __ISO_C_VISIBLE >= 1999
333 float acosf(float);
334 float asinf(float);
335 float atanf(float);
336 -float atan2f(float, float);
337 float cosf(float);
338 float sinf(float);
339 float tanf(float);
341 -float coshf(float);
342 -float sinhf(float);
343 -float tanhf(float);
345 float exp2f(float);
346 float expf(float);
347 -float expm1f(float);
348 -float frexpf(float, int *); /* fundamentally !__pure2 */
349 -int ilogbf(float) __pure2;
350 -float ldexpf(float, int);
351 float log10f(float);
352 -float log1pf(float);
353 -float log2f(float);
354 float logf(float);
355 -float modff(float, float *); /* fundamentally !__pure2 */
357 float powf(float, float);
358 float sqrtf(float);
360 float ceilf(float);
361 -float fabsf(float) __pure2;
362 +float fabsf(float);
363 float floorf(float);
364 -float fmodf(float, float);
365 -float roundf(float);
367 -float erff(float);
368 -float erfcf(float);
369 float hypotf(float, float);
370 -float lgammaf(float);
371 -float tgammaf(float);
373 -float acoshf(float);
374 -float asinhf(float);
375 -float atanhf(float);
376 -float cbrtf(float);
377 -float logbf(float);
378 -float copysignf(float, float) __pure2;
379 -long long llrintf(float);
380 -long long llroundf(float);
381 -long lrintf(float);
382 -long lroundf(float);
383 -float nanf(const char *) __pure2;
384 float nearbyintf(float);
385 -float nextafterf(float, float);
386 -float remainderf(float, float);
387 -float remquof(float, float, int *);
388 float rintf(float);
389 -float scalblnf(float, long);
390 float scalbnf(float, int);
391 float truncf(float);
393 -float fdimf(float, float);
394 -float fmaf(float, float, float);
395 -float fmaxf(float, float) __pure2;
396 -float fminf(float, float) __pure2;
397 -#endif
400 - * float versions of BSD math library entry points
401 - */
402 -#if __BSD_VISIBLE
403 -float dremf(float, float);
404 -int finitef(float) __pure2;
405 -float gammaf(float);
406 -float j0f(float);
407 -float j1f(float);
408 -float jnf(int, float);
409 -float scalbf(float, float);
410 -float y0f(float);
411 -float y1f(float);
412 -float ynf(int, float);
415 - * Float versions of reentrant version of gamma & lgamma; passes
416 - * signgam back by reference as the second argument; user must
417 - * allocate space for signgam.
418 - */
419 -float gammaf_r(float, int *);
420 -float lgammaf_r(float, int *);
423 - * float version of IEEE Test Vector
424 - */
425 -float significandf(float);
426 -#endif /* __BSD_VISIBLE */
429 - * long double versions of ISO/POSIX math functions
430 - */
431 -#if __ISO_C_VISIBLE >= 1999
432 -long double acoshl(long double);
433 -long double acosl(long double);
434 -long double asinhl(long double);
435 -long double asinl(long double);
436 -long double atan2l(long double, long double);
437 -long double atanhl(long double);
438 -long double atanl(long double);
439 -long double cbrtl(long double);
440 -long double ceill(long double);
441 -long double copysignl(long double, long double) __pure2;
442 -long double coshl(long double);
443 -long double cosl(long double);
444 -long double erfcl(long double);
445 -long double erfl(long double);
446 -long double exp2l(long double);
447 -long double expl(long double);
448 -long double expm1l(long double);
449 -long double fabsl(long double) __pure2;
450 -long double fdiml(long double, long double);
451 -long double floorl(long double);
452 -long double fmal(long double, long double, long double);
453 -long double fmaxl(long double, long double) __pure2;
454 -long double fminl(long double, long double) __pure2;
455 -long double fmodl(long double, long double);
456 -long double frexpl(long double, int *); /* fundamentally !__pure2 */
457 -long double hypotl(long double, long double);
458 -int ilogbl(long double) __pure2;
459 -long double ldexpl(long double, int);
460 -long double lgammal(long double);
461 -long long llrintl(long double);
462 -long long llroundl(long double);
463 -long double log10l(long double);
464 -long double log1pl(long double);
465 -long double log2l(long double);
466 -long double logbl(long double);
467 -long double logl(long double);
468 -long lrintl(long double);
469 -long lroundl(long double);
470 -long double modfl(long double, long double *); /* fundamentally !__pure2 */
471 -long double nanl(const char *) __pure2;
472 -long double nearbyintl(long double);
473 -long double nextafterl(long double, long double);
474 -double nexttoward(double, long double);
475 -float nexttowardf(float, long double);
476 -long double nexttowardl(long double, long double);
477 -long double powl(long double, long double);
478 -long double remainderl(long double, long double);
479 -long double remquol(long double, long double, int *);
480 -long double rintl(long double);
481 -long double roundl(long double);
482 -long double scalblnl(long double, long);
483 -long double scalbnl(long double, int);
484 -long double sinhl(long double);
485 -long double sinl(long double);
486 -long double sqrtl(long double);
487 -long double tanhl(long double);
488 -long double tanl(long double);
489 -long double tgammal(long double);
490 -long double truncl(long double);
491 -#endif /* __ISO_C_VISIBLE >= 1999 */
493 -#if __BSD_VISIBLE
494 -long double lgammal_r(long double, int *);
495 -void sincos(double, double *, double *);
496 -void sincosf(float, float *, float *);
497 -void sincosl(long double, long double *, long double *);
498 -double cospi(double);
499 -float cospif(float);
500 -long double cospil(long double);
501 -double sinpi(double);
502 -float sinpif(float);
503 -long double sinpil(long double);
504 -double tanpi(double);
505 -float tanpif(float);
506 -long double tanpil(long double);
507 -#endif
509 -__END_DECLS
511 #endif /* !_MATH_H_ */