From 3bf17ec697dca9bbb613cc6b6bca114128a3c566 Mon Sep 17 00:00:00 2001 From: Don HO Date: Wed, 20 Jan 2021 04:55:42 +0100 Subject: [PATCH] Fix build error in MinGW and fix a misuse of CopyFileEx function. --- PowerEditor/gcc/include/various.h | 2 +- PowerEditor/src/NppIO.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PowerEditor/gcc/include/various.h b/PowerEditor/gcc/include/various.h index ae1658c05..8469f7c93 100644 --- a/PowerEditor/gcc/include/various.h +++ b/PowerEditor/gcc/include/various.h @@ -11,7 +11,7 @@ //TBSTYLE_EX_HIDECLIPPEDBUTTONS = 501 //#define _WIN32_IE 0x501 //Theme (uxtheme) -#define _WIN32_WINNT 0x0501 +#define _WIN32_WINNT 0x0600 //#include diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index 4161d0c7f..e3ace2d2e 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -1566,8 +1566,8 @@ bool Notepad_plus::fileSave(BufferID id) } } - BOOL keepGoing = TRUE; - if (!::CopyFileEx(fn, fn_bak.c_str(), nullptr, nullptr, &keepGoing, COPY_FILE_NO_BUFFERING)) + BOOL doCancel = FALSE; + if (!::CopyFileEx(fn, fn_bak.c_str(), nullptr, nullptr, &doCancel, COPY_FILE_NO_BUFFERING)) { int res = _nativeLangSpeaker.messageBox("FileBackupFailed", _pPublicInterface->getHSelf(),