Merge pull request #3224 from mfleisz/win32_bld_fix
winpr: Fix definition of PathFileExists on Win32
This commit is contained in:
commit
05bcec47b8
@ -287,17 +287,23 @@ WINPR_API char* GetCombinedPath(const char* basePath, const char* subPath);
|
|||||||
|
|
||||||
WINPR_API BOOL PathMakePathA(LPCSTR path, LPSECURITY_ATTRIBUTES lpAttributes);
|
WINPR_API BOOL PathMakePathA(LPCSTR path, LPSECURITY_ATTRIBUTES lpAttributes);
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
WINPR_API BOOL PathFileExistsA(LPCSTR pszPath);
|
WINPR_API BOOL PathFileExistsA(LPCSTR pszPath);
|
||||||
WINPR_API BOOL PathFileExistsW(LPCWSTR pszPath);
|
WINPR_API BOOL PathFileExistsW(LPCWSTR pszPath);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#include <Shlwapi.h>
|
||||||
|
#else
|
||||||
#ifdef UNICODE
|
#ifdef UNICODE
|
||||||
#define PathFileExists PathFileExistsW
|
#define PathFileExists PathFileExistsW
|
||||||
#else
|
#else
|
||||||
#define PathFileExists PathFileExistsA
|
#define PathFileExists PathFileExistsA
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* WINPR_PATH_H */
|
#endif /* WINPR_PATH_H */
|
||||||
|
@ -113,6 +113,7 @@ if (WIN32)
|
|||||||
@ONLY)
|
@ONLY)
|
||||||
|
|
||||||
set (WINPR_SRCS ${WINPR_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
set (WINPR_SRCS ${WINPR_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
||||||
|
list(APPEND WINPR_LIBS "Shlwapi")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(${MODULE_NAME} ${WINPR_SRCS})
|
add_library(${MODULE_NAME} ${WINPR_SRCS})
|
||||||
|
@ -481,6 +481,7 @@ BOOL PathMakePathA(LPCSTR path, LPSECURITY_ATTRIBUTES lpAttributes)
|
|||||||
return PathFileExistsA(path);
|
return PathFileExistsA(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
BOOL PathFileExistsA(LPCSTR pszPath)
|
BOOL PathFileExistsA(LPCSTR pszPath)
|
||||||
{
|
{
|
||||||
struct stat stat_info;
|
struct stat stat_info;
|
||||||
@ -495,4 +496,4 @@ BOOL PathFileExistsW(LPCWSTR pszPath)
|
|||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user