From 73d4576ec39104a6913d00546e767483df8cf927 Mon Sep 17 00:00:00 2001 From: Arnim Balzer Date: Thu, 15 Aug 2024 07:36:01 +0100 Subject: [PATCH] sextractor: Support newer compilers by changing `finite` to `isfinite` Signed-off-by: Rui Chen --- Formula/s/sextractor.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Formula/s/sextractor.rb b/Formula/s/sextractor.rb index d935c5a6765f0..e4389e531203c 100644 --- a/Formula/s/sextractor.rb +++ b/Formula/s/sextractor.rb @@ -23,6 +23,9 @@ class Sextractor < Formula depends_on "fftw" depends_on "openblas" + # Switch finite to std::isfinite for ICC and GCC, upstream pr ref, https://github.com/astromatic/sextractor/pull/69 + patch :DATA + def install openblas = Formula["openblas"] system "./autogen.sh" @@ -43,3 +46,23 @@ def install assert_predicate testpath/"galaxies.cat", :exist?, "Failed to create galaxies.cat" end end + +__END__ +diff --git a/src/levmar/compiler.h b/src/levmar/compiler.h +index d714e50..bff985f 100644 +--- a/src/levmar/compiler.h ++++ b/src/levmar/compiler.h +@@ -60,7 +60,12 @@ + #ifdef _MSC_VER + #define LM_FINITE _finite // MSVC + #elif defined(__ICC) || defined(__INTEL_COMPILER) || defined(__GNUC__) +-#define LM_FINITE finite // ICC, GCC ++# ifdef __APPLE__ ++# include ++# define LM_FINITE isfinite // Apple ++# else ++# define LM_FINITE finite // ICC, GCC ++# endif + #else + #define LM_FINITE finite // other than MSVC, ICC, GCC, let's hope this will work + #endif