Skip to content

Commit 6b05f50

Browse files
authored
Merge pull request #2254 from mmalecki/include-tbb-version
Fix builds with newer TBB versions
2 parents ba9a2c0 + 92a4f48 commit 6b05f50

2 files changed

Lines changed: 19 additions & 9 deletions

File tree

openvdb/openvdb/thread/Threading.h

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,24 @@
1313
#define OPENVDB_THREAD_THREADING_RESTORE_DEPRECATION_MESSAGE_TASK
1414
#endif
1515

16+
/// @warning the below changes what includes are available from this header
17+
/// depending on whether version.h is available
18+
#if __has_include(<tbb/version.h>)
19+
#include <tbb/version.h>
20+
#else
21+
/// @note tbb/task_arena.h is the ONLY include that persists from TBB 2020
22+
/// to TBB 2021 to TBB 2023 that itself includes the TBB specific version
23+
/// header files.
24+
/// In TBB 2020, the version header was called tbb/stddef.h. In 2021+, it's
25+
/// called tbb/version.h. We include tbb/task_arena.h here to indirectly
26+
/// access the version defines in a consistent way so that downstream
27+
/// software doesn't need to provide compile time defines.
28+
#include <tbb/task_arena.h>
29+
#endif
1630

31+
#include <tbb/task_group.h>
1732
#include <tbb/blocked_range.h>
1833
#include <tbb/task.h>
19-
/// @note tbb/task_arena.h is the ONLY include that persists from TBB 2020
20-
/// to TBB 2021 to TBB 2023 that itself includes the TBB specific version
21-
/// header files.
22-
/// In TBB 2020, the version header was called tbb/stddef.h. In 2021+, it's
23-
/// called tbb/version.h. We include tbb/task_arena.h here to indirectly
24-
/// access the version defines in a consistent way so that downstream
25-
/// software doesn't need to provide compile time defines.
26-
#include <tbb/task_arena.h>
27-
#include <tbb/task_group.h>
2834

2935
namespace openvdb {
3036
OPENVDB_USE_VERSION_NAMESPACE

pendingchanges/tbb_version_fix.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
OpenVDB:
2+
Build:
3+
- Fixed a build issue with newer TBB versions where tbb/version.h was not being indirectly included
4+
[Contributed by Maciej Małecki]

0 commit comments

Comments
 (0)