mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-08 20:56:13 +00:00
core/shared: Add guard to avoid redefine macro (#386)
Signed-off-by: Huang Qi <huangqi3@xiaomi.com> Co-authored-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
parent
c004b01be3
commit
04a7cc322f
|
@ -47,11 +47,21 @@ void BH_FREE(void *ptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __cplusplus
|
#ifndef __cplusplus
|
||||||
|
|
||||||
|
#ifndef true
|
||||||
#define true 1
|
#define true 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef false
|
||||||
#define false 0
|
#define false 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef inline
|
||||||
#define inline __inline
|
#define inline __inline
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Return the offset of the given field in the given type */
|
/* Return the offset of the given field in the given type */
|
||||||
#ifndef offsetof
|
#ifndef offsetof
|
||||||
#define offsetof(Type, field) ((size_t)(&((Type *)0)->field))
|
#define offsetof(Type, field) ((size_t)(&((Type *)0)->field))
|
||||||
|
|
|
@ -41,6 +41,16 @@ bh_log_set_verbose_level(uint32 level);
|
||||||
void
|
void
|
||||||
bh_log(LogLevel log_level, const char *file, int line, const char *fmt, ...);
|
bh_log(LogLevel log_level, const char *file, int line, const char *fmt, ...);
|
||||||
|
|
||||||
|
#ifdef BH_PLATFORM_NUTTX
|
||||||
|
|
||||||
|
#undef LOG_FATAL
|
||||||
|
#undef LOG_ERROR
|
||||||
|
#undef LOG_WARNING
|
||||||
|
#undef LOG_VERBOSE
|
||||||
|
#undef LOG_DEBUG
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#if BH_DEBUG == 1
|
#if BH_DEBUG == 1
|
||||||
#define LOG_FATAL(...) bh_log(BH_LOG_LEVEL_FATAL, __FILE__, __LINE__, __VA_ARGS__)
|
#define LOG_FATAL(...) bh_log(BH_LOG_LEVEL_FATAL, __FILE__, __LINE__, __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user