Kaynağa Gözat

Namespace generated headers with zephyr/ (#4670)

* Namespace generated headers with zephyr/

---------

Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
Krisztian 1 ay önce
ebeveyn
işleme
a192467067
1 değiştirilmiş dosya ile 16 ekleme ve 0 silme
  1. 16 0
      core/shared/platform/zephyr/platform_internal.h

+ 16 - 0
core/shared/platform/zephyr/platform_internal.h

@@ -7,8 +7,24 @@
 #ifndef _PLATFORM_INTERNAL_H
 #define _PLATFORM_INTERNAL_H
 
+/*
+ * Modern Zephyr uses zephyr/ namespace.
+ *
+ * Note: Cannot use KERNEL_VERSION_NUMBER here as it's defined in version.h
+ * which we're trying to include. Must use feature detection instead.
+ */
+#ifdef __has_include
+#if __has_include(<zephyr/autoconf.h>)
+#include <zephyr/autoconf.h>
+#include <zephyr/version.h>
+#else
 #include <autoconf.h>
 #include <version.h>
+#endif
+#else
+#include <autoconf.h>
+#include <version.h>
+#endif
 
 #if KERNEL_VERSION_NUMBER < 0x030200 /* version 3.2.0 */
 #include <zephyr.h>