Skip to content

Commit a192467

Browse files
authored
Namespace generated headers with zephyr/ (#4670)
* Namespace generated headers with zephyr/ --------- Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
1 parent 912c2a6 commit a192467

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

core/shared/platform/zephyr/platform_internal.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,24 @@
77
#ifndef _PLATFORM_INTERNAL_H
88
#define _PLATFORM_INTERNAL_H
99

10+
/*
11+
* Modern Zephyr uses zephyr/ namespace.
12+
*
13+
* Note: Cannot use KERNEL_VERSION_NUMBER here as it's defined in version.h
14+
* which we're trying to include. Must use feature detection instead.
15+
*/
16+
#ifdef __has_include
17+
#if __has_include(<zephyr/autoconf.h>)
18+
#include <zephyr/autoconf.h>
19+
#include <zephyr/version.h>
20+
#else
1021
#include <autoconf.h>
1122
#include <version.h>
23+
#endif
24+
#else
25+
#include <autoconf.h>
26+
#include <version.h>
27+
#endif
1228

1329
#if KERNEL_VERSION_NUMBER < 0x030200 /* version 3.2.0 */
1430
#include <zephyr.h>

0 commit comments

Comments
 (0)