Fix compile warnings on windows platform: dll linkage and others (#604)

This commit is contained in:
Wenyong Huang
2021-04-09 14:55:58 +08:00
committed by GitHub
parent 77c3ddf7d0
commit dfe52ab42f
9 changed files with 66 additions and 53 deletions

View File

@ -15,6 +15,8 @@ set (CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
set (CMAKE_C_STANDARD 99)
add_definitions(-DCOMPILING_WASM_RUNTIME_API=1)
# Set WAMR_BUILD_TARGET, currently values supported:
# "X86_64", "AMD_64", "X86_32", "AARCH64[sub]", "ARM[sub]", "THUMB[sub]", "MIPS", "XTENSA"
if (NOT DEFINED WAMR_BUILD_TARGET)
@ -126,4 +128,3 @@ set_target_properties (libiwasm PROPERTIES OUTPUT_NAME iwasm)
target_link_libraries (libiwasm ${LLVM_AVAILABLE_LIBS} ${UV_A_LIBS})
target_compile_definitions(libiwasm PRIVATE COMPILING_WASM_RUNTIME_API=1)

View File

@ -185,8 +185,8 @@ module_reader_callback(const char *module_name, uint8 **p_buffer,
uint32 *p_size)
{
const char *format = "%s/%s.wasm";
int sz = strlen(module_search_path) + strlen("/") + strlen(module_name) +
strlen(".wasm") + 1;
uint32 sz = (uint32)(strlen(module_search_path) + strlen("/")
+ strlen(module_name) + strlen(".wasm") + 1);
char *wasm_file_name = BH_MALLOC(sz);
if (!wasm_file_name) {
return false;