Merge remote-tracking branch 'origin/feature-38-getprocaddress-warnings'

This commit is contained in:
Steffen Schümann 2019-11-22 11:00:53 +01:00
commit c97ac97b30

View File

@ -177,7 +177,7 @@
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// ghc::filesystem version in decimal (major * 10000 + minor * 100 + patch) // ghc::filesystem version in decimal (major * 10000 + minor * 100 + patch)
#define GHC_FILESYSTEM_VERSION 10208L #define GHC_FILESYSTEM_VERSION 10209L
namespace ghc { namespace ghc {
namespace filesystem { namespace filesystem {
@ -1602,7 +1602,7 @@ GHC_INLINE void create_symlink(const path& target_name, const path& new_symlink,
ec = detail::make_error_code(detail::portable_error::not_supported); ec = detail::make_error_code(detail::portable_error::not_supported);
return; return;
} }
static CreateSymbolicLinkW_fp api_call = reinterpret_cast<CreateSymbolicLinkW_fp>(GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "CreateSymbolicLinkW")); static CreateSymbolicLinkW_fp api_call = reinterpret_cast<CreateSymbolicLinkW_fp>(reinterpret_cast<void*>(GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "CreateSymbolicLinkW")));
if (api_call) { if (api_call) {
if (api_call(detail::fromUtf8<std::wstring>(new_symlink.u8string()).c_str(), detail::fromUtf8<std::wstring>(target_name.u8string()).c_str(), to_directory ? 1 : 0) == 0) { if (api_call(detail::fromUtf8<std::wstring>(new_symlink.u8string()).c_str(), detail::fromUtf8<std::wstring>(target_name.u8string()).c_str(), to_directory ? 1 : 0) == 0) {
auto result = ::GetLastError(); auto result = ::GetLastError();
@ -1619,7 +1619,7 @@ GHC_INLINE void create_symlink(const path& target_name, const path& new_symlink,
GHC_INLINE void create_hardlink(const path& target_name, const path& new_hardlink, std::error_code& ec) GHC_INLINE void create_hardlink(const path& target_name, const path& new_hardlink, std::error_code& ec)
{ {
static CreateHardLinkW_fp api_call = reinterpret_cast<CreateHardLinkW_fp>(GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "CreateHardLinkW")); static CreateHardLinkW_fp api_call = reinterpret_cast<CreateHardLinkW_fp>(reinterpret_cast<void*>(GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "CreateHardLinkW")));
if (api_call) { if (api_call) {
if (api_call(detail::fromUtf8<std::wstring>(new_hardlink.u8string()).c_str(), detail::fromUtf8<std::wstring>(target_name.u8string()).c_str(), NULL) == 0) { if (api_call(detail::fromUtf8<std::wstring>(new_hardlink.u8string()).c_str(), detail::fromUtf8<std::wstring>(target_name.u8string()).c_str(), NULL) == 0) {
ec = detail::make_system_error(); ec = detail::make_system_error();