<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/ebe4d3d8c3816a42612eac344aa969b1c8387883">https://github.com/macports/macports-legacy-support/commit/ebe4d3d8c3816a42612eac344aa969b1c8387883</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit ebe4d3d8c3816a42612eac344aa969b1c8387883
</span>Author: Fred Wright <fw@fwright.net>
AuthorDate: Mon Jun 24 17:43:26 2024 -0700
<span style='display:block; white-space:pre;color:#404040;'> Convert SDK flag references to new scheme.
</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 mismatched SDK
</span><span style='display:block; white-space:pre;color:#404040;'> cases.
</span>---
include/Availability.h | 16 +++++++++++++---
include/AvailabilityInternal.h | 6 +++---
include/copyfile.h | 6 +++---
include/sys/stdio.h | 4 ++--
include/sys/types.h | 4 ++--
src/fdopendir.c | 4 ++--
src/macports_legacy_symbol_aliases.c | 4 ++--
7 files changed, 27 insertions(+), 17 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 aeff58f..8351599 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,15 +19,25 @@
</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 bother with a guard macro, since the included headers will
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * handle that.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * We don't use a guard macro, since it's not only unnecessary, but actually
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * harmful in this context. It's unnecessary since all we do here is include
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * other headers which have their own guard macros, and we don't define
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * anything here. It would be harmful because we need to short-circuit the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * possible sdkversion.h->AvailabilityMacros.h->Availability.h path where
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * __MPLS_SDK_MAJOR is not yet defined, and hence need a second bite of
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * the apple to get Availability.h for real.
</span> */
/* Do our SDK-related setup */
#include <_macports_extras/sdkversion.h>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-#if __MPLS_PRE_10_5_SDK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* If __MPLS_SDK_MAJOR isn't defined here, do nothing. */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#ifdef __MPLS_SDK_MAJOR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if __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:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#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 e2166ad..fbec481 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;'>@@ -38,15 +38,15 @@
</span> /* Do our SDK-related setup */
#include <_macports_extras/sdkversion.h>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-#if !__MPLS_PRE_10_14_SDK && !defined(__has_include)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if __MPLS_SDK_MAJOR >= 101400 && !defined(__has_include)
</span> #define __has_include(x) 0
#endif
<span style='display:block; white-space:pre;background:#ffe0e0;'>-#if !__MPLS_PRE_14_0_SDK && !defined(__has_builtin)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if __MPLS_SDK_MAJOR >= 140000 && !defined(__has_builtin)
</span> #define __has_builtin(x) 0
#endif
<span style='display:block; white-space:pre;background:#ffe0e0;'>-#if __MPLS_PRE_10_5_SDK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if __MPLS_SDK_MAJOR < 1050
</span> #include <_macports_extras/tiger_only/AvailabilityInternal.h>
#else
#include_next <AvailabilityInternal.h>
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/include/copyfile.h b/include/copyfile.h
</span><span style='display:block; white-space:pre;color:#808080;'>index bd990ab..fa63864 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/include/copyfile.h
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/include/copyfile.h
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -23,13 +23,13 @@
</span> /* Do our SDK-related setup */
#include <_macports_extras/sdkversion.h>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-#if __MPLS_PRE_10_5_SDK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if __MPLS_SDK_MAJOR < 1050
</span>
#include <_macports_extras/tiger_only/copyfile.h>
/* The replacement copyfile.h doesn't need the wrapper */
<span style='display:block; white-space:pre;background:#ffe0e0;'>-#else /* !__MPLS_PRE_10_5_SDK */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#else /* __MPLS_SDK_MAJOR >= 1050 */
</span>
/* Include the primary system copyfile.h */
#include_next <copyfile.h>
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -42,6 +42,6 @@
</span>
#endif /* __MP_LEGACY_SUPPORT_COPYFILE_WRAP__ */
<span style='display:block; white-space:pre;background:#ffe0e0;'>-#endif /* !__MPLS_PRE_10_5_SDK */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif /* __MPLS_SDK_MAJOR >= 1050 */
</span>
#endif /* _MACPORTS_COPYFILE_H_ */
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/include/sys/stdio.h b/include/sys/stdio.h
</span><span style='display:block; white-space:pre;color:#808080;'>index c047c9a..fdfc512 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/include/sys/stdio.h
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/include/sys/stdio.h
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -24,8 +24,8 @@
</span> /* Do our SDK-related setup */
#include <_macports_extras/sdkversion.h>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-/* Include the primary system sys/stdio.h (10.7+ only) */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-#if !__MPLS_PRE_10_10_SDK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* Include the primary system sys/stdio.h (10.10+ only) */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if __MPLS_SDK_MAJOR >= 101000
</span> #include_next <sys/stdio.h>
#endif
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/include/sys/types.h b/include/sys/types.h
</span><span style='display:block; white-space:pre;color:#808080;'>index 35588ef..2403e63 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/include/sys/types.h
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/include/sys/types.h
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -78,7 +78,7 @@
</span>
#include_next <sys/types.h>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-#if __MPLS_PRE_10_5_SDK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if __MPLS_SDK_MAJOR < 1050
</span>
#ifndef _MACPORTS_SYS_TYPES_H_
#define _MACPORTS_SYS_TYPES_H_
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -99,4 +99,4 @@ typedef unsigned int uint; /* Sys V compatibility */
</span>
#endif /* _MACPORTS_SYS_TYPES_H_ */
<span style='display:block; white-space:pre;background:#ffe0e0;'>-#endif /* !__MPLS_PRE_10_5_SDK */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif /* __MPLS_SDK_MAJOR < 1050 */
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/fdopendir.c b/src/fdopendir.c
</span><span style='display:block; white-space:pre;color:#808080;'>index 03fd063..d8f7e5e 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/fdopendir.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/fdopendir.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -29,9 +29,9 @@
</span> #include <dirent.h>
#include <sys/stat.h>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-#if __MPLS_PRE_10_5_SDK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if __MPLS_SDK_MAJOR < 1050
</span> #define __dd_fd dd_fd
<span style='display:block; white-space:pre;background:#ffe0e0;'>-#endif /* __MPLS_PRE_10_5_SDK */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif /* __MPLS_SDK_MAJOR < 1050 */
</span>
/*
* Implementation behavior largely follows these man page descriptions:
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports_legacy_symbol_aliases.c b/src/macports_legacy_symbol_aliases.c
</span><span style='display:block; white-space:pre;color:#808080;'>index 9766ab4..6f5b3a3 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports_legacy_symbol_aliases.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports_legacy_symbol_aliases.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -41,9 +41,9 @@ Prior to 10.8, `dirfd` was a macro`.
</span> The Rust compiler requires `dirfd` to be a library symbol.
*/
#undef dirfd
<span style='display:block; white-space:pre;background:#ffe0e0;'>-#if __MPLS_PRE_10_5_SDK
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if __MPLS_SDK_MAJOR < 1050
</span> #define __dd_fd dd_fd
<span style='display:block; white-space:pre;background:#ffe0e0;'>-#endif /* __MPLS_PRE_10_5_SDK */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif /* __MPLS_SDK_MAJOR < 1050 */
</span> int dirfd(DIR *dirp)
{
if (dirp == NULL || dirp->__dd_fd < 0)
</pre><pre style='margin:0'>
</pre>