OGLplus  (0.59.0) a C++ wrapper for rendering APIs

valgrind.hpp
Go to the documentation of this file.
1 #ifndef EAGINE_INTEROP_VALGRIND_HPP
9 #define EAGINE_INTEROP_VALGRIND_HPP
10 
11 #include "../tribool.hpp"
12 
13 #if defined(__GNUC__) || defined(__clang__)
14 // clang-format off
15 #if __has_include(<valgrind/valgrind.h>)
16 // clang-format on
17 #include <valgrind/valgrind.h>
18 #endif
19 #endif
20 
21 namespace eagine {
22 
23 #if defined(RUNNING_ON_VALGRIND)
24 static inline auto running_on_valgrind() noexcept -> tribool {
25  return bool(RUNNING_ON_VALGRIND); // NOLINT(hicpp-no-assembler)
26 }
27 #else
28 static constexpr inline auto running_on_valgrind() noexcept -> tribool {
31  return indeterminate;
32 }
33 #endif
34 
35 } // namespace eagine
36 
37 #endif // EAGINE_INTEROP_VALGRIND_HPP
Common code is placed in this namespace.
Definition: eagine.hpp:21
constexpr static const indeterminate_t indeterminate
Constant representing unspecified tribool value.
Definition: tribool.hpp:24
static constexpr auto running_on_valgrind() noexcept -> tribool
Indicates if the current process runs on top of valgrind.
Definition: valgrind.hpp:30

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).