Skip to content

Commit

Permalink
vendor: Update vendored sources to igraph/igraph@ab123f0
Browse files Browse the repository at this point in the history
chore: update plfit, works around non-compile-time-constant NAN bug in recent Windows 11 SDKs
  • Loading branch information
krlmlr committed Jan 6, 2025
1 parent 3e067f7 commit 4d55ad4
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/vendor/cigraph/vendor/plfit/arithmetic_sse_double.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

inline static void* vecalloc(size_t size)
{
#ifdef _MSC_VER
#ifdef _WIN32
void *memblock = _aligned_malloc(size, 16);
#elif defined(__APPLE__)
/* Memory on Mac OS X is already aligned to 16 bytes */
Expand All @@ -59,7 +59,7 @@ inline static void* vecalloc(size_t size)

inline static void vecfree(void *memblock)
{
#ifdef _MSC_VER
#ifdef _WIN32
_aligned_free(memblock);
#else
free(memblock);
Expand Down
1 change: 0 additions & 1 deletion src/vendor/cigraph/vendor/plfit/gss.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <string.h>
#include "plfit_error.h"
#include "gss.h"
#include "platform.h"

/**
* \def PHI
Expand Down
13 changes: 12 additions & 1 deletion src/vendor/cigraph/vendor/plfit/hzeta.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,18 @@
#include <stdio.h>
#include "hzeta.h"
#include "plfit_error.h"
#include "platform.h" /* because of NAN */

/* 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
*/
#ifdef _MSC_VER
#undef NAN
#define NAN (-(float)(((float)(1e+300 * 1e+300)) * 0.0F))
#endif

/* imported from gsl_machine.h */

Expand Down
9 changes: 0 additions & 9 deletions src/vendor/cigraph/vendor/plfit/lbfgs.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,11 @@ licence.
#include "config.h"
#endif/*HAVE_CONFIG_H*/

#ifndef _MSC_VER
#include <stdint.h>
#endif

#include <stdio.h>
#include <math.h>

#include "lbfgs.h"
#include "platform.h"

#ifdef _MSC_VER
#define inline __inline
typedef unsigned int uint32_t;
#endif/*_MSC_VER*/

#if defined(USE_SSE) && defined(__SSE2__) && LBFGS_FLOAT == 64
/* Use SSE2 optimization for 64bit double precision. */
Expand Down
1 change: 0 additions & 1 deletion src/vendor/cigraph/vendor/plfit/plfit.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "plfit_error.h"
#include "gss.h"
#include "lbfgs.h"
#include "platform.h"
#include "plfit.h"
#include "kolmogorov.h"
#include "plfit_sampling.h"
Expand Down
7 changes: 1 addition & 6 deletions src/vendor/cigraph/vendor/plfit/plfit_mt.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@
#ifndef __PLFIT_MT_H__
#define __PLFIT_MT_H__

/* VS 2010, i.e. _MSC_VER == 1600, already has stdint.h */
#if defined(_MSC_VER) && _MSC_VER < 1600
# define uint32_t unsigned __int32
#else
# include <stdint.h>
#endif
#include <stdint.h>

#undef __BEGIN_DECLS
#undef __END_DECLS
Expand Down
4 changes: 2 additions & 2 deletions src/vendor/cigraph/vendor/plfit/plfit_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#define PLFIT_VERSION_MAJOR 0
#define PLFIT_VERSION_MINOR 9
#define PLFIT_VERSION_PATCH 4
#define PLFIT_VERSION_STRING "0.9.4"
#define PLFIT_VERSION_PATCH 6
#define PLFIT_VERSION_STRING "0.9.6"

#endif
1 change: 0 additions & 1 deletion src/vendor/cigraph/vendor/plfit/rbinom.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
#include <math.h>
#include <stdlib.h>
#include "plfit_sampling.h"
#include "platform.h"

#define repeat for(;;)

Expand Down
1 change: 0 additions & 1 deletion src/vendor/cigraph/vendor/plfit/sampling.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#include "plfit_error.h"
#include "plfit_sampling.h"
#include "platform.h"

inline double plfit_runif(double lo, double hi, plfit_mt_rng_t* rng) {
if (rng == 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/vendor/igraph_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@

__BEGIN_DECLS

#define IGRAPH_VERSION "0.10.15-18-g833672f02"
#define IGRAPH_VERSION "0.10.15-19-gab123f04e"
#define IGRAPH_VERSION_MAJOR 0
#define IGRAPH_VERSION_MINOR 10
#define IGRAPH_VERSION_PATCH 15
#define IGRAPH_VERSION_PRERELEASE "18-g833672f02"
#define IGRAPH_VERSION_PRERELEASE "19-gab123f04e"

IGRAPH_EXPORT void igraph_version(const char **version_string,
int *major,
Expand Down

0 comments on commit 4d55ad4

Please sign in to comment.