ソースを参照

[GC] Fix uint type and add macro for cpp in gc_export.h (#2160)

Xu Jun 2 年 前
コミット
5cea277bbe
2 ファイル変更10 行追加2 行削除
  1. 2 2
      core/iwasm/common/gc/gc_type.c
  2. 8 0
      core/iwasm/include/gc_export.h

+ 2 - 2
core/iwasm/common/gc/gc_type.c

@@ -766,7 +766,7 @@ wasm_is_reftype_supers_of_none(uint8 type, const WASMRefType *ref_type,
 }
 }
 
 
 inline static bool
 inline static bool
-wasm_is_reftype_supers_of_nofunc(uint type, const WASMRefType *ref_type,
+wasm_is_reftype_supers_of_nofunc(uint8 type, const WASMRefType *ref_type,
                                  const WASMTypePtr *types, uint32 type_count)
                                  const WASMTypePtr *types, uint32 type_count)
 {
 {
     if (type == REF_TYPE_NULLFUNCREF || type == REF_TYPE_FUNCREF)
     if (type == REF_TYPE_NULLFUNCREF || type == REF_TYPE_FUNCREF)
@@ -782,7 +782,7 @@ wasm_is_reftype_supers_of_nofunc(uint type, const WASMRefType *ref_type,
 }
 }
 
 
 inline static bool
 inline static bool
-wasm_is_reftype_supers_of_noextern(uint type)
+wasm_is_reftype_supers_of_noextern(uint8 type)
 {
 {
     return (type == REF_TYPE_NULLEXTERNREF || type == REF_TYPE_EXTERNREF)
     return (type == REF_TYPE_NULLEXTERNREF || type == REF_TYPE_EXTERNREF)
                ? true
                ? true

+ 8 - 0
core/iwasm/include/gc_export.h

@@ -8,6 +8,10 @@
 
 
 #include "wasm_export.h"
 #include "wasm_export.h"
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef uint8_t wasm_value_type_t;
 typedef uint8_t wasm_value_type_t;
 
 
 typedef enum wasm_value_type_enum {
 typedef enum wasm_value_type_enum {
@@ -510,4 +514,8 @@ wasm_runtime_pop_local_object_ref(wasm_exec_env_t exec_env);
 WASM_RUNTIME_API_EXTERN void
 WASM_RUNTIME_API_EXTERN void
 wasm_runtime_pop_local_object_refs(wasm_exec_env_t exec_env, uint32_t n);
 wasm_runtime_pop_local_object_refs(wasm_exec_env_t exec_env, uint32_t n);
 
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* end of _GC_EXPORT_H */
 #endif /* end of _GC_EXPORT_H */