From 798ea907848cc8adf4eb284f192ce2b58c4faba2 Mon Sep 17 00:00:00 2001 From: Joachim Henze Date: Sun, 13 Oct 2024 19:23:38 +0200 Subject: [PATCH] [FREELDR] Less outdated version-hardcodes (#7384) Those haven't been groomed anymore for more than 10 years. We had many thousands of different freeldr builds with different behavior and bugs each, but nobody ever did have the slightest motivation to update those hardcoded FREELOADER_MAJOR_VERSION, FREELOADER_MINOR_VERSION, FREELOADER_PATCH_VERSION from ver.h. And that is logical, because touching other modules will change the behavior of freeldr as well, so it is absolutely impossible to groom anything like that correctly. Instead we should simply do what we started to do in PR7383, which will at least give some information (the actual sources it was built from) instead of some misleading voodoo-version. This might slightly shrink the size of freeldr as well, but I was too lazy to measure by how much. --- boot/freeldr/freeldr/freeldr.c | 10 ---------- boot/freeldr/freeldr/include/ver.h | 17 +++-------------- boot/freeldr/freeldr/ui/tui.c | 2 +- 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/boot/freeldr/freeldr/freeldr.c b/boot/freeldr/freeldr/freeldr.c index c7bac46d93f..bbed7a4139a 100644 --- a/boot/freeldr/freeldr/freeldr.c +++ b/boot/freeldr/freeldr/freeldr.c @@ -26,16 +26,6 @@ DBG_DEFAULT_CHANNEL(WARNING); /* GLOBALS ********************************************************************/ -#define TOSTRING_(X) #X -#define TOSTRING(X) TOSTRING_(X) - -const PCSTR FrLdrVersionString = -#if (FREELOADER_PATCH_VERSION == 0) - "FreeLoader v" TOSTRING(FREELOADER_MAJOR_VERSION) "." TOSTRING(FREELOADER_MINOR_VERSION); -#else - "FreeLoader v" TOSTRING(FREELOADER_MAJOR_VERSION) "." TOSTRING(FREELOADER_MINOR_VERSION) "." TOSTRING(FREELOADER_PATCH_VERSION); -#endif - CCHAR FrLdrBootPath[MAX_PATH] = ""; /* FUNCTIONS ******************************************************************/ diff --git a/boot/freeldr/freeldr/include/ver.h b/boot/freeldr/freeldr/include/ver.h index 26cbb1195d9..dcffdc1aec4 100644 --- a/boot/freeldr/freeldr/include/ver.h +++ b/boot/freeldr/freeldr/include/ver.h @@ -19,21 +19,10 @@ #pragma once -/* Just some stuff */ +// FreeLoader version defines +// If you add features then you increment the minor version +// If you add major functionality then you increment the major version and zero the minor version #define VERSION "FreeLoader v3.2" #define COPYRIGHT "Copyright (C) 1996-" COPYRIGHT_YEAR " ReactOS Project" #define AUTHOR_EMAIL "" #define BY_AUTHOR "by ReactOS Project" - -// FreeLoader version defines -// -// NOTE: -// If you fix bugs then you increment the patch version -// If you add features then you increment the minor version and zero the patch version -// If you add major functionality then you increment the major version and zero the minor & patch versions -// -#define FREELOADER_MAJOR_VERSION 3 -#define FREELOADER_MINOR_VERSION 2 -#define FREELOADER_PATCH_VERSION 0 - -extern const PCSTR FrLdrVersionString; diff --git a/boot/freeldr/freeldr/ui/tui.c b/boot/freeldr/freeldr/ui/tui.c index b712820b60a..5960dcd5d44 100644 --- a/boot/freeldr/freeldr/ui/tui.c +++ b/boot/freeldr/freeldr/ui/tui.c @@ -293,7 +293,7 @@ VOID TuiDrawBackdrop(VOID) /* Draw version text */ TuiDrawText(2, 1, - FrLdrVersionString, + VERSION, ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor)); /* Draw copyright */