Skip to content

Commit

Permalink
Since NAN is handled in gmt_notposix.h, move the new definition to th…
Browse files Browse the repository at this point in the history
…at file.
  • Loading branch information
joa-quim committed Nov 20, 2024
1 parent 0428da1 commit d8d68c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
11 changes: 0 additions & 11 deletions src/gmt_common_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,6 @@ extern "C" {
# define int64_abs(x) ((int64_t)(((x) >= 0) ? (x) : -(x)))
#endif

/* Apparently NAN may not be defined anymore in new Visual Studio headers.
See https://github.com/conda-forge/gmt-feedstock/pull/302#issuecomment-2487473474
I found it in, and recopying it here:
"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt\corecrt_math.h"
*/
#ifdef _WIN32
# ifndef NAN
# define NAN (-(float)(((float)(1e+300 * 1e+300)) * 0.0F))
# endif
#endif

#ifdef __CYGWIN__ /* See http://gmt.soest.hawaii.edu/boards/1/topics/5428 */
#ifdef __x86_64
#define lrint(x) ((long int)(int)lrint(x))
Expand Down
4 changes: 2 additions & 2 deletions src/gmt_notposix.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@

#ifndef NAN
# ifdef _MSC_VER
# include <ymath.h>
# define NAN _Nan._Double
static const double _NAN = (-(float)(((float)(1e+300 * 1e+300)) * 0.0F));
# define NAN _NAN
# else /* _MSC_VER */
static const double _NAN = (HUGE_VAL-HUGE_VAL);
# define NAN _NAN
Expand Down

0 comments on commit d8d68c3

Please sign in to comment.