Skip to content

Commit

Permalink
sextractor: Support newer compilers by changing finite to isfinite
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
SeeChange-CI committed Sep 16, 2024
1 parent 184940b commit 73d4576
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Formula/s/sextractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 <math.h>
+# 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

0 comments on commit 73d4576

Please sign in to comment.