# HG changeset patch # User Chris Cannam # Date 1740596123 0 # Wed Feb 26 18:55:23 2025 +0000 # Node ID 46b1d661f7b0f60da0876f271a83569aa527fa8f # Parent 3e72d20f5ac6ab3330c1a0b76442945409d8aa2e Support building with a C++ compiler diff --git a/ffi/distance.c b/ffi/distance.c --- a/ffi/distance.c +++ b/ffi/distance.c @@ -2,8 +2,15 @@ #include #include -double distance_manhattan(const double *const restrict v, - const double *const restrict w, +// restrict is a keyword in C, but we want this to be compileable by +// C++ compilers as well + +#ifdef _MSC_VER +# define __restrict__ __restrict +#endif + +double distance_manhattan(const double *const __restrict__ v, + const double *const __restrict__ w, const int64_t count) { double d = 0.0;