Browse Source

Print warning when win32 CreateSymbolicLink asked but not available

tags/v1.9.11
falkTX 6 years ago
parent
commit
4d47b10b0b
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      source/modules/water/files/File.cpp

+ 3
- 4
source/modules/water/files/File.cpp View File

@@ -952,11 +952,10 @@ bool File::createSymbolicLink (const File& linkFileToCreate, bool overwriteExist
typedef BOOLEAN (WINAPI* PFUNC)(LPCTSTR, LPCTSTR, DWORD); typedef BOOLEAN (WINAPI* PFUNC)(LPCTSTR, LPCTSTR, DWORD);
const PFUNC pfn = (PFUNC)GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "CreateSymbolicLinkA"); 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 #else
// one common reason for getting an error here is that the file already exists // one common reason for getting an error here is that the file already exists
return symlink(fullPath.toRawUTF8(), linkFileToCreate.getFullPathName().toRawUTF8()) != -1; return symlink(fullPath.toRawUTF8(), linkFileToCreate.getFullPathName().toRawUTF8()) != -1;


Loading…
Cancel
Save