diff options
author | Francois-Xavier Coudert <coudert@clipper.ens.fr> | 2006-12-06 22:49:55 +0100 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2006-12-06 21:49:55 +0000 |
commit | eb647f7d99c589f55a643403e7ab0e3cf5e78867 (patch) | |
tree | 0a0aa053c7b5edceafd1800778f20b7eb32a9f8a /libgfortran/intrinsics | |
parent | b4c811bd14e0b3ea5a995b711aae60ee1d3daaab (diff) | |
download | gcc-eb647f7d99c589f55a643403e7ab0e3cf5e78867.zip gcc-eb647f7d99c589f55a643403e7ab0e3cf5e78867.tar.gz gcc-eb647f7d99c589f55a643403e7ab0e3cf5e78867.tar.bz2 |
re PR libfortran/29810 (Unsatisfied symbol "fmodl" in libgfortran shared library)
PR libfortran/29810
* intrinsics/c99_functions.c (fmodf, fmodl, floorl): New functions.
* c99_protos.h (fmodf, fmodl, floorl): New prototypes.
* configure.ac: Check for fmodf, fmod and fmodl.
* configure: Regenerate.
* config.h.in: Regenerate.
From-SVN: r119599
Diffstat (limited to 'libgfortran/intrinsics')
-rw-r--r-- | libgfortran/intrinsics/c99_functions.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/libgfortran/intrinsics/c99_functions.c b/libgfortran/intrinsics/c99_functions.c index 96b5ef8..7278169 100644 --- a/libgfortran/intrinsics/c99_functions.c +++ b/libgfortran/intrinsics/c99_functions.c @@ -294,6 +294,15 @@ floorf(float x) } #endif +#ifndef HAVE_FMODF +#define HAVE_FMODF 1 +float +fmodf (float x, float y) +{ + return (float) fmod (x, y); +} +#endif + #ifndef HAVE_FREXPF #define HAVE_FREXPF 1 float @@ -592,6 +601,47 @@ log10l(long double x) #endif +#ifndef HAVE_FLOORL +#define HAVE_FLOORL 1 +long double +floorl (long double x) +{ + /* Zero, possibly signed. */ + if (x == 0) + return x; + + /* Large magnitude. */ + if (x > DBL_MAX || x < (-DBL_MAX)) + return x; + + /* Small positive values. */ + if (x >= 0 && x < DBL_MIN) + return 0; + + /* Small negative values. */ + if (x < 0 && x > (-DBL_MIN)) + return -1; + + return floor (x); +} +#endif + + +#ifndef HAVE_FMODL +#define HAVE_FMODL 1 +long double +fmodl (long double x, long double y) +{ + if (y == 0.0L) + return 0.0L; + + /* Need to check that the result has the same sign as x and magnitude + less than the magnitude of y. */ + return x - floorl (x / y) * y; +} +#endif + + #if !defined(HAVE_CABSF) #define HAVE_CABSF 1 float |