winpr: fix PathFileExists on UWP
authorMarc-André Moreau <marcandre.moreau@gmail.com>
Fri, 25 Mar 2016 16:20:51 +0000 (12:20 -0400)
committerMarc-André Moreau <marcandre.moreau@gmail.com>
Fri, 25 Mar 2016 16:20:51 +0000 (12:20 -0400)
winpr/include/winpr/path.h
winpr/libwinpr/path/shell.c

index 685ee74..4575063 100644 (file)
@@ -287,23 +287,25 @@ WINPR_API char* GetCombinedPath(const char* basePath, const char* subPath);
 
 WINPR_API BOOL PathMakePathA(LPCSTR path, LPSECURITY_ATTRIBUTES lpAttributes);
 
-#ifndef WIN32
+#if !defined(_WIN32) || defined(_UWP)
+
 WINPR_API BOOL PathFileExistsA(LPCSTR pszPath);
 WINPR_API BOOL PathFileExistsW(LPCWSTR pszPath);
+
+#ifdef UNICODE
+#define PathFileExists PathFileExistsW
+#else
+#define PathFileExists PathFileExistsA
+#endif
+
 #endif
 
 #ifdef __cplusplus
 }
 #endif
 
-#ifdef WIN32
+#ifdef _WIN32
 #include <Shlwapi.h>
-#else
-#ifdef UNICODE
-#define PathFileExists PathFileExistsW
-#else
-#define PathFileExists PathFileExistsA
-#endif
 #endif
 
 #endif /* WINPR_PATH_H */
index d7a4c26..b1b259f 100644 (file)
@@ -480,7 +480,8 @@ BOOL PathMakePathA(LPCSTR path, LPSECURITY_ATTRIBUTES lpAttributes)
        return PathFileExistsA(path);
 }
 
-#ifndef WIN32
+#if !defined(_WIN32) || defined(_UWP)
+
 BOOL PathFileExistsA(LPCSTR pszPath)
 {
        struct stat stat_info;
@@ -495,4 +496,5 @@ BOOL PathFileExistsW(LPCWSTR pszPath)
 {
        return FALSE;
 }
+
 #endif