Browse Source

jsoncpp: Provide 'isfinite' impl on more HP-UX versions (#15576)

Some versions of HP-UX do not define 'isfinite' or 'finite' in math.h
for Itanium when preprocessing with C++, so we have to add the
definition ourselves instead to map to the internal version.
Michael Scott 10 years ago
parent
commit
9217b678b3
1 changed files with 6 additions and 1 deletions
  1. 6 1
      Utilities/cmjsoncpp/src/lib_json/json_writer.cpp

+ 6 - 1
Utilities/cmjsoncpp/src/lib_json/json_writer.cpp

@@ -37,7 +37,12 @@
 // HP-UX
 #if defined(__hpux)
 # if !defined(isfinite)
-#  define isfinite finite
+#  if defined(__ia64) && !defined(finite)
+#   define isfinite(x) ((sizeof(x) == sizeof(float) ? \
+                        _Isfinitef(x) : _Isfinite(x)))
+#  else
+#   define isfinite finite
+#  endif
 # endif
 #endif