Skip to content

Commit

Permalink
build: include header "unit.h" after c++ headers
Browse files Browse the repository at this point in the history
Header "unit.h" contains `ok` and `is` macros used to check test cases.
The problem is such simple names can be used in C++ STL library headers
(it's OK because such short names can be hidden in a namespace), so when
including, for example, header "vector" after "unit.h", build can fail
because function declaration or definition in the C++ header will turn
into a macro invocation. I faced this problem building Tarantool on
MacOS with SDK of 14.4 version.

NO_TEST=fix build
NO_CHANGELOG=fix build
NO_DOC=fix build
  • Loading branch information
drewdzzz authored and sergepetrenko committed Mar 28, 2024
1 parent a5f03d0 commit 025ba32
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/unit/rtree_multidim.cc
Expand Up @@ -2,12 +2,14 @@
#include <time.h>
#include <algorithm>

#include "unit.h"
#include "salad/rtree.h"
#include "../../src/lib/salad/rtree.h"

#include <vector>
#include <set>

#include "unit.h"

using namespace std;

const uint32_t extent_size = 1024 * 16;
Expand Down

0 comments on commit 025ba32

Please sign in to comment.