diff options
Diffstat (limited to 'vcpkg/ports/octomap/fix-isnan.patch')
| -rw-r--r-- | vcpkg/ports/octomap/fix-isnan.patch | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/vcpkg/ports/octomap/fix-isnan.patch b/vcpkg/ports/octomap/fix-isnan.patch new file mode 100644 index 0000000..5da9a20 --- /dev/null +++ b/vcpkg/ports/octomap/fix-isnan.patch @@ -0,0 +1,25 @@ +diff --git a/octomap/src/compare_octrees.cpp b/octomap/src/compare_octrees.cpp +index c02ceea8..e6890f59 100644 +--- a/octomap/src/compare_octrees.cpp ++++ b/octomap/src/compare_octrees.cpp +@@ -39,7 +39,7 @@ + #include <list> + #include <cmath> + +-#ifdef _MSC_VER // fix missing isnan for VC++ ++#if defined(_MSC_VER) && !((defined(_MSVC_LANG) && _MSVC_LANG >= 201103L) || __cplusplus >= 201103L) + #define isnan(x) _isnan(x) + #endif + +@@ -132,11 +132,7 @@ int main(int argc, char** argv) { + else + kld +=log(p1/p2)*p1 + log((1-p1)/(1-p2))*(1-p1); + +-#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201103L) || __cplusplus >= 201103L) +- if (std::isnan(kld)){ +-#else + if (isnan(kld)){ +-#endif + OCTOMAP_ERROR("KLD is nan! KLD(%f,%f)=%f; sum = %f", p1, p2, kld, kld_sum); + exit(-1); + } |