Skip to content

Commit

Permalink
stream: Support zephyr/net_buf.h
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
M1cha committed Dec 5, 2024
1 parent 692c2d6 commit f3c4efa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions include/cobs/stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@
#include <stdbool.h>
#include <version.h>

#if (KERNEL_VERSION_MAJOR < 3) || ((KERNEL_VERSION_MAJOR == 3) && (KERNEL_VERSION_MINOR == 0))
#ifdef CONFIG_ZEPHYR_NRF_MODULE
#include <ncs_version.h>
#endif

#if KERNEL_VERSION_NUMBER < 0x30300
#include <net/buf.h>
#else
#elif NCS_VERSION_NUMBER < 0x20800 && KERNEL_VERSION_NUMBER < 0x40000
#include <zephyr/net/buf.h>
#else
#include <zephyr/net_buf.h>
#endif

struct cobs_buf_cursor {
Expand Down

0 comments on commit f3c4efa

Please sign in to comment.