<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/3b2eacdebbc0b17763e441aefe7c6100fc3fb6eb">https://github.com/macports/macports-legacy-support/commit/3b2eacdebbc0b17763e441aefe7c6100fc3fb6eb</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 3b2eacdebbc0b17763e441aefe7c6100fc3fb6eb
</span>Author: Fred Wright <fw@fwright.net>
AuthorDate: Mon Jun 24 14:54:25 2024 -0700
<span style='display:block; white-space:pre;color:#404040;'> Implement __MPLS_SDK_MAJOR
</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;'> Builds and passes tests on all platforms.
</span>---
include/_macports_extras/sdkversion.h | 47 +++++++++++++++++++++++++++++++++--
manual_tests/headerinfo.c | 5 ++++
2 files changed, 50 insertions(+), 2 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/include/_macports_extras/sdkversion.h b/include/_macports_extras/sdkversion.h
</span><span style='display:block; white-space:pre;color:#808080;'>index bad2218..b02c350 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/include/_macports_extras/sdkversion.h
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/include/_macports_extras/sdkversion.h
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -53,10 +53,13 @@
</span> * In the non-Apple case, we avoid AvailabilityMacros.h, and just define our
* flags for the "minimally hackish" case.
*
<span style='display:block; white-space:pre;background:#ffe0e0;'>- * It would be maximally flexible if we could simply derive an SDK version
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * It would be maximally flexible if we could directly derive an SDK version
</span> * parameter from the "honest" ...MAX_ALLOWED, but cpp has no way to do that
* and survive the possible redefinition of ...MAX_ALLOWED in step 4. Hence,
<span style='display:block; white-space:pre;background:#ffe0e0;'>- * all decisions related to the SDK version need to be made in step 3.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * all decisions related to the SDK version need to be made in step 3. The
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * #if/#elif chain derives an SDK version number, but only with respect to
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * the "major" version (ignoring the least significant digit). Hence, it's
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * called "MAJOR" rather than "VERSION".
</span> *
* NOTE: Some "mismatched SDK" configurations may produce compiler warnings.
* These are not the fault of this header, and usually aren't fatal unless
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -111,6 +114,42 @@
</span> #define __MPLS_PRE_14_0_SDK 0
#endif
<span style='display:block; white-space:pre;background:#e0ffe0;'>+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MPLS_SDK_MAJOR 1040
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#elif MAC_OS_X_VERSION_MAX_ALLOWED < 1060
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MPLS_SDK_MAJOR 1050
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#elif MAC_OS_X_VERSION_MAX_ALLOWED < 1070
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MPLS_SDK_MAJOR 1060
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#elif MAC_OS_X_VERSION_MAX_ALLOWED < 1080
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MPLS_SDK_MAJOR 1070
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#elif MAC_OS_X_VERSION_MAX_ALLOWED < 1090
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MPLS_SDK_MAJOR 1080
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#elif MAC_OS_X_VERSION_MAX_ALLOWED < 101000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MPLS_SDK_MAJOR 1090
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#elif MAC_OS_X_VERSION_MAX_ALLOWED < 101100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MPLS_SDK_MAJOR 101000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#elif MAC_OS_X_VERSION_MAX_ALLOWED < 101200
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MPLS_SDK_MAJOR 101100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#elif MAC_OS_X_VERSION_MAX_ALLOWED < 101300
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MPLS_SDK_MAJOR 101200
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#elif MAC_OS_X_VERSION_MAX_ALLOWED < 101400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MPLS_SDK_MAJOR 101300
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#elif MAC_OS_X_VERSION_MAX_ALLOWED < 101500
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MPLS_SDK_MAJOR 101400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#elif MAC_OS_X_VERSION_MAX_ALLOWED < 110000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MPLS_SDK_MAJOR 101500
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#elif MAC_OS_X_VERSION_MAX_ALLOWED < 120000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MPLS_SDK_MAJOR 110000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#elif MAC_OS_X_VERSION_MAX_ALLOWED < 130000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MPLS_SDK_MAJOR 120000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#elif MAC_OS_X_VERSION_MAX_ALLOWED < 140000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MPLS_SDK_MAJOR 130000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#elif MAC_OS_X_VERSION_MAX_ALLOWED < 150000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MPLS_SDK_MAJOR 140000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#error Unknown SDK version
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> /* Then correct our munging, if necessary */
#ifdef __MPLS_NEED_MIN_REQUIRED_FIXUP
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -150,6 +189,10 @@
</span> #define __MPLS_PRE_14_0_SDK 0
#endif
<span style='display:block; white-space:pre;background:#e0ffe0;'>+#ifndef __MPLS_SDK_MAJOR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MPLS_SDK_MAJOR 999999
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> #endif /* !__APPLE__ */
#endif /* _MACPORTS_SDKVERSION_H_ */
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/manual_tests/headerinfo.c b/manual_tests/headerinfo.c
</span><span style='display:block; white-space:pre;color:#808080;'>index dff99df..9c37757 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/manual_tests/headerinfo.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/manual_tests/headerinfo.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -54,6 +54,11 @@ print_defs(void)
</span> #else
PRINT_UNDEF(MAC_OS_X_VERSION_MAX_ALLOWED);
#endif
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifdef __MPLS_SDK_MAJOR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PRINT_VAR(__MPLS_SDK_MAJOR);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ PRINT_UNDEF(__MPLS_SDK_MAJOR);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span> #ifdef __MPLS_PRE_10_5_SDK
PRINT_VAR(__MPLS_PRE_10_5_SDK);
#else
</pre><pre style='margin:0'>
</pre>