01_remove_unused_declarations_from_fdlibm_h.patch (14382B)
1 diff --git a/fdlibm.h b/fdlibm.h 2 --- a/fdlibm.h 3 +++ b/fdlibm.h 4 @@ -12,504 +12,51 @@ 5 /* 6 * from: @(#)fdlibm.h 5.1 93/09/24 7 * $FreeBSD$ 8 */ 9 10 #ifndef _MATH_H_ 11 #define _MATH_H_ 12 13 -#include <sys/cdefs.h> 14 -#include <sys/_types.h> 15 -#include <machine/_limits.h> 16 - 17 -/* 18 - * ANSI/POSIX 19 - */ 20 -extern const union __infinity_un { 21 - unsigned char __uc[8]; 22 - double __ud; 23 -} __infinity; 24 - 25 -extern const union __nan_un { 26 - unsigned char __uc[sizeof(float)]; 27 - float __uf; 28 -} __nan; 29 - 30 -#if __GNUC_PREREQ__(3, 3) 31 -#define __MATH_BUILTIN_CONSTANTS 32 -#endif 33 - 34 -#if __GNUC_PREREQ__(3, 0) 35 -#define __MATH_BUILTIN_RELOPS 36 -#endif 37 - 38 -#ifdef __MATH_BUILTIN_CONSTANTS 39 -#define HUGE_VAL __builtin_huge_val() 40 -#else 41 -#define HUGE_VAL (__infinity.__ud) 42 -#endif 43 - 44 -#if __ISO_C_VISIBLE >= 1999 45 -#define FP_ILOGB0 (-__INT_MAX) 46 -#define FP_ILOGBNAN __INT_MAX 47 - 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 */ 59 - 60 -#define MATH_ERRNO 1 61 -#define MATH_ERREXCEPT 2 62 -#define math_errhandling MATH_ERREXCEPT 63 - 64 -#define FP_FAST_FMAF 1 65 - 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 72 - 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 91 - 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) 99 - 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 */ 116 - 117 -#define signbit(x) __fp_type_select(x, __signbitf, __signbit, __signbitl) 118 - 119 -typedef __double_t double_t; 120 -typedef __float_t float_t; 121 -#endif /* __ISO_C_VISIBLE >= 1999 */ 122 - 123 -/* 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) */ 140 - 141 -#define MAXFLOAT ((float)3.40282346638528860e+38) 142 -extern int signgam; 143 -#endif /* __BSD_VISIBLE || __XSI_VISIBLE */ 144 - 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 */ 153 - 154 -/* 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 160 -/* 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; 178 - 179 -static __inline int 180 -__inline_isnan(__const double __x) 181 -{ 182 - 183 - return (__x != __x); 184 -} 185 - 186 -static __inline int 187 -__inline_isnanf(__const float __x) 188 -{ 189 - 190 - return (__x != __x); 191 -} 192 - 193 -static __inline int 194 -__inline_isnanl(__const long double __x) 195 -{ 196 - 197 - return (__x != __x); 198 -} 199 - 200 -/* 201 - * Define the following aliases, for compatibility with glibc and CUDA. 202 - */ 203 -#define __isnan __inline_isnan 204 -#define __isnanf __inline_isnanf 205 - 206 -/* 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 220 - 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); 228 229 double cosh(double); 230 double sinh(double); 231 double tanh(double); 232 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 */ 239 240 double pow(double, double); 241 -double sqrt(double); 242 243 -double ceil(double); 244 -double fabs(double) __pure2; 245 -double floor(double); 246 -double fmod(double, double); 247 - 248 -/* 249 - * These functions are not in C90. 250 - */ 251 -#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE 252 double acosh(double); 253 double asinh(double); 254 double atanh(double); 255 double cbrt(double); 256 -double erf(double); 257 -double erfc(double); 258 double exp2(double); 259 double expm1(double); 260 -double fma(double, double, double); 261 double hypot(double, double); 262 -int ilogb(double) __pure2; 263 -double lgamma(double); 264 -long long llrint(double); 265 -long long llround(double); 266 double log1p(double); 267 double log2(double); 268 -double logb(double); 269 -long lrint(double); 270 -long lround(double); 271 -double nan(const char *) __pure2; 272 -double nextafter(double, double); 273 -double remainder(double, double); 274 -double remquo(double, double, int *); 275 -double rint(double); 276 -#endif /* __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE */ 277 - 278 -#if __BSD_VISIBLE || __XSI_VISIBLE 279 -double j0(double); 280 -double j1(double); 281 -double jn(int, double); 282 -double y0(double); 283 -double y1(double); 284 -double yn(int, double); 285 - 286 -#if __XSI_VISIBLE <= 500 || __BSD_VISIBLE 287 -double gamma(double); 288 -#endif 289 - 290 -#if __XSI_VISIBLE <= 600 || __BSD_VISIBLE 291 -double scalb(double, double); 292 -#endif 293 -#endif /* __BSD_VISIBLE || __XSI_VISIBLE */ 294 - 295 -#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 296 -double copysign(double, double) __pure2; 297 -double fdim(double, double); 298 -double fmax(double, double) __pure2; 299 -double fmin(double, double) __pure2; 300 -double nearbyint(double); 301 -double round(double); 302 -double scalbln(double, long); 303 -double scalbn(double, int); 304 -double tgamma(double); 305 -double trunc(double); 306 -#endif 307 - 308 -/* 309 - * BSD math library entry points 310 - */ 311 -#if __BSD_VISIBLE 312 -double drem(double, double); 313 -int finite(double) __pure2; 314 -int isnanf(float) __pure2; 315 - 316 -/* 317 - * Reentrant version of gamma & lgamma; passes signgam back by reference 318 - * as the second argument; user must allocate space for signgam. 319 - */ 320 -double gamma_r(double, int *); 321 -double lgamma_r(double, int *); 322 - 323 -/* 324 - * IEEE Test Vector 325 - */ 326 -double significand(double); 327 -#endif /* __BSD_VISIBLE */ 328 - 329 -/* float versions of ANSI/POSIX functions */ 330 -#if __ISO_C_VISIBLE >= 1999 331 float acosf(float); 332 float asinf(float); 333 float atanf(float); 334 -float atan2f(float, float); 335 float cosf(float); 336 float sinf(float); 337 float tanf(float); 338 - 339 -float coshf(float); 340 -float sinhf(float); 341 -float tanhf(float); 342 - 343 float exp2f(float); 344 float expf(float); 345 -float expm1f(float); 346 -float frexpf(float, int *); /* fundamentally !__pure2 */ 347 -int ilogbf(float) __pure2; 348 -float ldexpf(float, int); 349 float log10f(float); 350 -float log1pf(float); 351 -float log2f(float); 352 float logf(float); 353 -float modff(float, float *); /* fundamentally !__pure2 */ 354 - 355 float powf(float, float); 356 -float sqrtf(float); 357 - 358 -float ceilf(float); 359 -float fabsf(float) __pure2; 360 -float floorf(float); 361 -float fmodf(float, float); 362 -float roundf(float); 363 - 364 -float erff(float); 365 -float erfcf(float); 366 -float hypotf(float, float); 367 -float lgammaf(float); 368 -float tgammaf(float); 369 - 370 -float acoshf(float); 371 -float asinhf(float); 372 -float atanhf(float); 373 -float cbrtf(float); 374 -float logbf(float); 375 -float copysignf(float, float) __pure2; 376 -long long llrintf(float); 377 -long long llroundf(float); 378 -long lrintf(float); 379 -long lroundf(float); 380 -float nanf(const char *) __pure2; 381 -float nearbyintf(float); 382 -float nextafterf(float, float); 383 -float remainderf(float, float); 384 -float remquof(float, float, int *); 385 -float rintf(float); 386 -float scalblnf(float, long); 387 -float scalbnf(float, int); 388 -float truncf(float); 389 - 390 -float fdimf(float, float); 391 -float fmaf(float, float, float); 392 -float fmaxf(float, float) __pure2; 393 -float fminf(float, float) __pure2; 394 -#endif 395 - 396 -/* 397 - * float versions of BSD math library entry points 398 - */ 399 -#if __BSD_VISIBLE 400 -float dremf(float, float); 401 -int finitef(float) __pure2; 402 -float gammaf(float); 403 -float j0f(float); 404 -float j1f(float); 405 -float jnf(int, float); 406 -float scalbf(float, float); 407 -float y0f(float); 408 -float y1f(float); 409 -float ynf(int, float); 410 - 411 -/* 412 - * Float versions of reentrant version of gamma & lgamma; passes 413 - * signgam back by reference as the second argument; user must 414 - * allocate space for signgam. 415 - */ 416 -float gammaf_r(float, int *); 417 -float lgammaf_r(float, int *); 418 - 419 -/* 420 - * float version of IEEE Test Vector 421 - */ 422 -float significandf(float); 423 -#endif /* __BSD_VISIBLE */ 424 425 -/* 426 - * long double versions of ISO/POSIX math functions 427 - */ 428 -#if __ISO_C_VISIBLE >= 1999 429 -long double acoshl(long double); 430 -long double acosl(long double); 431 -long double asinhl(long double); 432 -long double asinl(long double); 433 -long double atan2l(long double, long double); 434 -long double atanhl(long double); 435 -long double atanl(long double); 436 -long double cbrtl(long double); 437 -long double ceill(long double); 438 -long double copysignl(long double, long double) __pure2; 439 -long double coshl(long double); 440 -long double cosl(long double); 441 -long double erfcl(long double); 442 -long double erfl(long double); 443 -long double exp2l(long double); 444 -long double expl(long double); 445 -long double expm1l(long double); 446 -long double fabsl(long double) __pure2; 447 -long double fdiml(long double, long double); 448 -long double floorl(long double); 449 -long double fmal(long double, long double, long double); 450 -long double fmaxl(long double, long double) __pure2; 451 -long double fminl(long double, long double) __pure2; 452 -long double fmodl(long double, long double); 453 -long double frexpl(long double, int *); /* fundamentally !__pure2 */ 454 -long double hypotl(long double, long double); 455 -int ilogbl(long double) __pure2; 456 -long double ldexpl(long double, int); 457 -long double lgammal(long double); 458 -long long llrintl(long double); 459 -long long llroundl(long double); 460 -long double log10l(long double); 461 -long double log1pl(long double); 462 -long double log2l(long double); 463 -long double logbl(long double); 464 -long double logl(long double); 465 -long lrintl(long double); 466 -long lroundl(long double); 467 -long double modfl(long double, long double *); /* fundamentally !__pure2 */ 468 -long double nanl(const char *) __pure2; 469 -long double nearbyintl(long double); 470 -long double nextafterl(long double, long double); 471 -double nexttoward(double, long double); 472 -float nexttowardf(float, long double); 473 -long double nexttowardl(long double, long double); 474 -long double powl(long double, long double); 475 -long double remainderl(long double, long double); 476 -long double remquol(long double, long double, int *); 477 -long double rintl(long double); 478 -long double roundl(long double); 479 -long double scalblnl(long double, long); 480 -long double scalbnl(long double, int); 481 -long double sinhl(long double); 482 -long double sinl(long double); 483 -long double sqrtl(long double); 484 -long double tanhl(long double); 485 -long double tanl(long double); 486 -long double tgammal(long double); 487 -long double truncl(long double); 488 -#endif /* __ISO_C_VISIBLE >= 1999 */ 489 - 490 -#if __BSD_VISIBLE 491 -long double lgammal_r(long double, int *); 492 -void sincos(double, double *, double *); 493 -void sincosf(float, float *, float *); 494 -void sincosl(long double, long double *, long double *); 495 -double cospi(double); 496 -float cospif(float); 497 -long double cospil(long double); 498 -double sinpi(double); 499 -float sinpif(float); 500 -long double sinpil(long double); 501 -double tanpi(double); 502 -float tanpif(float); 503 -long double tanpil(long double); 504 -#endif 505 - 506 -__END_DECLS 507 +float hypotf(float, float); 508 509 #endif /* !_MATH_H_ */