Keep path independant symbol.

This commit is contained in:
jief666 2020-10-20 22:50:30 +03:00
parent d17d02b1f8
commit d4afee825b
2 changed files with 5 additions and 12 deletions

View File

@ -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<XString8Array>(MatchOS, "."_XS8).trimEachString();
XString8Array currOStoc = Split<XString8Array>(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]) {

View File

@ -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:");