Commit 510f42b1dc9166ffe1f81742163cc9ba2aa8f0d7

Thomas de Grivel 2024-11-28T16:11:24

wip tests on win32

diff --git a/Makefile b/Makefile
index acafefc..4626efb 100644
--- a/Makefile
+++ b/Makefile
@@ -615,6 +615,14 @@ lib_links_linux_debug:
 	ln -sf ../../../markdown/.libs/libkc3_markdown_debug.so lib/kc3/0.1/markdown.so
 	ln -sf ../../../socket/.libs/libkc3_socket_debug.so lib/kc3/0.1/socket.so
 
+lib_links_windows:
+	ln -sf ../../../ekc3/.libs/libekc3-0.dll lib/kc3/0.1/ekc3.so
+	ln -sf ../../../event/.libs/libkc3_event-0.dll lib/kc3/0.1/event.so
+	ln -sf ../../../http/.libs/libkc3_http-0.dll lib/kc3/0.1/http.so
+	ln -sf ../../../json/.libs/libkc3_json-0.dll lib/kc3/0.1/json.so
+	ln -sf ../../../markdown/.libs/libkc3_markdown-0.dll lib/kc3/0.1/markdown.so
+	ln -sf ../../../socket/.libs/libkc3_socket-0.dll lib/kc3/0.1/socket.so
+
 libkc3_gcovr:
 	${MAKE} clean_cov
 	${MAKE} libkc3_test_cov
diff --git a/configure b/configure
index 88e462c..9c648fb 100755
--- a/configure
+++ b/configure
@@ -41,6 +41,8 @@ elif uname | grep -q Linux; then
     ARCH=linux
 elif uname | grep -q Darwin; then
     ARCH=darwin
+elif uname -s | grep -qi mingw; then
+    ARCH=windows
 fi
 echo "ARCH = $ARCH" >> ${CONFIG_MK}
 
diff --git a/socket/configure b/socket/configure
index 1bc1ab2..86e75aa 100755
--- a/socket/configure
+++ b/socket/configure
@@ -54,6 +54,9 @@ pkg_config libmd
 config_define PREFIX "\"${PREFIX}\""
 update_config_h
 LIBS="$LIBS -lm -rpath ${PREFIX}/lib"
+if $HAVE_WIN32; then
+    LIBS="$LIBS -lws2_32"
+fi
 
 # Address Sanitizer config
 CPPFLAGS_ASAN="$CPPFLAGS"
diff --git a/test/buf_parse_test.c b/test/buf_parse_test.c
index 493f27a..86b05c8 100644
--- a/test/buf_parse_test.c
+++ b/test/buf_parse_test.c
@@ -1390,8 +1390,8 @@ TEST_CASE(buf_parse_var)
   BUF_PARSE_TEST_VAR("?", expected);
   expected.type = &g_sym_U8;
   BUF_PARSE_TEST_VAR("(U8) ?", expected);
-  expected.ptr = (s_tag *)  0x123456789abcdef0;
-  BUF_PARSE_TEST_VAR("(U8) ?0x123456789abcdef0", expected);
+  expected.ptr = (s_tag *)  0x12345678;
+  BUF_PARSE_TEST_VAR("(U8) ?0x12345678", expected);
 }
 TEST_CASE_END(buf_parse_var)
 
diff --git a/test/inspect_test.c b/test/inspect_test.c
index 2c18cde..dd4e9f4 100644
--- a/test/inspect_test.c
+++ b/test/inspect_test.c
@@ -542,7 +542,7 @@ TEST_CASE(inspect_var)
 {
   INSPECT_TEST_VAR("?", "?");
   INSPECT_TEST_VAR("(U8) ?", "(U8) ?");
-  INSPECT_TEST_VAR("(U8) ?0x123456789abcdef0",
-                   "(U8) ?0x123456789abcdef0");
+  INSPECT_TEST_VAR("(U8) ?0x12345678",
+                   "(U8) ?0x12345678");
 }
 TEST_CASE_END(inspect_var)