<pre style='margin:0'>
Christopher Nielsen (mascguy) pushed a commit to branch master
in repository macports-legacy-support.
</pre>
<p><a href="https://github.com/macports/macports-legacy-support/commit/a163d582cc784054bd8e5b03cfb0d835fc05eda1">https://github.com/macports/macports-legacy-support/commit/a163d582cc784054bd8e5b03cfb0d835fc05eda1</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit a163d582cc784054bd8e5b03cfb0d835fc05eda1
</span>Author: Fred Wright <fw@fwright.net>
AuthorDate: Sat Jun 29 20:11:24 2024 -0700
<span style='display:block; white-space:pre;color:#404040;'> checksdkversion: Fix bug with assumed (default) SDK.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> The assumed SDK version derived from the OS version may include
</span><span style='display:block; white-space:pre;color:#404040;'> the minor component, which wasn't being handled correctly.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Also fixes a couple of warnings.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> TESTED:
</span><span style='display:block; white-space:pre;color:#404040;'> No longer gives false errors with nonzero minor versions.
</span><span style='display:block; white-space:pre;color:#404040;'> No longer generates warnings in -Weverything mode.
</span>---
manual_tests/checksdkversion.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/manual_tests/checksdkversion.c b/manual_tests/checksdkversion.c
</span><span style='display:block; white-space:pre;color:#808080;'>index 9c0a4cf..588add9 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/manual_tests/checksdkversion.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/manual_tests/checksdkversion.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -32,7 +32,7 @@
</span> #define TARGET_OS 1040
#endif
<span style='display:block; white-space:pre;background:#ffe0e0;'>-int
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+static int
</span> get_sdknum(const char *sdkver)
{
long major, minor;
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -48,8 +48,8 @@ get_sdknum(const char *sdkver)
</span> }
if (major < 10 || (major > 10 && minor != 0)) return -1;
if (*endp && (major != 10 || minor != 4 || *endp != 'u')) return -1;
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if (major == 10 && minor <= 9) return major * 100 + minor * 10;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return major * 10000 + minor * 100;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (major == 10 && minor <= 9) return (int) (major * 100 + minor * 10);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (int) (major * 10000 + minor * 100);
</span> }
int
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -66,7 +66,7 @@ main(int argc, char *argv[])
</span> fprintf(stderr, "Bad SDK version: %s\n", sdkver ? sdkver : "???");
return 20;
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- sdkmajor = sdknum / 10 * 10; /* Paranoia - not actually needed here */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sdkmajor = sdknum / 10 * 10;
</span>
printf("Testing SDK version %s,%s numeric = %d, major = %d\n",
sdkver ? sdkver : "<default>", sdkver ? "" : " assumed",
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -76,7 +76,7 @@ main(int argc, char *argv[])
</span> printf(" __MPLS_SDK_MAJOR is undefined\n");
return 1;
#else
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if (__MPLS_SDK_MAJOR != sdknum) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (__MPLS_SDK_MAJOR != sdkmajor) {
</span> printf(" __MPLS_SDK_MAJOR is %d, should be %d\n",
__MPLS_SDK_MAJOR, sdkmajor);
return 2;
</pre><pre style='margin:0'>
</pre>