Skip to content

Commit 43b3150

Browse files
authored
Merge pull request #54 from szhorvat/fix/msvc-nan-2
2 parents 2584866 + cee4d30 commit 43b3150

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/hzeta.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,23 @@
4646
#define _USE_MATH_DEFINES
4747
#endif
4848

49-
#include <math.h>
50-
#include <stdio.h>
51-
#include "hzeta.h"
52-
#include "plfit_error.h"
53-
5449
/* Work around bug in some Windows SDK / MSVC versions where NAN is not a
5550
* constant expression, triggering an error in the definition of
5651
* hsl_sf_hzeta_eulermaclaurin_series_coeffs[] and
5752
* hsl_sf_hzeta_eulermaclaurin_series_majorantratios[] below.
5853
* We re-define NAN to the value it had in earlier MSVC versions.
5954
* See https://github.com/igraph/igraph/issues/2701
55+
* and https://developercommunity.visualstudio.com/t/NAN-is-no-longer-compile-time-constant-i/10688907
6056
*/
6157
#ifdef _MSC_VER
62-
#undef NAN
63-
#define NAN (-(float)(((float)(1e+300 * 1e+300)) * 0.0F))
58+
#define _UCRT_NOISY_NAN
6459
#endif
6560

61+
#include <math.h>
62+
#include <stdio.h>
63+
#include "hzeta.h"
64+
#include "plfit_error.h"
65+
6666
/* imported from gsl_machine.h */
6767

6868
#define GSL_LOG_DBL_MIN (-7.0839641853226408e+02)

0 commit comments

Comments
 (0)