summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--appveyor.yml6
-rw-r--r--src/tools/wasm-interp.c2
-rw-r--r--src/wasm-config.h.in34
4 files changed, 37 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 586ca431..5fb37118 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -54,6 +54,7 @@ check_include_file("alloca.h" HAVE_ALLOCA_H)
check_include_file("unistd.h" HAVE_UNISTD_H)
check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF)
check_symbol_exists(sysconf "unistd.h" HAVE_SYSCONF)
+check_symbol_exists(strcasecmp "strings.h" HAVE_STRCASECMP)
if (EMSCRIPTEN)
set(SIZEOF_SSIZE_T 4)
diff --git a/appveyor.yml b/appveyor.yml
index 350e4641..6711ab77 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -9,15 +9,19 @@ environment:
matrix:
- GENERATOR: MSYS Makefiles
CONFIG: Release
+ EXTRA_CONFIG_FLAGS: -DBUILD_TESTS=OFF
PARALLEL_FLAG: -j
- GENERATOR: Visual Studio 14 2015
CONFIG: Release
+ EXTRA_CONFIG_FLAGS:
PARALLEL_FLAG: "/m:"
- GENERATOR: Visual Studio 14 2015 Win64
CONFIG: Debug
+ EXTRA_CONFIG_FLAGS:
PARALLEL_FLAG: "/m:"
- GENERATOR: Visual Studio 14 2015 Win64
CONFIG: Release
+ EXTRA_CONFIG_FLAGS:
PARALLEL_FLAG: "/m:"
install:
@@ -28,7 +32,7 @@ before_build:
- flake8 --ignore=E111,E114 ./scripts/
build_script:
- - cmake . -DCMAKE_BUILD_TYPE=%CONFIG% -G "%GENERATOR%"
+ - cmake . -DCMAKE_BUILD_TYPE=%CONFIG% %EXTRA_CONFIG_FLAGS% -G "%GENERATOR%"
- cmake --build . --config %CONFIG% -- %PARALLEL_FLAG%%DEGREE_OF_PARALLELISM%
test_script:
diff --git a/src/tools/wasm-interp.c b/src/tools/wasm-interp.c
index 5e99a345..e50772b9 100644
--- a/src/tools/wasm-interp.c
+++ b/src/tools/wasm-interp.c
@@ -531,7 +531,7 @@ static WasmResult read_and_run_spec_json(WasmAllocator* allocator,
WasmStringSlice command_file;
WasmStringSlice command_name;
WasmInterpreterTypedValueVector result_values;
- uint32_t command_line_no;
+ uint32_t command_line_no = 0;
WasmBool has_thread = WASM_FALSE;
uint32_t passed = 0;
uint32_t failed = 0;
diff --git a/src/wasm-config.h.in b/src/wasm-config.h.in
index a376b715..86a892de 100644
--- a/src/wasm-config.h.in
+++ b/src/wasm-config.h.in
@@ -34,6 +34,9 @@
/* Whether ssize_t is defined by stddef.h */
#cmakedefine01 HAVE_SSIZE_T
+/* Whether strcasecmp is defined by strings.h */
+#cmakedefine01 HAVE_STRCASECMP
+
#cmakedefine01 COMPILER_IS_CLANG
#cmakedefine01 COMPILER_IS_GNU
#cmakedefine01 COMPILER_IS_MSVC
@@ -48,6 +51,8 @@
#elif COMPILER_IS_MSVC
#include <malloc.h>
#define alloca _alloca
+#elif __MINGW32__
+#include <malloc.h>
#else
#error no alloca
#endif
@@ -87,10 +92,6 @@
#error "don't know how to define 64-bit builtins"
#endif
-/* print format specifier for size_t */
-#define PRIzd "zd"
-#define PRIzx "zx"
-
#define WABT_UNREACHABLE __builtin_unreachable()
#elif COMPILER_IS_MSVC
@@ -177,6 +178,16 @@ __inline unsigned __int64 __popcnt64(unsigned __int64 value) {
#endif
#define wasm_popcount_u64 __popcnt64
+#else
+
+#error unknown compiler
+
+#endif
+
+
+/* Check For MINGW first, because it is also a GNU compiler */
+#if COMPILER_IS_MSVC || __MINGW32__
+
/* print format specifier for size_t */
#if SIZEOF_SIZE_T == 4
#define PRIzd "d"
@@ -188,12 +199,19 @@ __inline unsigned __int64 __popcnt64(unsigned __int64 value) {
#error "weird sizeof size_t"
#endif
+#elif COMPILER_IS_CLANG || COMPILER_IS_GNU
+
+/* print format specifier for size_t */
+#define PRIzd "zd"
+#define PRIzx "zx"
+
#else
#error unknown compiler
#endif
+
#if HAVE_SNPRINTF
#define wasm_snprintf snprintf
#elif COMPILER_IS_MSVC
@@ -215,4 +233,12 @@ int wasm_vsnprintf(char* str, size_t size, const char* format, va_list ap);
typedef int ssize_t;
#endif
+#if !HAVE_STRCASECMP
+#if COMPILER_IS_MSVC
+#define strcasecmp _stricmp
+#else
+#error no strcasecmp
+#endif
+#endif
+
#endif /* WASM_CONFIG_H_ */