Remove wrapper function that only cast filename. Don’t run tests on UWP or ARM.
diff --git a/appveyor.yml b/appveyor.yml index d62fe49..379282a 100644 --- a/appveyor.yml +++ b/appveyor.yml
@@ -7,42 +7,52 @@ TRIPLET: x64-windows CMAKE_OPTS: "-DBUILD_SHARED_LIBS=off" CMAKE_CONFIG: Release + RUN_TESTS: yes # - GENERATOR: "Visual Studio 15 2017 Win64" # TRIPLET: x64-windows # CMAKE_OPTS: "-DBUILD_SHARED_LIBS=off" # CMAKE_CONFIG: Debug +# RUN_TESTS: yes - GENERATOR: "Visual Studio 15 2017 Win64" TRIPLET: x64-uwp CMAKE_OPTS: "-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0" CMAKE_CONFIG: Release + RUN_TESTS: no - GENERATOR: "Visual Studio 15 2017" TRIPLET: x86-windows CMAKE_OPTS: "-DBUILD_SHARED_LIBS=off" CMAKE_CONFIG: Release + RUN_TESTS: yes # - GENERATOR: "Visual Studio 15 2017" # TRIPLET: x86-windows # CMAKE_OPTS: "-DBUILD_SHARED_LIBS=off" # CMAKE_CONFIG: Debug +# RUN_TESTS: yes - GENERATOR: "Visual Studio 15 2017" TRIPLET: x86-uwp CMAKE_OPTS: "-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0" CMAKE_CONFIG: Release + RUN_TESTS: no - GENERATOR: "Visual Studio 15 2017 ARM" TRIPLET: arm-windows CMAKE_OPTS: "-DENABLE_OPENSSL=off" CMAKE_CONFIG: Release + RUN_TESTS: no - GENERATOR: "Visual Studio 15 2017 ARM" TRIPLET: arm-uwp CMAKE_OPTS: "-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 -DENABLE_OPENSSL=off" CMAKE_CONFIG: Release + RUN_TESTS: no - GENERATOR: "Visual Studio 15 2017" TRIPLET: arm64-windows CMAKE_OPTS: "-AARM64 -DENABLE_OPENSSL=off" CMAKE_CONFIG: Release + RUN_TESTS: no - GENERATOR: "Visual Studio 15 2017" TRIPLET: arm64-uwp CMAKE_OPTS: "-AARM64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 -DENABLE_OPENSSL=off" CMAKE_CONFIG: Release + RUN_TESTS: no before_build: cmd: >- @@ -78,4 +88,4 @@ cmd: >- set VERBOSE=yes - ctest -C %CMAKE_CONFIG% --output-on-failure + IF %RUN_TESTS%==yes ( ctest -C %CMAKE_CONFIG% --output-on-failure )
diff --git a/lib/zip_source_file_win32.h b/lib/zip_source_file_win32.h index 0a3027b..5d925da 100644 --- a/lib/zip_source_file_win32.h +++ b/lib/zip_source_file_win32.h
@@ -49,13 +49,13 @@ struct zip_source_file_win32_write_operations { char *(*allocate_tempname)(const char *name, size_t extra_chars, size_t *lengthp); - HANDLE (*create_file)(const char *name, DWORD access, DWORD share_mode, PSECURITY_ATTRIBUTES security_attributes, DWORD creation_disposition, DWORD file_attributes, HANDLE template_file); - BOOL (*delete_file)(const char *name); - DWORD (*get_file_attributes)(const char *name); - BOOL (*get_file_attributes_ex)(const char *name, GET_FILEEX_INFO_LEVELS info_level, void *information); + HANDLE (__stdcall *create_file)(const void *name, DWORD access, DWORD share_mode, PSECURITY_ATTRIBUTES security_attributes, DWORD creation_disposition, DWORD file_attributes, HANDLE template_file); + BOOL (__stdcall *delete_file)(const void *name); + DWORD (__stdcall *get_file_attributes)(const void *name); + BOOL (__stdcall *get_file_attributes_ex)(const void *name, GET_FILEEX_INFO_LEVELS info_level, void *information); void (*make_tempname)(char *buf, size_t len, const char *name, zip_uint32_t i); - BOOL (*move_file)(const char *from, const char *to, DWORD flags); - BOOL (*set_file_attributes)(const char *name, DWORD attributes); + BOOL (__stdcall *move_file)(const void *from, const void *to, DWORD flags); + BOOL (__stdcall *set_file_attributes)(const void *name, DWORD attributes); char *(*string_duplicate)(const char *string); };
diff --git a/lib/zip_source_file_win32_ansi.c b/lib/zip_source_file_win32_ansi.c index 9623f7c..1869a12 100644 --- a/lib/zip_source_file_win32_ansi.c +++ b/lib/zip_source_file_win32_ansi.c
@@ -36,27 +36,6 @@ static char *ansi_allocate_tempname(const char *name, size_t extra_chars, size_t *lengthp); static void ansi_make_tempname(char *buf, size_t len, const char *name, zip_uint32_t i); -struct test { - DWORD (__stdcall *get_file_attributes)(const void *name); -}; - -struct test test_a = { - GetFileAttributesA -}; - -struct test test_w = { - GetFileAttributesW -}; - -static -DWORD __stdcall get_file_attributes_own(const void *name) { - return 0; -} - -struct test test_own = { - get_file_attributes_own -}; - zip_source_file_win32_write_operations_t ops_ansi = { ansi_allocate_tempname, CreateFileA,
diff --git a/lib/zip_source_file_win32_utf16.c b/lib/zip_source_file_win32_utf16.c index 9ada4af..42fb531 100644 --- a/lib/zip_source_file_win32_utf16.c +++ b/lib/zip_source_file_win32_utf16.c
@@ -34,24 +34,19 @@ #include "zip_source_file_win32.h" static char *utf16_allocate_tempname(const char *name, size_t extra_chars, size_t *lengthp); -static HANDLE utf16_create_file(const char *name, DWORD access, DWORD share_mode, PSECURITY_ATTRIBUTES security_attributes, DWORD creation_disposition, DWORD file_attributes, HANDLE template_file); -static BOOL utf16_delete_file(const char *name); -static DWORD utf16_get_file_attributes(const char *name); -static BOOL utf16_get_file_attributes_ex(const char *name, GET_FILEEX_INFO_LEVELS info_level, void *information); +static HANDLE __stdcall utf16_create_file(const void *name, DWORD access, DWORD share_mode, PSECURITY_ATTRIBUTES security_attributes, DWORD creation_disposition, DWORD file_attributes, HANDLE template_file); static void utf16_make_tempname(char *buf, size_t len, const char *name, zip_uint32_t i); -static BOOL utf16_move_file(const char *from, const char *to, DWORD flags); -static BOOL utf16_set_file_attributes(const char *name, DWORD attributes); static char *utf16_strdup(const char *string); zip_source_file_win32_write_operations_t ops_utf16 = { utf16_allocate_tempname, utf16_create_file, - utf16_delete_file, - utf16_get_file_attributes, - utf16_get_file_attributes_ex, + DeleteFileW, + GetFileAttributesW, + GetFileAttributesExW, utf16_make_tempname, - utf16_move_file, - utf16_set_file_attributes, + MoveFileExW, + SetFileAttributesW, utf16_strdup }; @@ -101,41 +96,11 @@ } -static BOOL -utf16_delete_file(const char *name) { - return DeleteFileW((const wchar_t *)name); -} - - -static DWORD -utf16_get_file_attributes(const char *name) { - return GetFileAttributesW((const wchar_t *)name); -} - - -static BOOL -utf16_get_file_attributes_ex(const char *name, GET_FILEEX_INFO_LEVELS info_level, void *information) { - return GetFileAttributesExW((const wchar_t *)name, info_level, information); -} - - - static void utf16_make_tempname(char *buf, size_t len, const char *name, zip_uint32_t i) { _snwprintf((wchar_t *)buf, len, L"%s.%08x", (const wchar_t *)name, i); } -static BOOL -utf16_move_file(const char *from, const char *to, DWORD flags) { - return MoveFileExW((const wchar_t *)from, (const wchar_t *)to, flags); -} - - -static BOOL -utf16_set_file_attributes(const char *name, DWORD attributes) { - return SetFileAttributesW((const wchar_t *)name, attributes); -} - static char * utf16_strdup(const char *string) {