From 917a77f6716818cbe2335e617d2f53ba5fbba8c2 Mon Sep 17 00:00:00 2001 From: anders_k Date: Thu, 25 Oct 2018 18:40:05 +0000 Subject: [PATCH] Make sure the architecture define is always set git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7026 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/Makensisw/toolbar.cpp | 2 +- Source/build.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Contrib/Makensisw/toolbar.cpp b/Contrib/Makensisw/toolbar.cpp index bad47272..7fa35e13 100644 --- a/Contrib/Makensisw/toolbar.cpp +++ b/Contrib/Makensisw/toolbar.cpp @@ -196,7 +196,7 @@ static UINT GetToolbarDropdownMenuPos(HWND hTB, UINT Id, POINT&pt) static void ShowToolbarDropdownMenu(const NMTOOLBAR&nmtb, HWND hNotifyWnd, HMENU hParentMenu, UINT SubMenuId = -1) { POINT pt; - HMENU hMenu = SubMenuId == -1 ? hParentMenu : FindSubMenu(hParentMenu, SubMenuId); + HMENU hMenu = SubMenuId == static_cast(-1) ? hParentMenu : FindSubMenu(hParentMenu, SubMenuId); UINT tpmf = GetToolbarDropdownMenuPos(nmtb.hdr.hwndFrom, nmtb.iItem, pt); TrackPopupMenu(hMenu, tpmf, pt.x, pt.y, 0, hNotifyWnd, NULL); } diff --git a/Source/build.cpp b/Source/build.cpp index 308fbfd8..d2dbddb3 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -3863,9 +3863,10 @@ int CEXEBuild::set_target_architecture_data() { TARGET_ARM64, _T("NSIS_ARM64"), _T("1") } }; for (i = 0; i < COUNTOF(tdef); ++i) definedlist.del(tdef[i].def); - for (i = 0; i < COUNTOF(tdef); ++i) if (tdef[i].tt == m_target_type) definedlist.set(tdef[i].def, tdef[i].val); + unsigned int success = false; + for (i = 0; i < COUNTOF(tdef); ++i) if (tdef[i].tt == m_target_type) definedlist.set(tdef[i].def, tdef[i].val), ++success; - return PS_OK; + return success ? PS_OK : PS_ERROR; } const TCHAR* CEXEBuild::get_target_suffix(CEXEBuild::TARGETTYPE tt, const TCHAR*defval) const