Skip to content

Commit 2f89eb3

Browse files
committed
.
1 parent 9876524 commit 2f89eb3

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

include/io/tbb_flow_compat.h

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22
#define _QIO_TBB_FLOW_COMPAT_H
33

44
#include <utility>
5-
#if __has_include(<tbb/version.h>)
6-
#include <tbb/version.h>
7-
#elif __has_include(<tbb/tbb_stddef.h>)
8-
#include <tbb/tbb_stddef.h>
5+
#include <tbb/flow_graph.h>
6+
7+
// Derive the interface version from the same header tree that provided
8+
// flow_graph.h. Some packaged TBB layouts expose a newer version header while
9+
// still shipping the classic flow-graph API, so pre-reading version headers can
10+
// mis-detect the actual node interface in use.
11+
#ifndef TBB_INTERFACE_VERSION_MAJOR
12+
#ifdef TBB_INTERFACE_VERSION
13+
#define TBB_INTERFACE_VERSION_MAJOR (TBB_INTERFACE_VERSION / 1000)
914
#else
10-
#error "Unable to find a TBB version header"
15+
#error "Unable to determine TBB interface version from flow_graph.h"
16+
#endif
1117
#endif
12-
#include <tbb/flow_graph.h>
1318

1419
namespace qio {
1520
namespace tbb_compat {

0 commit comments

Comments
 (0)