Skip to content

Commit

Permalink
refactor: better workaround for Windows 11 SDK bug where NAN is defin…
Browse files Browse the repository at this point in the history
…ed ni a non-constant way
  • Loading branch information
szhorvat committed Jan 2, 2025
1 parent 56f041c commit cee4d30
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/hzeta.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,23 @@
#define _USE_MATH_DEFINES
#endif

#include <math.h>
#include <stdio.h>
#include "hzeta.h"
#include "plfit_error.h"

/* Work around bug in some Windows SDK / MSVC versions where NAN is not a
* constant expression, triggering an error in the definition of
* hsl_sf_hzeta_eulermaclaurin_series_coeffs[] and
* hsl_sf_hzeta_eulermaclaurin_series_majorantratios[] below.
* We re-define NAN to the value it had in earlier MSVC versions.
* See https://github.com/igraph/igraph/issues/2701
* and https://developercommunity.visualstudio.com/t/NAN-is-no-longer-compile-time-constant-i/10688907
*/
#ifdef _MSC_VER
#undef NAN
#define NAN (-(float)(((float)(1e+300 * 1e+300)) * 0.0F))
#define _UCRT_NOISY_NAN
#endif

#include <math.h>
#include <stdio.h>
#include "hzeta.h"
#include "plfit_error.h"

/* imported from gsl_machine.h */

#define GSL_LOG_DBL_MIN (-7.0839641853226408e+02)
Expand Down

0 comments on commit cee4d30

Please sign in to comment.