diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2018-05-23 15:02:28 +0200 |
|---|---|---|
| committer | Kristian Evers <kristianevers@gmail.com> | 2018-05-23 17:20:20 +0200 |
| commit | 6db260ff7857fcec63e5988ed43ecebc358a811d (patch) | |
| tree | 2ab9072af6e144ba6c8e491836e1630f843f1ce7 /src/pj_math.c | |
| parent | f5c8188faa44ba8dbae533c295d6ae013422f3b9 (diff) | |
| download | PROJ-6db260ff7857fcec63e5988ed43ecebc358a811d.tar.gz PROJ-6db260ff7857fcec63e5988ed43ecebc358a811d.zip | |
Add pj_isnan to proj.def to avoid linking errors for some MSVC versions
Diffstat (limited to 'src/pj_math.c')
| -rw-r--r-- | src/pj_math.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/pj_math.c b/src/pj_math.c index 97d4ae56..540ab9eb 100644 --- a/src/pj_math.c +++ b/src/pj_math.c @@ -27,6 +27,21 @@ #include "proj_math.h" +/* pj_isnan is used in gie.c which means that is has to */ +/* be exported in the Windows DLL and therefore needs */ +/* to be declared even though we have isnan() on the */ +/* system. */ + +#ifdef HAVE_C99_MATH +int pj_isnan (double x); +#endif + +/* Returns 0 if not a NaN and non-zero if val is a NaN */ +int pj_isnan (double x) { + /* cppcheck-suppress duplicateExpression */ + return x != x; +} + #if !(defined(HAVE_C99_MATH) && HAVE_C99_MATH) /* Compute hypotenuse */ @@ -61,12 +76,6 @@ double pj_asinh(double x) { return x > 0 ? y : (x < 0 ? -y : x); } -/* Returns 0 if not a NaN and non-zero if val is a NaN */ -int pj_isnan (double x) { - /* cppcheck-suppress duplicateExpression */ - return x != x; -} - double pj_round(double x) { /* The handling of corner cases is copied from boost; see * https://github.com/boostorg/math/pull/8 |
