summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2023-09-05 10:27:25 +0200
committerMitya Selivanov <automainint@guattari.tech>2023-09-05 10:27:25 +0200
commited007d3979b1c31845667d69f3506e297dd4aecc (patch)
tree2768036c78d170f4a6418de57f656154dae90668
parent77c5276fcc3fbf0702e8e21f20d757be3501639f (diff)
downloadkit-ed007d3979b1c31845667d69f3506e297dd4aecc.zip
test
-rw-r--r--build_and_test.sh17
-rw-r--r--source/kit/file.c6
2 files changed, 17 insertions, 6 deletions
diff --git a/build_and_test.sh b/build_and_test.sh
index 218feb5..7f1033c 100644
--- a/build_and_test.sh
+++ b/build_and_test.sh
@@ -9,6 +9,7 @@ EXE_POSTFIX=
FLAGS=
FLAG_OBJ="-c -o "
FLAG_EXE="-o "
+LINK_FLAGS=
case $(uname | tr '[:upper:]' '[:lower:]') in
*darwin*)
@@ -32,6 +33,7 @@ case $(uname | tr '[:upper:]' '[:lower:]') in
EXE_POSTFIX=.exe
FLAG_OBJ="-c -Fo"
FLAG_EXE="-Fe"
+ LINK_FLAGS="-link Shlwapi"
elif command -v gcc >/dev/null 2>&1; then
echo "C compiler found - GCC"
elif command -v clang >/dev/null 2>&1; then
@@ -93,7 +95,8 @@ $COMPILE ${FLAGS} \
${FLAG_EXE}"build/kit_test_suite${EXE_POSTFIX}" \
"build/kit${OBJ_POSTFIX}" \
"build/kit_test${OBJ_POSTFIX}" \
- "source/tests/_static.c"
+ "source/tests/_static.c" \
+ ${LINK_FLAGS}
if [ ! $? -eq 0 ]; then
exit 1
fi
@@ -102,7 +105,8 @@ $COMPILE ${FLAGS} \
${FLAG_EXE}"build/test_too_many_assertions${EXE_POSTFIX}" \
"build/kit${OBJ_POSTFIX}" \
"build/kit_test${OBJ_POSTFIX}" \
- "source/tests/test_too_many_assertions.c"
+ "source/tests/test_too_many_assertions.c" \
+ ${LINK_FLAGS}
if [ ! $? -eq 0 ]; then
exit 1
fi
@@ -111,7 +115,8 @@ $COMPILE ${FLAGS} \
${FLAG_EXE}"build/test_too_many_tests${EXE_POSTFIX}" \
"build/kit${OBJ_POSTFIX}" \
"build/kit_test${OBJ_POSTFIX}" \
- "source/tests/test_too_many_tests.c"
+ "source/tests/test_too_many_tests.c" \
+ ${LINK_FLAGS}
if [ ! $? -eq 0 ]; then
exit 1
fi
@@ -120,7 +125,8 @@ $COMPILEPP ${FLAGS} \
${FLAG_EXE}"build/test_cpp${EXE_POSTFIX}" \
"build/kit${OBJ_POSTFIX}" \
"build/kit_test${OBJ_POSTFIX}" \
- "source/tests/test_cpp.cpp"
+ "source/tests/test_cpp.cpp" \
+ ${LINK_FLAGS}
if [ ! $? -eq 0 ]; then
exit 1
fi
@@ -129,7 +135,8 @@ $COMPILEPP ${FLAGS} \
${FLAG_EXE}"build/test_signals${EXE_POSTFIX}" \
"build/kit${OBJ_POSTFIX}" \
"build/kit_test${OBJ_POSTFIX}" \
- "source/tests/test_signals.cpp"
+ "source/tests/test_signals.cpp" \
+ ${LINK_FLAGS}
if [ ! $? -eq 0 ]; then
exit 1
fi
diff --git a/source/kit/file.c b/source/kit/file.c
index 2d52e92..b9fabe2 100644
--- a/source/kit/file.c
+++ b/source/kit/file.c
@@ -7,11 +7,15 @@
enum { PATH_BUF_SIZE = 4096 };
#if defined(_WIN32) && !defined(__CYGWIN__)
+# include <stdint.h>
+
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN 1
# endif
-# include <stdint.h>
+
# include <Windows.h>
+
+# include <Shlwapi.h>
#else
# include <dirent.h>
# include <sys/stat.h>