[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 2ac88d3 3/3: Needn't test for __has_include n

From: Greg Chicares
Subject: [lmi-commits] [lmi] master 2ac88d3 3/3: Needn't test for __has_include now that C++17 is required
Date: Mon, 12 Mar 2018 20:13:53 -0400 (EDT)

branch: master
commit 2ac88d33a8c35272fa7f98abaf290f993a3dd53f
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Needn't test for __has_include now that C++17 is required
    Incidentally, moved the valgrind test below all normal #includes,
    because it made them harder to read. Presumably valgrind's header can
    be included last.
 numeric_io_test.cpp | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/numeric_io_test.cpp b/numeric_io_test.cpp
index 8e49215..f10d7a7 100644
--- a/numeric_io_test.cpp
+++ b/numeric_io_test.cpp
@@ -29,16 +29,6 @@
 #include "test_tools.hpp"
 #include "timer.hpp"
-#if defined __has_include
-#   if __has_include(<valgrind/valgrind.h>)
-#       include <valgrind/valgrind.h>
-#   endif // valgrind.h present.
-#endif // Can test for valgrind.h presence.
-#   define RUNNING_ON_VALGRIND (0)
-#endif // !defined RUNNING_ON_VALGRIND
 #include <boost/lexical_cast.hpp>
 #include <cmath>                        // exp()
@@ -47,6 +37,14 @@
 #include <stdexcept>
 #include <string>
+#if __has_include(<valgrind/valgrind.h>)
+#   include <valgrind/valgrind.h>
+#endif // valgrind.h present.
+#   define RUNNING_ON_VALGRIND (0)
+#endif // !defined RUNNING_ON_VALGRIND
 template<typename T>
 void test_interconvertibility
     (T t

reply via email to

[Prev in Thread] Current Thread [Next in Thread]