Skip to content

Commit 361a999

Browse files
committed
define macros only after including the headers
1 parent b607f1f commit 361a999

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

include/reactor-cpp/assert.hh

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@
99
#ifndef REACTOR_CPP_ASSERT_HH
1010
#define REACTOR_CPP_ASSERT_HH
1111

12+
#include "reactor-cpp/config.hh"
13+
#include "reactor-cpp/fwd.hh"
14+
15+
#include <cassert>
16+
#include <sstream>
17+
#include <stdexcept>
18+
#include <string>
19+
20+
#ifdef __linux__
21+
#include <execinfo.h>
22+
#include <unistd.h>
23+
#endif
24+
1225
#ifdef REACTOR_CPP_VALIDATE
1326
constexpr bool runtime_validation = true;
1427
#else
@@ -21,18 +34,6 @@ constexpr bool runtime_assertion = false;
2134
constexpr bool runtime_assertion = true;
2235
#endif
2336

24-
#include "fwd.hh"
25-
26-
#include <cassert>
27-
#include <sstream>
28-
#include <stdexcept>
29-
#include <string>
30-
31-
#ifdef __linux__
32-
#include <execinfo.h>
33-
#include <unistd.h>
34-
#endif
35-
3637
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
3738
#define reactor_assert(x) assert(x)
3839

0 commit comments

Comments
 (0)