Ignore some of the includes. Commented out code. Only calculate offsets if __OBJC2__ is defined.

This commit is contained in:
Thomas A 2022-04-29 23:39:13 -07:00
parent 9ded2a81c0
commit 3195667efc
2 changed files with 6 additions and 2 deletions

View File

@ -83,7 +83,7 @@
#include "objc-private.h"
#if TARGET_OS_OSX
#if TARGET_OS_OSX && !defined(DARLING)
#include <Cambria/Traps.h>
#include <Cambria/Cambria.h>
#endif
@ -1117,7 +1117,7 @@ static int _collecting_in_critical(void)
continue;
// Find out where thread is executing
#if TARGET_OS_OSX
#if TARGET_OS_OSX && !defined(DARLING)
if (oah_is_current_process_translated()) {
kern_return_t ret = objc_thread_get_rip(threads[count], (uint64_t*)&pc);
if (ret != KERN_SUCCESS) {

View File

@ -28,7 +28,9 @@
#include "objc-private.h"
#include "objc-loadmethod.h"
#ifndef DARLING
#include "objc-bp-assist.h"
#endif
#if TARGET_OS_WIN32
@ -661,11 +663,13 @@ static void static_init()
for (size_t i = 0; i < count; i++) {
inits[i]();
}
#if __OBJC2__
auto offsets = getLibobjcInitializerOffsets(&_mh_dylib_header, &count);
for (size_t i = 0; i < count; i++) {
UnsignedInitializer init(offsets[i]);
init();
}
#endif
}