Skip to content

Commit ae52796

Browse files
authored
Merge pull request #2781 from mnijhuis-tos/compiler-version-checks
Avoid warnings in compiler version checks
2 parents 48b2d85 + 6601e93 commit ae52796

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

include/xtensor/xmath.hpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -1088,10 +1088,8 @@ namespace xt
10881088
return xfunction_type(detail::lambda_adapt<F>(std::forward<F>(lambda)), std::forward<E>(args)...);
10891089
}
10901090

1091-
#define XTENSOR_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
1092-
10931091
// Workaround for MSVC 2015 & GCC 4.9
1094-
#if (defined(_MSC_VER) && _MSC_VER < 1910) || (defined(__GNUC__) && GCC_VERSION < 49999)
1092+
#if (defined(_MSC_VER) && _MSC_VER < 1910) || (defined(__GNUC__) && __GNUC__ < 5)
10951093
#define XTENSOR_DISABLE_LAMBDA_FCT
10961094
#endif
10971095

@@ -1161,7 +1159,6 @@ namespace xt
11611159
#endif
11621160
}
11631161

1164-
#undef XTENSOR_GCC_VERSION
11651162
#undef XTENSOR_DISABLE_LAMBDA_FCT
11661163

11671164
namespace detail

include/xtensor/xutils.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
#include "xtensor_config.hpp"
3232

33-
#if (_MSC_VER >= 1910)
33+
#if (defined(_MSC_VER) && _MSC_VER >= 1910)
3434
#define NOEXCEPT(T)
3535
#else
3636
#define NOEXCEPT(T) noexcept(T)

0 commit comments

Comments
 (0)