diff options
Diffstat (limited to 'ruby/src')
-rw-r--r-- | ruby/src/IceRuby/Config.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ruby/src/IceRuby/Config.h b/ruby/src/IceRuby/Config.h index 16d0d820cb4..99960fed1f5 100644 --- a/ruby/src/IceRuby/Config.h +++ b/ruby/src/IceRuby/Config.h @@ -42,6 +42,16 @@ # include <wincrypt.h> #endif +// The ruby.h check for the isfinite macro fails with some C++ standard libraries +// (libc++ > 4000) because the isfinite macro included from the C library's +// math.h is undefined and replaced with a function. As a result, Ruby defines isfinite +// as the finite macro which is deprecated on some platforms (macOS >= 10.9). +// The warning ends up causing a build failure. We define the HAVE_ISFINITE macro here to +// ensure ruby.h doesn't redefine it. +#if defined(__clang__) && defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION >= 4000) +#define HAVE_ISFINITE 1 +#endif + #include <ruby.h> // |