From 02840d503c7196ecd528e6ad0109ba1bd772c988 Mon Sep 17 00:00:00 2001 From: lcvgit <121000412+lcvgit@users.noreply.github.com> Date: Mon, 21 Oct 2024 10:00:48 -0500 Subject: [PATCH 1/2] Fix checkversion.c Add missing shifts for checking version from __CC65__. --- samples/checkversion.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/checkversion.c b/samples/checkversion.c index 1d3494a87..ca8843921 100644 --- a/samples/checkversion.c +++ b/samples/checkversion.c @@ -10,11 +10,11 @@ #include #include -#if ((__CC65__ & 0xff00) > 3) || ((__CC65__ & 0x000f) > 0) +#if (((__CC65__ & 0xff00) >> 8) > 3) || ((__CC65__ & 0x000f) > 0) /* compiler version is 2.19-git or higher */ # define VER_MAJOR ((__CC65__ >> 8) & 0xff) # define VER_MINOR (__CC65__ & 0xff) -#elif ((__CC65__ & 0xff00) == 3) +#elif (((__CC65__ & 0xff00) >> 8) == 3) /* broken values in version 2.16 - 2.19-git before the bug was fixed */ # define VER_MAJOR 2 # define VER_MINOR (((__CC65__ >> 4) & 0x0f) + 16) From c41eb007e48adcd5890b75111d63438111caf0f5 Mon Sep 17 00:00:00 2001 From: lcvgit <121000412+lcvgit@users.noreply.github.com> Date: Mon, 21 Oct 2024 10:09:00 -0500 Subject: [PATCH 2/2] Update checkversion.c Add missing shifts. --- samples/checkversion.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/checkversion.c b/samples/checkversion.c index ca8843921..f2a9d4a49 100644 --- a/samples/checkversion.c +++ b/samples/checkversion.c @@ -10,11 +10,11 @@ #include #include -#if (((__CC65__ & 0xff00) >> 8) > 3) || ((__CC65__ & 0x000f) > 0) +#if ((__CC65__ >> 8) > 3) || ((__CC65__ & 0x000f) > 0) /* compiler version is 2.19-git or higher */ # define VER_MAJOR ((__CC65__ >> 8) & 0xff) # define VER_MINOR (__CC65__ & 0xff) -#elif (((__CC65__ & 0xff00) >> 8) == 3) +#elif ((__CC65__ >> 8) == 3) /* broken values in version 2.16 - 2.19-git before the bug was fixed */ # define VER_MAJOR 2 # define VER_MINOR (((__CC65__ >> 4) & 0x0f) + 16)