Skip to content

Commit 8aba858

Browse files
authored
Avoid redefining WASMMemoryType (#3602)
1 parent 0feae05 commit 8aba858

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

core/iwasm/include/wasm_export.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,11 @@ typedef struct WASMTableType *wasm_table_type_t;
8181
struct WASMGlobalType;
8282
typedef struct WASMGlobalType *wasm_global_type_t;
8383

84+
#ifndef WASM_MEMORY_T_DEFINED
85+
#define WASM_MEMORY_T_DEFINED
8486
struct WASMMemory;
8587
typedef struct WASMMemory WASMMemoryType;
88+
#endif
8689
typedef WASMMemoryType *wasm_memory_type_t;
8790

8891
typedef struct wasm_import_t {

core/iwasm/interpreter/wasm.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,11 @@ typedef struct WASMMemory {
518518
uint32 num_bytes_per_page;
519519
uint32 init_page_count;
520520
uint32 max_page_count;
521-
} WASMMemory, WASMMemoryType;
521+
} WASMMemory;
522+
#ifndef WASM_MEMORY_T_DEFINED
523+
#define WASM_MEMORY_T_DEFINED
524+
typedef struct WASMMemory WASMMemoryType;
525+
#endif
522526

523527
typedef struct WASMTableImport {
524528
char *module_name;

0 commit comments

Comments
 (0)