unittest: add C++ support

Some of the struct in the unit test's cpu.h header were empty which
isn't allowed in C++.

Signed-off-by: Yuval Peress <peress@google.com>
This commit is contained in:
Yuval Peress 2022-11-21 09:42:14 -07:00 committed by Anas Nashif
commit c585df4996

View file

@ -6,17 +6,27 @@
/* This file exists as a hack around Zephyr's dependencies */
#include <inttypes.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Architecture thread structure */
struct _callee_saved {
#ifdef CONFIG_CPLUSPLUS
/* C++ does not allow empty structs, add an extra 1 byte */
uint8_t c;
#endif
};
typedef struct _callee_saved _callee_saved_t;
struct _thread_arch {
#ifdef CONFIG_CPLUSPLUS
/* C++ does not allow empty structs, add an extra 1 byte */
uint8_t c;
#endif
};
typedef struct _thread_arch _thread_arch_t;