From 7746942a55e7c26e890fd55ffe1e5f70693ad3ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Tue, 4 Jun 2024 18:49:10 +0200 Subject: [PATCH] win32: remove pathcch compatibility code No longer needed after 9f8b4b38c97f0697fbc3a9b30e4e856337cd6dcf. --- meson.build | 6 +----- misc/path_utils.c | 6 ++---- test/meson.build | 8 +++----- test/paths.c | 4 ---- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/meson.build b/meson.build index aa9fb1ea94..1ae869bdeb 100644 --- a/meson.build +++ b/meson.build @@ -497,17 +497,13 @@ endif features += {'win32-desktop': win32 and not uwp.found()} if features['win32-desktop'] - pathcch = cc.find_library('pathcch', required: false) - features += {'pathcch': pathcch.found()} - if features['pathcch'] - dependencies += pathcch - endif win32_desktop_libs = [cc.find_library('avrt'), cc.find_library('dwmapi'), cc.find_library('gdi32'), cc.find_library('imm32'), cc.find_library('ntdll'), cc.find_library('ole32'), + cc.find_library('pathcch'), cc.find_library('shcore'), cc.find_library('user32'), cc.find_library('uuid'), diff --git a/misc/path_utils.c b/misc/path_utils.c index 4349fc13b3..2f4c83b621 100644 --- a/misc/path_utils.c +++ b/misc/path_utils.c @@ -34,7 +34,7 @@ #include "misc/ctype.h" #include "misc/path_utils.h" -#if defined(HAVE_PATHCCH) && HAVE_PATHCCH +#if HAVE_DOS_PATHS #include #include #endif @@ -171,7 +171,7 @@ char *mp_normalize_path(void *talloc_ctx, const char *path) path = mp_path_join(talloc_ctx, cwd, path); } -#if defined(HAVE_PATHCCH) && HAVE_PATHCCH +#if HAVE_DOS_PATHS wchar_t *pathw = mp_from_utf8(NULL, path); wchar_t *read = pathw, *write = pathw; wchar_t prev = '\0'; @@ -198,8 +198,6 @@ char *mp_normalize_path(void *talloc_ctx, const char *path) talloc_free(pathw); talloc_free(pathc); return ret; -#elif HAVE_DOS_PATHS - return talloc_strdup(talloc_ctx, path); #else char *result = talloc_strdup(talloc_ctx, ""); const char *next; diff --git a/test/meson.build b/test/meson.build index b14f2ef661..7c1a87ff17 100644 --- a/test/meson.build +++ b/test/meson.build @@ -46,11 +46,9 @@ if not features['win32-threads'] endif if features['win32-desktop'] - test_utils_deps += cc.find_library('imm32') - test_utils_deps += cc.find_library('ntdll') - if features['pathcch'] - test_utils_deps += cc.find_library('pathcch') - endif + test_utils_deps += [cc.find_library('imm32'), + cc.find_library('ntdll'), + cc.find_library('pathcch')] endif test_utils_objects = libmpv.extract_objects(test_utils_files) test_utils = static_library('test-utils', 'test_utils.c', include_directories: incdir, diff --git a/test/paths.c b/test/paths.c index 4a4c7cd1fa..d0f020a0f6 100644 --- a/test/paths.c +++ b/test/paths.c @@ -79,10 +79,6 @@ int main(void) TEST_NORMALIZE("/foo", "/foo"); #endif -#if defined(_WIN32) && (!defined(HAVE_PATHCCH) || !HAVE_PATHCCH) - return 0; -#endif - void *ctx = talloc_new(NULL); bstr dst = bstr0(mp_getcwd(ctx)); bstr_xappend(ctx, &dst, bstr0("/foo"));