From d4afee825b63b1458c33826e01c516674c675bd0 Mon Sep 17 00:00:00 2001 From: jief666 Date: Tue, 20 Oct 2020 22:50:30 +0300 Subject: [PATCH] Keep path independant symbol. --- rEFIt_UEFI/Platform/Settings.cpp | 12 ++---------- rEFIt_UEFI/refit/menu.cpp | 5 +++-- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/rEFIt_UEFI/Platform/Settings.cpp b/rEFIt_UEFI/Platform/Settings.cpp index 10b84c91f..2a7172292 100644 --- a/rEFIt_UEFI/Platform/Settings.cpp +++ b/rEFIt_UEFI/Platform/Settings.cpp @@ -138,7 +138,8 @@ const LString8 gBuildId __attribute__((used)) = "Clover build id: " BUILD_ID; const LString8 gBuildId __attribute__((used)) = "Clover build id: " "unknown"; #endif -const char* path_independant = "path_independant"; +// __attribute__((used)) seems to not always work. So, in AboutRefit(), there is a trick to let the compiler thinks it's used. +const char* path_independant __attribute__((used)) = "path_independant"; EMU_VARIABLE_CONTROL_PROTOCOL *gEmuVariableControl = NULL; @@ -403,7 +404,6 @@ SetBootCurrent(REFIT_MENU_ITEM_BOOTNUM *Entry) &Entry->BootNum); if (EFI_ERROR(Status)) { DBG("Can't save BootCurrent, status=%s\n", efiStrError(Status)); - DBG("%s\n", path_independant); } //Next step is rotate BootOrder to set BootNum to first place BootOrder = (__typeof__(BootOrder))GetNvramVariable(L"BootOrder", &gEfiGlobalVariableGuid, NULL, &BootOrderSize); @@ -1556,14 +1556,6 @@ BOOLEAN IsOSValid(const XString8& MatchOS, const XString8& CurrOS) XString8Array osToc = Split(MatchOS, "."_XS8).trimEachString(); XString8Array currOStoc = Split(CurrOS, "."_XS8).trimEachString(); - - if ( osToc.size() > 0 && currOStoc.size() > 0 && osToc[0] == "11"_XS8 && currOStoc[0] == "11"_XS8 ) { - if (osToc.size() == 1 ) return true; - if (osToc.size() == 2 ) { - if ( osToc[1].equalIC("x") ) return true; - if ( currOStoc.size() == 2 && osToc[1] == currOStoc[1] ) return true; - } - } if (osToc.size() == 2) { if (currOStoc.size() == 2) { if ( osToc[0] == currOStoc[0] && osToc[1] == currOStoc[1]) { diff --git a/rEFIt_UEFI/refit/menu.cpp b/rEFIt_UEFI/refit/menu.cpp index 20da22dd0..545ecb800 100644 --- a/rEFIt_UEFI/refit/menu.cpp +++ b/rEFIt_UEFI/refit/menu.cpp @@ -1094,10 +1094,11 @@ void AboutRefit(void) // AboutMenu.TitleImage.setEmpty(); //done in the constructor // } // AboutMenu.AddMenuInfo_f(("Clover Version 5.0")); - if ( "unknown"_XS8 != LString8(gRevisionStr) ) AboutMenu.AddMenuInfo_f("%s%s", gRevisionStr, path_independant!=NULL ? "" : "."); // trick to let the compiler think path_independant is used and must be kept in binary. + if ( "unknown"_XS8 != LString8(gRevisionStr) ) AboutMenu.AddMenuInfo_f("%s", gRevisionStr); if ( "unknown"_XS8 != LString8(gFirmwareBuildDate) ) AboutMenu.AddMenuInfo_f(" Build: %s", gFirmwareBuildDate); if ( "unknown"_XS8 != gBuildId ) AboutMenu.AddMenuInfo_f(" Build id: %s", gBuildId.c_str()); - AboutMenu.AddMenuInfo_f(" "); + AboutMenu.AddMenuInfo_f("%s", path_independant); // trick to let the compiler think path_independant is used and must be kept in binary. + AboutMenu.Entries[AboutMenu.Entries.size()-1].Title.SWPrintf(" "); AboutMenu.AddMenuInfo_f("Based on rEFIt (c) 2006-2010 Christoph Pfisterer"); AboutMenu.AddMenuInfo_f("Portions Copyright (c) Intel Corporation"); AboutMenu.AddMenuInfo_f("Developers:");