diff options
| author | Charles Karney <charles@karney.com> | 2018-03-23 06:26:26 -0400 |
|---|---|---|
| committer | Charles Karney <charles@karney.com> | 2018-03-23 06:26:26 -0400 |
| commit | 667a3fc73240015effa4c5892366e9c6a6bc6bfe (patch) | |
| tree | b180f45a7922ef8cbb25ecc08f5753889b83c2d7 /src | |
| parent | 3cd307366ab86c3351d77ba5fd19d5a56e76d239 (diff) | |
| download | PROJ-667a3fc73240015effa4c5892366e9c6a6bc6bfe.tar.gz PROJ-667a3fc73240015effa4c5892366e9c6a6bc6bfe.zip | |
If HAVE_C99_MATH, then pj_is_nan is defined as isnan.
This required extending the HAVE_C99_MATH checks in CMakeLists.txt and
configure.ac to include a test for the C99 function isnan.
Diffstat (limited to 'src')
| -rw-r--r-- | src/pj_internal.c | 4 | ||||
| -rw-r--r-- | src/proj_internal.h | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/pj_internal.c b/src/pj_internal.c index 9cbbf20a..4da47051 100644 --- a/src/pj_internal.c +++ b/src/pj_internal.c @@ -445,6 +445,9 @@ void proj_log_func (PJ_CONTEXT *ctx, void *app_data, PJ_LOG_FUNCTION logf) { } +#if HAVE_C99_MATH +/* proj_internal.h defines pj_is_nan as isnan */ +#else /*****************************************************************************/ int pj_is_nan (double val) { /****************************************************************************** @@ -455,3 +458,4 @@ int pj_is_nan (double val) { /* cppcheck-suppress duplicateExpression */ return val != val; } +#endif diff --git a/src/proj_internal.h b/src/proj_internal.h index b3843a59..3f6ccde0 100644 --- a/src/proj_internal.h +++ b/src/proj_internal.h @@ -50,6 +50,10 @@ extern "C" { #define STATIC_ASSERT(COND) ((void)sizeof(char[(COND) ? 1 : -1])) +#if !defined(HAVE_C99_MATH) +#define HAVE_C99_MATH 0 +#endif + #ifndef PJ_TODEG #define PJ_TODEG(rad) ((rad)*180.0/M_PI) #endif @@ -130,7 +134,11 @@ void proj_fileapi_set (PJ *P, void *fileapi); const char * const *proj_get_searchpath(void); int proj_get_path_count(void); +#if HAVE_C99_MATH +#define pj_is_nan isnan +#else int pj_is_nan (double val); +#endif #ifdef __cplusplus } |
