From 0249b09677c53bd478723ba5ceea7e7c436097c4 Mon Sep 17 00:00:00 2001 From: Martin Fleisz Date: Mon, 14 Mar 2016 14:08:48 +0100 Subject: [PATCH] winpr: Fix definition of PathFileExists on Win32 --- winpr/include/winpr/path.h | 6 ++++++ winpr/libwinpr/CMakeLists.txt | 1 + winpr/libwinpr/path/shell.c | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/winpr/include/winpr/path.h b/winpr/include/winpr/path.h index eba13296a..685ee74a1 100644 --- a/winpr/include/winpr/path.h +++ b/winpr/include/winpr/path.h @@ -287,17 +287,23 @@ WINPR_API char* GetCombinedPath(const char* basePath, const char* subPath); WINPR_API BOOL PathMakePathA(LPCSTR path, LPSECURITY_ATTRIBUTES lpAttributes); +#ifndef WIN32 WINPR_API BOOL PathFileExistsA(LPCSTR pszPath); WINPR_API BOOL PathFileExistsW(LPCWSTR pszPath); +#endif #ifdef __cplusplus } #endif +#ifdef WIN32 +#include +#else #ifdef UNICODE #define PathFileExists PathFileExistsW #else #define PathFileExists PathFileExistsA #endif +#endif #endif /* WINPR_PATH_H */ diff --git a/winpr/libwinpr/CMakeLists.txt b/winpr/libwinpr/CMakeLists.txt index f49cb8dc8..7c65ad3bd 100644 --- a/winpr/libwinpr/CMakeLists.txt +++ b/winpr/libwinpr/CMakeLists.txt @@ -113,6 +113,7 @@ if (WIN32) @ONLY) set (WINPR_SRCS ${WINPR_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc) + list(APPEND WINPR_LIBS "Shlwapi") endif() add_library(${MODULE_NAME} ${WINPR_SRCS}) diff --git a/winpr/libwinpr/path/shell.c b/winpr/libwinpr/path/shell.c index b35f6293d..84ffcdc1e 100644 --- a/winpr/libwinpr/path/shell.c +++ b/winpr/libwinpr/path/shell.c @@ -481,6 +481,7 @@ BOOL PathMakePathA(LPCSTR path, LPSECURITY_ATTRIBUTES lpAttributes) return PathFileExistsA(path); } +#ifndef WIN32 BOOL PathFileExistsA(LPCSTR pszPath) { struct stat stat_info; @@ -495,4 +496,4 @@ BOOL PathFileExistsW(LPCWSTR pszPath) { return FALSE; } - +#endif