winpr: Fix definition of PathFileExists on Win32
authorMartin Fleisz <martin.fleisz@thincast.com>
Mon, 14 Mar 2016 13:08:48 +0000 (14:08 +0100)
committerMartin Fleisz <martin.fleisz@thincast.com>
Mon, 14 Mar 2016 13:08:48 +0000 (14:08 +0100)
winpr/include/winpr/path.h
winpr/libwinpr/CMakeLists.txt
winpr/libwinpr/path/shell.c

index eba1329..685ee74 100644 (file)
@@ -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 <Shlwapi.h>
+#else
 #ifdef UNICODE
 #define PathFileExists PathFileExistsW
 #else
 #define PathFileExists PathFileExistsA
 #endif
+#endif
 
 #endif /* WINPR_PATH_H */
index f49cb8d..7c65ad3 100644 (file)
@@ -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})
index b35f629..84ffcdc 100644 (file)
@@ -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