From 4d47b10b0b0470027f625fb8b05aa8f65598d7d1 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 9 Sep 2018 13:55:37 +0200 Subject: [PATCH] Print warning when win32 CreateSymbolicLink asked but not available --- source/modules/water/files/File.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/modules/water/files/File.cpp b/source/modules/water/files/File.cpp index 8665057e1..3424a031f 100644 --- a/source/modules/water/files/File.cpp +++ b/source/modules/water/files/File.cpp @@ -952,11 +952,10 @@ bool File::createSymbolicLink (const File& linkFileToCreate, bool overwriteExist typedef BOOLEAN (WINAPI* PFUNC)(LPCTSTR, LPCTSTR, DWORD); const PFUNC pfn = (PFUNC)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "CreateSymbolicLinkA"); + CARLA_SAFE_ASSERT_RETURN(pfn != nullptr, false); - return pfn ? pfn(linkFileToCreate.getFullPathName().toRawUTF8(), - fullPath.toRawUTF8(), - isDirectory() ? 0x1 /*SYMBOLIC_LINK_FLAG_DIRECTORY*/ : 0x0) != FALSE - : false; + return pfn(linkFileToCreate.getFullPathName().toRawUTF8(), fullPath.toRawUTF8(), + isDirectory() ? 0x1 /*SYMBOLIC_LINK_FLAG_DIRECTORY*/ : 0x0) != FALSE; #else // one common reason for getting an error here is that the file already exists return symlink(fullPath.toRawUTF8(), linkFileToCreate.getFullPathName().toRawUTF8()) != -1;