Corrects Zephyr include files for current versions of Zephyr (#2881)

This fixes bug #2880.  Zephyr 3.2 made changes to how headers are reference (see [release notes](https://docs.zephyrproject.org/latest/releases/release-notes-3.2.html)).  Work item [49578](https://github.com/zephyrproject-rtos/zephyr/issues/49578) deprecated the old headers names.
The current WAMR codebase references these old headers, thus causing compile errors with
current versions of Zephyr.

This update adds #ifdefs around the header names.  With this change, compiling with Zephyr 3.2.0
and above will use the new header files.  Prior versions will use the existing code.
This commit is contained in:
Stephen Berard 2023-12-08 10:16:16 +01:00 committed by GitHub
parent a58e596995
commit df83aef101
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 38 additions and 4 deletions

View File

@ -6,8 +6,14 @@
#include "app_manager.h"
#include "bh_platform.h"
#include <autoconf.h>
#if KERNEL_VERSION_NUMBER < 0x030200 /* version 3.2.0 */
#include <zephyr.h>
#include <kernel.h>
#else
#include <zephyr/kernel.h>
#endif
#if 0
#include <sigverify.h>
#endif

View File

@ -10,8 +10,12 @@
#include <string.h>
#include "drivers/spi.h"
#include "zephyr.h"
#include "kernel.h"
#if KERNEL_VERSION_NUMBER < 0x030200 /* version 3.2.0 */
#include <zephyr.h>
#include <kernel.h>
#else
#include <zephyr/kernel.h>
#endif
#if USE_XPT2046

View File

@ -7,7 +7,12 @@
#define ZEPHYR_DRIVERS_DISPLAY_DISPLAY_ILI9340_H_
#include "board_config.h"
#include <autoconf.h>
#if KERNEL_VERSION_NUMBER < 0x030200 /* version 3.2.0 */
#include <zephyr.h>
#else
#include <zephyr/kernel.h>
#endif
#define ILI9340_CMD_ENTER_SLEEP 0x10
#define ILI9340_CMD_EXIT_SLEEP 0x11

View File

@ -31,7 +31,12 @@ xpt2046_init(void);
extern void
wgl_init();
#if KERNEL_VERSION_NUMBER < 0x030200 /* version 3.2.0 */
#include <zephyr.h>
#else
#include <zephyr/kernel.h>
#endif
#include <drivers/uart.h>
#include <device.h>

View File

@ -10,8 +10,12 @@
#include <string.h>
#include "drivers/spi.h"
#include "zephyr.h"
#include "kernel.h"
#if KERNEL_VERSION_NUMBER < 0x030200 /* version 3.2.0 */
#include <zephyr.h>
#include <kernel.h>
#else
#include <zephyr/kernel.h>
#endif
#if USE_XPT2046

View File

@ -7,7 +7,12 @@
#define ZEPHYR_DRIVERS_DISPLAY_DISPLAY_ILI9340_H_
#include "board_config.h"
#include <autoconf.h>
#if KERNEL_VERSION_NUMBER < 0x030200 /* version 3.2.0 */
#include <zephyr.h>
#else
#include <zephyr/kernel.h>
#endif
#define ILI9340_CMD_ENTER_SLEEP 0x10
#define ILI9340_CMD_EXIT_SLEEP 0x11

View File

@ -16,7 +16,12 @@
#include "connection_native_api.h"
#include "display_indev.h"
#if KERNEL_VERSION_NUMBER < 0x030200 /* version 3.2.0 */
#include <zephyr.h>
#else
#include <zephyr/kernel.h>
#endif
#include <drivers/uart.h>
#include <device.h>