<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/adaaf2c5bc20c6e4403ce8b6120ee11a60fa0e6c">https://github.com/macports/macports-legacy-support/commit/adaaf2c5bc20c6e4403ce8b6120ee11a60fa0e6c</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit adaaf2c5bc20c6e4403ce8b6120ee11a60fa0e6c
</span>Author: Fred Wright <fw@fwright.net>
AuthorDate: Sat Jun 29 19:11:17 2024 -0700
<span style='display:block; white-space:pre;color:#404040;'> Availability*.h: Adjust "recursion" handling.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> This makes the sdkversion.h->AvailabilityMacros.h->Availability.h path
</span><span style='display:block; white-space:pre;color:#404040;'> behave more like some programs might expect. Because it now allows
</span><span style='display:block; white-space:pre;color:#404040;'> the include, AvailabilityInternal.h also needs the fix for the
</span><span style='display:block; white-space:pre;color:#404040;'> "recursion" case.
</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, including with mismatched
</span><span style='display:block; white-space:pre;color:#404040;'> SDK cases where allowed.
</span>---
include/Availability.h | 23 +++++++++++------------
include/AvailabilityInternal.h | 14 +++++++++++++-
2 files changed, 24 insertions(+), 13 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/include/Availability.h b/include/Availability.h
</span><span style='display:block; white-space:pre;color:#808080;'>index 8351599..336a5b0 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/include/Availability.h
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/include/Availability.h
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -19,25 +19,24 @@
</span> * the 10.4 SDK. In that case, we provide a substitute; otherwise we
* just pass through the SDK header.
*
<span style='display:block; white-space:pre;background:#ffe0e0;'>- * We don't use a guard macro, since it's not only unnecessary, but actually
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * harmful in this context. It's unnecessary since all we do here is include
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * We don't bother with a guard macro, since all we do here is include
</span> * other headers which have their own guard macros, and we don't define
<span style='display:block; white-space:pre;background:#ffe0e0;'>- * anything here. It would be harmful because we need to short-circuit the
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * possible sdkversion.h->AvailabilityMacros.h->Availability.h path where
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * __MPLS_SDK_MAJOR is not yet defined, and hence need a second bite of
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * the apple to get Availability.h for real.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * anything here.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * There'a complication in the case where AvailabilityMacros.h (included by
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * sdkversion.h) #includes Availability.h (currently in 10.9+ SDKs). In that
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * case, the sdkversion.h #include below does nothing due to its guard
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * macro (avoiding infinite recursion), but then we're here before defining
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * __MPLS_SDK_MAJOR. Since we know that a 10.4 AvailabilityMacros.h would
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * never include its nonexistent Availability.h, it's safe to apply the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * non-10.4 treatment in that case.
</span> */
/* Do our SDK-related setup */
#include <_macports_extras/sdkversion.h>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-/* If __MPLS_SDK_MAJOR isn't defined here, do nothing. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-#ifdef __MPLS_SDK_MAJOR
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-#if __MPLS_SDK_MAJOR < 1050
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if defined(__MPLS_SDK_MAJOR) && __MPLS_SDK_MAJOR < 1050
</span> #include <_macports_extras/tiger_only/Availability.h>
#else
#include_next <Availability.h>
#endif
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-#endif /* __MPLS_SDK_MAJOR defined */
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/include/AvailabilityInternal.h b/include/AvailabilityInternal.h
</span><span style='display:block; white-space:pre;color:#808080;'>index fbec481..a0e532d 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/include/AvailabilityInternal.h
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/include/AvailabilityInternal.h
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -33,11 +33,21 @@
</span> * including a defined() condition, but that doesn't actually work because
* the intrinsic needs to be parseable before evaluating the boolean.
* So we again provide a default when needed.
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ *
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * There'a complication in the case where AvailabilityMacros.h (included by
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * sdkversion.h) #includes Availability.h (currently in 10.9+ SDKs). In that
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * case, the sdkversion.h #include below does nothing due to its guard
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * macro (avoiding infinite recursion), but then we're here before defining
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * __MPLS_SDK_MAJOR. Since we know that a 10.4 AvailabilityMacros.h would
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * never include its nonexistent Availability.h, it's safe to apply the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * non-10.4 treatment in that case.
</span> */
/* Do our SDK-related setup */
#include <_macports_extras/sdkversion.h>
<span style='display:block; white-space:pre;background:#e0ffe0;'>+#ifdef __MPLS_SDK_MAJOR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> #if __MPLS_SDK_MAJOR >= 101400 && !defined(__has_include)
#define __has_include(x) 0
#endif
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -46,7 +56,9 @@
</span> #define __has_builtin(x) 0
#endif
<span style='display:block; white-space:pre;background:#ffe0e0;'>-#if __MPLS_SDK_MAJOR < 1050
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif /* __MPLS_SDK_MAJOR */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if defined(__MPLS_SDK_MAJOR) && __MPLS_SDK_MAJOR < 1050
</span> #include <_macports_extras/tiger_only/AvailabilityInternal.h>
#else
#include_next <AvailabilityInternal.h>
</pre><pre style='margin:0'>
</pre>