From 92d4e360871fe5aee415bf266056caaabcba6a59 Mon Sep 17 00:00:00 2001 From: "Taylor C. Richberger" Date: Wed, 25 Feb 2026 11:22:29 -0700 Subject: [PATCH] fix: WASM_API_EXTERN should get visibility("default") on gcc and clang This allows the wasm_c_api to work in shared libraries on non-Windows platforms. --- core/iwasm/include/wasm_c_api.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/iwasm/include/wasm_c_api.h b/core/iwasm/include/wasm_c_api.h index 241a0eec8..00920adcb 100644 --- a/core/iwasm/include/wasm_c_api.h +++ b/core/iwasm/include/wasm_c_api.h @@ -22,6 +22,8 @@ #else #define WASM_API_EXTERN __declspec(dllimport) #endif +#elif defined(__GNUC__) || defined(__clang__) +#define WASM_API_EXTERN __attribute__((visibility("default"))) #else #define WASM_API_EXTERN #endif