diff --git a/configure.ac b/configure.ac index 088128e5e74..19b20127ca2 100644 --- a/configure.ac +++ b/configure.ac @@ -3308,6 +3308,12 @@ if test x$host_win32 = xno; then dnl ****************************************** AC_CHECK_HEADERS(CommonCrypto/CommonDigest.h) + AC_CHECK_MEMBER(struct objc_super.super_class, + [AC_DEFINE(HAVE_OBJC_SUPER_SUPER_CLASS, 1, [struct objc_super.super_class])], + [], + [#include + #include ]) + dnl ********************************* dnl *** Check for Console 2.0 I/O *** dnl ********************************* diff --git a/mono/metadata/w32process-unix-osx.c b/mono/metadata/w32process-unix-osx.c index 2568a44223e..f320e270c39 100644 --- a/mono/metadata/w32process-unix-osx.c +++ b/mono/metadata/w32process-unix-osx.c @@ -183,12 +183,19 @@ mono_dyld_image_info_free (void *info) static void image_added (const struct mach_header *hdr32, intptr_t vmaddr_slide) { +#if defined(__APPLE__) && defined(__clang__) // getsectbynamefromheader functions are deprecated as of macOS 13.0 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif #if SIZEOF_VOID_P == 8 const struct mach_header_64 *hdr64 = (const struct mach_header_64 *)hdr32; const struct section_64 *sec = getsectbynamefromheader_64 (hdr64, SEG_DATA, SECT_DATA); #else const struct section *sec = getsectbynamefromheader (hdr32, SEG_DATA, SECT_DATA); #endif +#if defined(__APPLE__) && defined(__clang__) +#pragma clang diagnostic pop +#endif Dl_info dlinfo; if (!dladdr (hdr32, &dlinfo)) return; if (sec == NULL) return; diff --git a/mono/utils/mono-threads-mach-helper.c b/mono/utils/mono-threads-mach-helper.c index 7b4f140b619..0a2ff341fc4 100644 --- a/mono/utils/mono-threads-mach-helper.c +++ b/mono/utils/mono-threads-mach-helper.c @@ -59,10 +59,10 @@ mono_dead_letter_dealloc (id self, SEL _cmd) { struct objc_super super; super.receiver = self; -#if !defined(__cplusplus) && !__OBJC2__ - super.class = nsobject; -#else +#if defined(__cplusplus) || defined(HAVE_OBJC_SUPER_SUPER_CLASS) super.super_class = nsobject; +#else + super.class = nsobject; #endif void (*objc_msgSendSuper_op)(struct objc_super *, SEL) = (void (*)(struct objc_super *, SEL)) objc_msgSendSuper; objc_msgSendSuper_op (&super, dealloc);