mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-08 20:56:13 +00:00
Fix compile warnings on windows platform (#2208)
This commit is contained in:
parent
0899638ece
commit
1e5f206464
|
@ -384,7 +384,7 @@ wasm_runtime_atomic_wait(WASMModuleInstanceCommon *module, void *address,
|
||||||
|
|
||||||
/* unit of timeout is nsec, convert it to usec */
|
/* unit of timeout is nsec, convert it to usec */
|
||||||
timeout_left = (uint64)timeout / 1000;
|
timeout_left = (uint64)timeout / 1000;
|
||||||
timeout_1sec = 1e6;
|
timeout_1sec = (uint64)1e6;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
if (timeout < 0) {
|
if (timeout < 0) {
|
||||||
|
|
|
@ -270,7 +270,7 @@ local_copysignf(float x, float y)
|
||||||
{
|
{
|
||||||
union {
|
union {
|
||||||
float f;
|
float f;
|
||||||
uint32_t i;
|
uint32 i;
|
||||||
} ux = { x }, uy = { y };
|
} ux = { x }, uy = { y };
|
||||||
ux.i &= 0x7fffffff;
|
ux.i &= 0x7fffffff;
|
||||||
ux.i |= uy.i & 0x80000000;
|
ux.i |= uy.i & 0x80000000;
|
||||||
|
@ -282,9 +282,9 @@ local_copysign(double x, double y)
|
||||||
{
|
{
|
||||||
union {
|
union {
|
||||||
double f;
|
double f;
|
||||||
uint64_t i;
|
uint64 i;
|
||||||
} ux = { x }, uy = { y };
|
} ux = { x }, uy = { y };
|
||||||
ux.i &= -1ULL / 2;
|
ux.i &= UINT64_MAX / 2;
|
||||||
ux.i |= uy.i & 1ULL << 63;
|
ux.i |= uy.i & 1ULL << 63;
|
||||||
return ux.f;
|
return ux.f;
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,7 +232,7 @@ local_copysignf(float x, float y)
|
||||||
{
|
{
|
||||||
union {
|
union {
|
||||||
float f;
|
float f;
|
||||||
uint32_t i;
|
uint32 i;
|
||||||
} ux = { x }, uy = { y };
|
} ux = { x }, uy = { y };
|
||||||
ux.i &= 0x7fffffff;
|
ux.i &= 0x7fffffff;
|
||||||
ux.i |= uy.i & 0x80000000;
|
ux.i |= uy.i & 0x80000000;
|
||||||
|
@ -244,9 +244,9 @@ local_copysign(double x, double y)
|
||||||
{
|
{
|
||||||
union {
|
union {
|
||||||
double f;
|
double f;
|
||||||
uint64_t i;
|
uint64 i;
|
||||||
} ux = { x }, uy = { y };
|
} ux = { x }, uy = { y };
|
||||||
ux.i &= -1ULL / 2;
|
ux.i &= UINT64_MAX / 2;
|
||||||
ux.i |= uy.i & 1ULL << 63;
|
ux.i |= uy.i & 1ULL << 63;
|
||||||
return ux.f;
|
return ux.f;
|
||||||
}
|
}
|
||||||
|
|
|
@ -561,7 +561,6 @@ pthread_create_wrapper(wasm_exec_env_t exec_env,
|
||||||
#if WASM_ENABLE_LIBC_WASI != 0
|
#if WASM_ENABLE_LIBC_WASI != 0
|
||||||
WASIContext *wasi_ctx;
|
WASIContext *wasi_ctx;
|
||||||
#endif
|
#endif
|
||||||
CApiFuncImport **new_c_api_func_imports = NULL;
|
|
||||||
|
|
||||||
bh_assert(module);
|
bh_assert(module);
|
||||||
bh_assert(module_inst);
|
bh_assert(module_inst);
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
|
#include <ws2tcpip.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <basetsd.h>
|
#include <basetsd.h>
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ set (PLATFORM_SHARED_DIR ${CMAKE_CURRENT_LIST_DIR})
|
||||||
|
|
||||||
add_definitions(-DBH_PLATFORM_WINDOWS)
|
add_definitions(-DBH_PLATFORM_WINDOWS)
|
||||||
add_definitions(-DHAVE_STRUCT_TIMESPEC)
|
add_definitions(-DHAVE_STRUCT_TIMESPEC)
|
||||||
|
add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
||||||
|
|
||||||
include_directories(${PLATFORM_SHARED_DIR})
|
include_directories(${PLATFORM_SHARED_DIR})
|
||||||
include_directories(${PLATFORM_SHARED_DIR}/../include)
|
include_directories(${PLATFORM_SHARED_DIR}/../include)
|
||||||
|
|
|
@ -102,7 +102,6 @@ include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake)
|
||||||
add_library(vmlib ${WAMR_RUNTIME_LIB_SOURCE})
|
add_library(vmlib ${WAMR_RUNTIME_LIB_SOURCE})
|
||||||
|
|
||||||
#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWIN32_LEAN_AND_MEAN")
|
#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWIN32_LEAN_AND_MEAN")
|
||||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_WINSOCK_DEPRECATED_NO_WARNINGS")
|
|
||||||
if (NOT MINGW)
|
if (NOT MINGW)
|
||||||
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
|
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
|
||||||
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
|
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user