aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pj_internal.c4
-rw-r--r--src/proj_internal.h8
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
}