Skip to content

Commit eff7d05

Browse files
authored
fix isnan on _msvc_LANG>= 201103L (#417)
1 parent 3c268e8 commit eff7d05

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

octomap/src/compare_octrees.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include <list>
4040
#include <cmath>
4141

42-
#ifdef _MSC_VER // fix missing isnan for VC++
42+
#if defined(_MSC_VER) && !((defined(_MSVC_LANG) && _MSVC_LANG >= 201103L) || __cplusplus >= 201103L)
4343
#define isnan(x) _isnan(x)
4444
#endif
4545

@@ -132,11 +132,7 @@ int main(int argc, char** argv) {
132132
else
133133
kld +=log(p1/p2)*p1 + log((1-p1)/(1-p2))*(1-p1);
134134

135-
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201103L) || __cplusplus >= 201103L)
136-
if (std::isnan(kld)){
137-
#else
138135
if (isnan(kld)){
139-
#endif
140136
OCTOMAP_ERROR("KLD is nan! KLD(%f,%f)=%f; sum = %f", p1, p2, kld, kld_sum);
141137
exit(-1);
142138
}

0 commit comments

Comments
 (0)