Skip to content

Commit f3c4efa

Browse files
committed
stream: Support zephyr/net_buf.h
While at it, also simplify the existing check. We have to check sdk-nrf versions separately, because they cherry-pick breaking changes into their zephyr-fork.
1 parent 692c2d6 commit f3c4efa

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

include/cobs/stream.h

+8-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@
66
#include <stdbool.h>
77
#include <version.h>
88

9-
#if (KERNEL_VERSION_MAJOR < 3) || ((KERNEL_VERSION_MAJOR == 3) && (KERNEL_VERSION_MINOR == 0))
9+
#ifdef CONFIG_ZEPHYR_NRF_MODULE
10+
#include <ncs_version.h>
11+
#endif
12+
13+
#if KERNEL_VERSION_NUMBER < 0x30300
1014
#include <net/buf.h>
11-
#else
15+
#elif NCS_VERSION_NUMBER < 0x20800 && KERNEL_VERSION_NUMBER < 0x40000
1216
#include <zephyr/net/buf.h>
17+
#else
18+
#include <zephyr/net_buf.h>
1319
#endif
1420

1521
struct cobs_buf_cursor {

0 commit comments

Comments
 (0)