00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _GL_MATH_H
00021
00022 #if __GNUC__ >= 3
00023 @PRAGMA_SYSTEM_HEADER@
00024 #endif
00025 @PRAGMA_COLUMNS@
00026
00027
00028 #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
00029
00030 #ifndef _GL_MATH_H
00031 #define _GL_MATH_H
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #define _GL_WARN_REAL_FLOATING_DECL(func) \
00045 static inline int \
00046 rpl_ ## func ## f (float f) \
00047 { \
00048 return func (f); \
00049 } \
00050 static inline int \
00051 rpl_ ## func ## d (double d) \
00052 { \
00053 return func (d); \
00054 } \
00055 static inline int \
00056 rpl_ ## func ## l (long double l) \
00057 { \
00058 return func (l); \
00059 } \
00060 _GL_WARN_ON_USE (rpl_ ## func ## f, #func " is unportable - " \
00061 "use gnulib module " #func " for portability"); \
00062 _GL_WARN_ON_USE (rpl_ ## func ## d, #func " is unportable - " \
00063 "use gnulib module " #func " for portability"); \
00064 _GL_WARN_ON_USE (rpl_ ## func ## l, #func " is unportable - " \
00065 "use gnulib module " #func " for portability")
00066 #define _GL_WARN_REAL_FLOATING_IMPL(func, value) \
00067 (sizeof (value) == sizeof (float) ? rpl_ ## func ## f (value) \
00068 : sizeof (value) == sizeof (double) ? rpl_ ## func ## d (value) \
00069 : rpl_ ## func ## l (value))
00070
00071
00072
00073
00074
00075
00076
00077 #if !defined NAN || @REPLACE_NAN@
00078 # if !GNULIB_defined_NAN
00079 # undef NAN
00080
00081 # ifdef __DECC
00082 static float
00083 _NaN ()
00084 {
00085 static float zero = 0.0f;
00086 return zero / zero;
00087 }
00088 # define NAN (_NaN())
00089 # else
00090 # define NAN (0.0f / 0.0f)
00091 # endif
00092 # define GNULIB_defined_NAN 1
00093 # endif
00094 #endif
00095
00096
00097
00098 #if @REPLACE_HUGE_VAL@
00099 # undef HUGE_VAL
00100 # define HUGE_VAL (1.0 / 0.0)
00101 #endif
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111 #if @GNULIB_FREXP@
00112 # if @REPLACE_FREXP@
00113 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00114 # define frexp rpl_frexp
00115 # endif
00116 _GL_FUNCDECL_RPL (frexp, double, (double x, int *expptr) _GL_ARG_NONNULL ((2)));
00117 _GL_CXXALIAS_RPL (frexp, double, (double x, int *expptr));
00118 # else
00119 _GL_CXXALIAS_SYS (frexp, double, (double x, int *expptr));
00120 # endif
00121 _GL_CXXALIASWARN (frexp);
00122 #elif defined GNULIB_POSIXCHECK
00123 # undef frexp
00124
00125 _GL_WARN_ON_USE (frexp, "frexp is unportable - "
00126 "use gnulib module frexp for portability");
00127 #endif
00128
00129
00130 #if @GNULIB_LOGB@
00131 # if !@HAVE_DECL_LOGB@
00132 _GL_EXTERN_C double logb (double x);
00133 # endif
00134 #elif defined GNULIB_POSIXCHECK
00135 # undef logb
00136 # if HAVE_RAW_DECL_LOGB
00137 _GL_WARN_ON_USE (logb, "logb is unportable - "
00138 "use gnulib module logb for portability");
00139 # endif
00140 #endif
00141
00142
00143 #if @GNULIB_ACOSL@
00144 # if !@HAVE_ACOSL@ || !@HAVE_DECL_ACOSL@
00145 _GL_FUNCDECL_SYS (acosl, long double, (long double x));
00146 # endif
00147 _GL_CXXALIAS_SYS (acosl, long double, (long double x));
00148 _GL_CXXALIASWARN (acosl);
00149 #elif defined GNULIB_POSIXCHECK
00150 # undef acosl
00151 # if HAVE_RAW_DECL_ACOSL
00152 _GL_WARN_ON_USE (acosl, "acosl is unportable - "
00153 "use gnulib module mathl for portability");
00154 # endif
00155 #endif
00156
00157
00158 #if @GNULIB_ASINL@
00159 # if !@HAVE_ASINL@ || !@HAVE_DECL_ASINL@
00160 _GL_FUNCDECL_SYS (asinl, long double, (long double x));
00161 # endif
00162 _GL_CXXALIAS_SYS (asinl, long double, (long double x));
00163 _GL_CXXALIASWARN (asinl);
00164 #elif defined GNULIB_POSIXCHECK
00165 # undef asinl
00166 # if HAVE_RAW_DECL_ASINL
00167 _GL_WARN_ON_USE (asinl, "asinl is unportable - "
00168 "use gnulib module mathl for portability");
00169 # endif
00170 #endif
00171
00172
00173 #if @GNULIB_ATANL@
00174 # if !@HAVE_ATANL@ || !@HAVE_DECL_ATANL@
00175 _GL_FUNCDECL_SYS (atanl, long double, (long double x));
00176 # endif
00177 _GL_CXXALIAS_SYS (atanl, long double, (long double x));
00178 _GL_CXXALIASWARN (atanl);
00179 #elif defined GNULIB_POSIXCHECK
00180 # undef atanl
00181 # if HAVE_RAW_DECL_ATANL
00182 _GL_WARN_ON_USE (atanl, "atanl is unportable - "
00183 "use gnulib module mathl for portability");
00184 # endif
00185 #endif
00186
00187
00188 #if @GNULIB_CEILF@
00189 # if @REPLACE_CEILF@
00190 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00191 # define ceilf rpl_ceilf
00192 # endif
00193 _GL_FUNCDECL_RPL (ceilf, float, (float x));
00194 _GL_CXXALIAS_RPL (ceilf, float, (float x));
00195 # else
00196 # if !@HAVE_DECL_CEILF@
00197 _GL_FUNCDECL_SYS (ceilf, float, (float x));
00198 # endif
00199 _GL_CXXALIAS_SYS (ceilf, float, (float x));
00200 # endif
00201 _GL_CXXALIASWARN (ceilf);
00202 #elif defined GNULIB_POSIXCHECK
00203 # undef ceilf
00204 # if HAVE_RAW_DECL_CEILF
00205 _GL_WARN_ON_USE (ceilf, "ceilf is unportable - "
00206 "use gnulib module ceilf for portability");
00207 # endif
00208 #endif
00209
00210 #if @GNULIB_CEIL@
00211 # if @REPLACE_CEIL@
00212 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00213 # define ceil rpl_ceil
00214 # endif
00215 _GL_FUNCDECL_RPL (ceil, double, (double x));
00216 _GL_CXXALIAS_RPL (ceil, double, (double x));
00217 # else
00218 _GL_CXXALIAS_SYS (ceil, double, (double x));
00219 # endif
00220 _GL_CXXALIASWARN (ceil);
00221 #endif
00222
00223 #if @GNULIB_CEILL@
00224 # if @REPLACE_CEILL@
00225 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00226 # define ceill rpl_ceill
00227 # endif
00228 _GL_FUNCDECL_RPL (ceill, long double, (long double x));
00229 _GL_CXXALIAS_RPL (ceill, long double, (long double x));
00230 # else
00231 # if !@HAVE_DECL_CEILL@
00232 _GL_FUNCDECL_SYS (ceill, long double, (long double x));
00233 # endif
00234 _GL_CXXALIAS_SYS (ceill, long double, (long double x));
00235 # endif
00236 _GL_CXXALIASWARN (ceill);
00237 #elif defined GNULIB_POSIXCHECK
00238 # undef ceill
00239 # if HAVE_RAW_DECL_CEILL
00240 _GL_WARN_ON_USE (ceill, "ceill is unportable - "
00241 "use gnulib module ceill for portability");
00242 # endif
00243 #endif
00244
00245
00246 #if @GNULIB_COSL@
00247 # if !@HAVE_COSL@ || !@HAVE_DECL_COSL@
00248 _GL_FUNCDECL_SYS (cosl, long double, (long double x));
00249 # endif
00250 _GL_CXXALIAS_SYS (cosl, long double, (long double x));
00251 _GL_CXXALIASWARN (cosl);
00252 #elif defined GNULIB_POSIXCHECK
00253 # undef cosl
00254 # if HAVE_RAW_DECL_COSL
00255 _GL_WARN_ON_USE (cosl, "cosl is unportable - "
00256 "use gnulib module mathl for portability");
00257 # endif
00258 #endif
00259
00260
00261 #if @GNULIB_EXPL@
00262 # if !@HAVE_EXPL@ || !@HAVE_DECL_EXPL@
00263 _GL_FUNCDECL_SYS (expl, long double, (long double x));
00264 # endif
00265 _GL_CXXALIAS_SYS (expl, long double, (long double x));
00266 _GL_CXXALIASWARN (expl);
00267 #elif defined GNULIB_POSIXCHECK
00268 # undef expl
00269 # if HAVE_RAW_DECL_EXPL
00270 _GL_WARN_ON_USE (expl, "expl is unportable - "
00271 "use gnulib module mathl for portability");
00272 # endif
00273 #endif
00274
00275
00276 #if @GNULIB_FLOORF@
00277 # if @REPLACE_FLOORF@
00278 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00279 # define floorf rpl_floorf
00280 # endif
00281 _GL_FUNCDECL_RPL (floorf, float, (float x));
00282 _GL_CXXALIAS_RPL (floorf, float, (float x));
00283 # else
00284 # if !@HAVE_DECL_FLOORF@
00285 _GL_FUNCDECL_SYS (floorf, float, (float x));
00286 # endif
00287 _GL_CXXALIAS_SYS (floorf, float, (float x));
00288 # endif
00289 _GL_CXXALIASWARN (floorf);
00290 #elif defined GNULIB_POSIXCHECK
00291 # undef floorf
00292 # if HAVE_RAW_DECL_FLOORF
00293 _GL_WARN_ON_USE (floorf, "floorf is unportable - "
00294 "use gnulib module floorf for portability");
00295 # endif
00296 #endif
00297
00298 #if @GNULIB_FLOOR@
00299 # if @REPLACE_FLOOR@
00300 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00301 # define floor rpl_floor
00302 # endif
00303 _GL_FUNCDECL_RPL (floor, double, (double x));
00304 _GL_CXXALIAS_RPL (floor, double, (double x));
00305 # else
00306 _GL_CXXALIAS_SYS (floor, double, (double x));
00307 # endif
00308 _GL_CXXALIASWARN (floor);
00309 #endif
00310
00311 #if @GNULIB_FLOORL@
00312 # if @REPLACE_FLOORL@
00313 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00314 # define floorl rpl_floorl
00315 # endif
00316 _GL_FUNCDECL_RPL (floorl, long double, (long double x));
00317 _GL_CXXALIAS_RPL (floorl, long double, (long double x));
00318 # else
00319 # if !@HAVE_DECL_FLOORL@
00320 _GL_FUNCDECL_SYS (floorl, long double, (long double x));
00321 # endif
00322 _GL_CXXALIAS_SYS (floorl, long double, (long double x));
00323 # endif
00324 _GL_CXXALIASWARN (floorl);
00325 #elif defined GNULIB_POSIXCHECK
00326 # undef floorl
00327 # if HAVE_RAW_DECL_FLOORL
00328 _GL_WARN_ON_USE (floorl, "floorl is unportable - "
00329 "use gnulib module floorl for portability");
00330 # endif
00331 #endif
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341 #if @GNULIB_FREXPL@ && @REPLACE_FREXPL@
00342 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00343 # define frexpl rpl_frexpl
00344 # endif
00345 _GL_FUNCDECL_RPL (frexpl, long double,
00346 (long double x, int *expptr) _GL_ARG_NONNULL ((2)));
00347 _GL_CXXALIAS_RPL (frexpl, long double, (long double x, int *expptr));
00348 #else
00349 # if !@HAVE_DECL_FREXPL@
00350 _GL_FUNCDECL_SYS (frexpl, long double,
00351 (long double x, int *expptr) _GL_ARG_NONNULL ((2)));
00352 # endif
00353 # if @GNULIB_FREXPL@
00354 _GL_CXXALIAS_SYS (frexpl, long double, (long double x, int *expptr));
00355 # endif
00356 #endif
00357 #if @GNULIB_FREXPL@ && !(@REPLACE_FREXPL@ && !@HAVE_DECL_FREXPL@)
00358 _GL_CXXALIASWARN (frexpl);
00359 #endif
00360 #if !@GNULIB_FREXPL@ && defined GNULIB_POSIXCHECK
00361 # undef frexpl
00362 # if HAVE_RAW_DECL_FREXPL
00363 _GL_WARN_ON_USE (frexpl, "frexpl is unportable - "
00364 "use gnulib module frexpl for portability");
00365 # endif
00366 #endif
00367
00368
00369
00370 #if @GNULIB_LDEXPL@ && @REPLACE_LDEXPL@
00371 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00372 # define ldexpl rpl_ldexpl
00373 # endif
00374 _GL_FUNCDECL_RPL (ldexpl, long double, (long double x, int exp));
00375 _GL_CXXALIAS_RPL (ldexpl, long double, (long double x, int exp));
00376 #else
00377 # if !@HAVE_DECL_LDEXPL@
00378 _GL_FUNCDECL_SYS (ldexpl, long double, (long double x, int exp));
00379 # endif
00380 # if @GNULIB_LDEXPL@
00381 _GL_CXXALIAS_SYS (ldexpl, long double, (long double x, int exp));
00382 # endif
00383 #endif
00384 #if @GNULIB_LDEXPL@
00385 _GL_CXXALIASWARN (ldexpl);
00386 #endif
00387 #if !@GNULIB_LDEXPL@ && defined GNULIB_POSIXCHECK
00388 # undef ldexpl
00389 # if HAVE_RAW_DECL_LDEXPL
00390 _GL_WARN_ON_USE (ldexpl, "ldexpl is unportable - "
00391 "use gnulib module ldexpl for portability");
00392 # endif
00393 #endif
00394
00395
00396 #if @GNULIB_LOGL@
00397 # if !@HAVE_LOGL@ || !@HAVE_DECL_LOGL@
00398 _GL_FUNCDECL_SYS (logl, long double, (long double x));
00399 # endif
00400 _GL_CXXALIAS_SYS (logl, long double, (long double x));
00401 _GL_CXXALIASWARN (logl);
00402 #elif defined GNULIB_POSIXCHECK
00403 # undef logl
00404 # if HAVE_RAW_DECL_LOGL
00405 _GL_WARN_ON_USE (logl, "logl is unportable - "
00406 "use gnulib module mathl for portability");
00407 # endif
00408 #endif
00409
00410
00411 #if @GNULIB_ROUNDF@
00412 # if @REPLACE_ROUNDF@
00413 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00414 # undef roundf
00415 # define roundf rpl_roundf
00416 # endif
00417 _GL_FUNCDECL_RPL (roundf, float, (float x));
00418 _GL_CXXALIAS_RPL (roundf, float, (float x));
00419 # else
00420 # if !@HAVE_DECL_ROUNDF@
00421 _GL_FUNCDECL_SYS (roundf, float, (float x));
00422 # endif
00423 _GL_CXXALIAS_SYS (roundf, float, (float x));
00424 # endif
00425 _GL_CXXALIASWARN (roundf);
00426 #elif defined GNULIB_POSIXCHECK
00427 # undef roundf
00428 # if HAVE_RAW_DECL_ROUNDF
00429 _GL_WARN_ON_USE (roundf, "roundf is unportable - "
00430 "use gnulib module roundf for portability");
00431 # endif
00432 #endif
00433
00434 #if @GNULIB_ROUND@
00435 # if @REPLACE_ROUND@
00436 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00437 # undef round
00438 # define round rpl_round
00439 # endif
00440 _GL_FUNCDECL_RPL (round, double, (double x));
00441 _GL_CXXALIAS_RPL (round, double, (double x));
00442 # else
00443 # if !@HAVE_DECL_ROUND@
00444 _GL_FUNCDECL_SYS (round, double, (double x));
00445 # endif
00446 _GL_CXXALIAS_SYS (round, double, (double x));
00447 # endif
00448 _GL_CXXALIASWARN (round);
00449 #elif defined GNULIB_POSIXCHECK
00450 # undef round
00451 # if HAVE_RAW_DECL_ROUND
00452 _GL_WARN_ON_USE (round, "round is unportable - "
00453 "use gnulib module round for portability");
00454 # endif
00455 #endif
00456
00457 #if @GNULIB_ROUNDL@
00458 # if @REPLACE_ROUNDL@
00459 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00460 # undef roundl
00461 # define roundl rpl_roundl
00462 # endif
00463 _GL_FUNCDECL_RPL (roundl, long double, (long double x));
00464 _GL_CXXALIAS_RPL (roundl, long double, (long double x));
00465 # else
00466 # if !@HAVE_DECL_ROUNDL@
00467 _GL_FUNCDECL_SYS (roundl, long double, (long double x));
00468 # endif
00469 _GL_CXXALIAS_SYS (roundl, long double, (long double x));
00470 # endif
00471 _GL_CXXALIASWARN (roundl);
00472 #elif defined GNULIB_POSIXCHECK
00473 # undef roundl
00474 # if HAVE_RAW_DECL_ROUNDL
00475 _GL_WARN_ON_USE (roundl, "roundl is unportable - "
00476 "use gnulib module roundl for portability");
00477 # endif
00478 #endif
00479
00480
00481 #if @GNULIB_SINL@
00482 # if !@HAVE_SINL@ || !@HAVE_DECL_SINL@
00483 _GL_FUNCDECL_SYS (sinl, long double, (long double x));
00484 # endif
00485 _GL_CXXALIAS_SYS (sinl, long double, (long double x));
00486 _GL_CXXALIASWARN (sinl);
00487 #elif defined GNULIB_POSIXCHECK
00488 # undef sinl
00489 # if HAVE_RAW_DECL_SINL
00490 _GL_WARN_ON_USE (sinl, "sinl is unportable - "
00491 "use gnulib module mathl for portability");
00492 # endif
00493 #endif
00494
00495
00496 #if @GNULIB_SQRTL@
00497 # if !@HAVE_SQRTL@ || !@HAVE_DECL_SQRTL@
00498 _GL_FUNCDECL_SYS (sqrtl, long double, (long double x));
00499 # endif
00500 _GL_CXXALIAS_SYS (sqrtl, long double, (long double x));
00501 _GL_CXXALIASWARN (sqrtl);
00502 #elif defined GNULIB_POSIXCHECK
00503 # undef sqrtl
00504 # if HAVE_RAW_DECL_SQRTL
00505 _GL_WARN_ON_USE (sqrtl, "sqrtl is unportable - "
00506 "use gnulib module mathl for portability");
00507 # endif
00508 #endif
00509
00510
00511 #if @GNULIB_TANL@
00512 # if !@HAVE_TANL@ || !@HAVE_DECL_TANL@
00513 _GL_FUNCDECL_SYS (tanl, long double, (long double x));
00514 # endif
00515 _GL_CXXALIAS_SYS (tanl, long double, (long double x));
00516 _GL_CXXALIASWARN (tanl);
00517 #elif defined GNULIB_POSIXCHECK
00518 # undef tanl
00519 # if HAVE_RAW_DECL_TANL
00520 _GL_WARN_ON_USE (tanl, "tanl is unportable - "
00521 "use gnulib module mathl for portability");
00522 # endif
00523 #endif
00524
00525
00526 #if @GNULIB_TRUNCF@
00527 # if @REPLACE_TRUNCF@
00528 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00529 # define truncf rpl_truncf
00530 # endif
00531 _GL_FUNCDECL_RPL (truncf, float, (float x));
00532 _GL_CXXALIAS_RPL (truncf, float, (float x));
00533 # else
00534 # if !@HAVE_DECL_TRUNCF@
00535 _GL_FUNCDECL_SYS (truncf, float, (float x));
00536 # endif
00537 _GL_CXXALIAS_SYS (truncf, float, (float x));
00538 # endif
00539 _GL_CXXALIASWARN (truncf);
00540 #elif defined GNULIB_POSIXCHECK
00541 # undef truncf
00542 # if HAVE_RAW_DECL_TRUNCF
00543 _GL_WARN_ON_USE (truncf, "truncf is unportable - "
00544 "use gnulib module truncf for portability");
00545 # endif
00546 #endif
00547
00548 #if @GNULIB_TRUNC@
00549 # if @REPLACE_TRUNC@
00550 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00551 # define trunc rpl_trunc
00552 # endif
00553 _GL_FUNCDECL_RPL (trunc, double, (double x));
00554 _GL_CXXALIAS_RPL (trunc, double, (double x));
00555 # else
00556 # if !@HAVE_DECL_TRUNC@
00557 _GL_FUNCDECL_SYS (trunc, double, (double x));
00558 # endif
00559 _GL_CXXALIAS_SYS (trunc, double, (double x));
00560 # endif
00561 _GL_CXXALIASWARN (trunc);
00562 #elif defined GNULIB_POSIXCHECK
00563 # undef trunc
00564 # if HAVE_RAW_DECL_TRUNC
00565 _GL_WARN_ON_USE (trunc, "trunc is unportable - "
00566 "use gnulib module trunc for portability");
00567 # endif
00568 #endif
00569
00570 #if @GNULIB_TRUNCL@
00571 # if @REPLACE_TRUNCL@
00572 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00573 # undef truncl
00574 # define truncl rpl_truncl
00575 # endif
00576 _GL_FUNCDECL_RPL (truncl, long double, (long double x));
00577 _GL_CXXALIAS_RPL (truncl, long double, (long double x));
00578 # else
00579 # if !@HAVE_DECL_TRUNCL@
00580 _GL_FUNCDECL_SYS (truncl, long double, (long double x));
00581 # endif
00582 _GL_CXXALIAS_SYS (truncl, long double, (long double x));
00583 # endif
00584 _GL_CXXALIASWARN (truncl);
00585 #elif defined GNULIB_POSIXCHECK
00586 # undef truncl
00587 # if HAVE_RAW_DECL_TRUNCL
00588 _GL_WARN_ON_USE (truncl, "truncl is unportable - "
00589 "use gnulib module truncl for portability");
00590 # endif
00591 #endif
00592
00593
00594 #if @GNULIB_ISFINITE@
00595 # if @REPLACE_ISFINITE@
00596 _GL_EXTERN_C int gl_isfinitef (float x);
00597 _GL_EXTERN_C int gl_isfinited (double x);
00598 _GL_EXTERN_C int gl_isfinitel (long double x);
00599 # undef isfinite
00600 # define isfinite(x) \
00601 (sizeof (x) == sizeof (long double) ? gl_isfinitel (x) : \
00602 sizeof (x) == sizeof (double) ? gl_isfinited (x) : \
00603 gl_isfinitef (x))
00604 # endif
00605 #elif defined GNULIB_POSIXCHECK
00606 # if defined isfinite
00607 _GL_WARN_REAL_FLOATING_DECL (isfinite);
00608 # undef isfinite
00609 # define isfinite(x) _GL_WARN_REAL_FLOATING_IMPL (isfinite, x)
00610 # endif
00611 #endif
00612
00613
00614 #if @GNULIB_ISINF@
00615 # if @REPLACE_ISINF@
00616 _GL_EXTERN_C int gl_isinff (float x);
00617 _GL_EXTERN_C int gl_isinfd (double x);
00618 _GL_EXTERN_C int gl_isinfl (long double x);
00619 # undef isinf
00620 # define isinf(x) \
00621 (sizeof (x) == sizeof (long double) ? gl_isinfl (x) : \
00622 sizeof (x) == sizeof (double) ? gl_isinfd (x) : \
00623 gl_isinff (x))
00624 # endif
00625 #elif defined GNULIB_POSIXCHECK
00626 # if defined isinf
00627 _GL_WARN_REAL_FLOATING_DECL (isinf);
00628 # undef isinf
00629 # define isinf(x) _GL_WARN_REAL_FLOATING_IMPL (isinf, x)
00630 # endif
00631 #endif
00632
00633
00634 #if @GNULIB_ISNANF@
00635
00636 # if @HAVE_ISNANF@
00637
00638
00639 # if __GNUC__ >= 4
00640
00641 # undef isnanf
00642 # define isnanf(x) __builtin_isnanf ((float)(x))
00643 # elif defined isnan
00644 # undef isnanf
00645 # define isnanf(x) isnan ((float)(x))
00646 # endif
00647 # else
00648
00649 # undef isnanf
00650 # define isnanf rpl_isnanf
00651 _GL_EXTERN_C int isnanf (float x);
00652 # endif
00653 #endif
00654
00655 #if @GNULIB_ISNAND@
00656
00657
00658
00659 # if @HAVE_ISNAND@
00660
00661
00662 # if __GNUC__ >= 4
00663
00664 # undef isnand
00665 # define isnand(x) __builtin_isnan ((double)(x))
00666 # else
00667 # undef isnand
00668 # define isnand(x) isnan ((double)(x))
00669 # endif
00670 # else
00671
00672 # undef isnand
00673 # define isnand rpl_isnand
00674 _GL_EXTERN_C int isnand (double x);
00675 # endif
00676 #endif
00677
00678 #if @GNULIB_ISNANL@
00679
00680 # if @HAVE_ISNANL@
00681
00682
00683 # if __GNUC__ >= 4
00684
00685 # undef isnanl
00686 # define isnanl(x) __builtin_isnanl ((long double)(x))
00687 # elif defined isnan
00688 # undef isnanl
00689 # define isnanl(x) isnan ((long double)(x))
00690 # endif
00691 # else
00692
00693 # undef isnanl
00694 # define isnanl rpl_isnanl
00695 _GL_EXTERN_C int isnanl (long double x);
00696 # endif
00697 #endif
00698
00699
00700 #if @GNULIB_ISNAN@
00701 # if @REPLACE_ISNAN@
00702
00703
00704
00705
00706 # if @HAVE_ISNANF@ && __GNUC__ >= 4
00707 # define gl_isnan_f(x) __builtin_isnanf ((float)(x))
00708 # else
00709 _GL_EXTERN_C int rpl_isnanf (float x);
00710 # define gl_isnan_f(x) rpl_isnanf (x)
00711 # endif
00712 # if @HAVE_ISNAND@ && __GNUC__ >= 4
00713 # define gl_isnan_d(x) __builtin_isnan ((double)(x))
00714 # else
00715 _GL_EXTERN_C int rpl_isnand (double x);
00716 # define gl_isnan_d(x) rpl_isnand (x)
00717 # endif
00718 # if @HAVE_ISNANL@ && __GNUC__ >= 4
00719 # define gl_isnan_l(x) __builtin_isnanl ((long double)(x))
00720 # else
00721 _GL_EXTERN_C int rpl_isnanl (long double x);
00722 # define gl_isnan_l(x) rpl_isnanl (x)
00723 # endif
00724 # undef isnan
00725 # define isnan(x) \
00726 (sizeof (x) == sizeof (long double) ? gl_isnan_l (x) : \
00727 sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \
00728 gl_isnan_f (x))
00729 # elif __GNUC__ >= 4
00730 # undef isnan
00731 # define isnan(x) \
00732 (sizeof (x) == sizeof (long double) ? __builtin_isnanl ((long double)(x)) : \
00733 sizeof (x) == sizeof (double) ? __builtin_isnan ((double)(x)) : \
00734 __builtin_isnanf ((float)(x)))
00735 # endif
00736
00737 # ifndef isnan
00738 # define isnan isnan
00739 # endif
00740 #elif defined GNULIB_POSIXCHECK
00741 # if defined isnan
00742 _GL_WARN_REAL_FLOATING_DECL (isnan);
00743 # undef isnan
00744 # define isnan(x) _GL_WARN_REAL_FLOATING_IMPL (isnan, x)
00745 # endif
00746 #endif
00747
00748
00749 #if @GNULIB_SIGNBIT@
00750 # if @REPLACE_SIGNBIT_USING_GCC@
00751 # undef signbit
00752
00753 # define signbit(x) \
00754 (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
00755 sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \
00756 __builtin_signbitf (x))
00757 # endif
00758 # if @REPLACE_SIGNBIT@
00759 # undef signbit
00760 _GL_EXTERN_C int gl_signbitf (float arg);
00761 _GL_EXTERN_C int gl_signbitd (double arg);
00762 _GL_EXTERN_C int gl_signbitl (long double arg);
00763 # if __GNUC__ >= 2 && !__STRICT_ANSI__
00764 # define _GL_NUM_UINT_WORDS(type) \
00765 ((sizeof (type) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
00766 # if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT && !defined gl_signbitf
00767 # define gl_signbitf_OPTIMIZED_MACRO
00768 # define gl_signbitf(arg) \
00769 ({ union { float _value; \
00770 unsigned int _word[_GL_NUM_UINT_WORDS (float)]; \
00771 } _m; \
00772 _m._value = (arg); \
00773 (_m._word[FLT_SIGNBIT_WORD] >> FLT_SIGNBIT_BIT) & 1; \
00774 })
00775 # endif
00776 # if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT && !defined gl_signbitd
00777 # define gl_signbitd_OPTIMIZED_MACRO
00778 # define gl_signbitd(arg) \
00779 ({ union { double _value; \
00780 unsigned int _word[_GL_NUM_UINT_WORDS (double)]; \
00781 } _m; \
00782 _m._value = (arg); \
00783 (_m._word[DBL_SIGNBIT_WORD] >> DBL_SIGNBIT_BIT) & 1; \
00784 })
00785 # endif
00786 # if defined LDBL_SIGNBIT_WORD && defined LDBL_SIGNBIT_BIT && !defined gl_signbitl
00787 # define gl_signbitl_OPTIMIZED_MACRO
00788 # define gl_signbitl(arg) \
00789 ({ union { long double _value; \
00790 unsigned int _word[_GL_NUM_UINT_WORDS (long double)]; \
00791 } _m; \
00792 _m._value = (arg); \
00793 (_m._word[LDBL_SIGNBIT_WORD] >> LDBL_SIGNBIT_BIT) & 1; \
00794 })
00795 # endif
00796 # endif
00797 # define signbit(x) \
00798 (sizeof (x) == sizeof (long double) ? gl_signbitl (x) : \
00799 sizeof (x) == sizeof (double) ? gl_signbitd (x) : \
00800 gl_signbitf (x))
00801 # endif
00802 #elif defined GNULIB_POSIXCHECK
00803 # if defined signbit
00804 _GL_WARN_REAL_FLOATING_DECL (signbit);
00805 # undef signbit
00806 # define signbit(x) _GL_WARN_REAL_FLOATING_IMPL (signbit, x)
00807 # endif
00808 #endif
00809
00810
00811 #endif
00812 #endif