Skip to content

Commit 56d19e7

Browse files
authored
Merge pull request #2193 from apple/🍒/bastille/c722096b399695e89f283f0847474ccb038515f2
[debugserver] Remove bridgeos availability
2 parents b66205e + 8660205 commit 56d19e7

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

‎lldb/tools/debugserver/source/MacOSX/MachProcess.mm

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3261,10 +3261,14 @@ static bool FBSAddEventDataToOptions(NSMutableDictionary *options,
32613261
bool slice_preference_set = false;
32623262

32633263
if (cpu_subtype != 0) {
3264-
if (@available(macOS 10.16, ios 10.14, watchos 7.0, tvos 14.0,
3265-
bridgeos 5.0, *)) {
3266-
err.SetError(posix_spawnattr_setarchpref_np(&attr, 1, &cpu_type,
3267-
&cpu_subtype, &ocount));
3264+
typedef int (*posix_spawnattr_setarchpref_np_t)(
3265+
posix_spawnattr_t *, size_t, cpu_type_t *, cpu_subtype_t *, size_t *);
3266+
posix_spawnattr_setarchpref_np_t posix_spawnattr_setarchpref_np_fn =
3267+
(posix_spawnattr_setarchpref_np_t)dlsym(
3268+
RTLD_DEFAULT, "posix_spawnattr_setarchpref_np");
3269+
if (posix_spawnattr_setarchpref_np_fn) {
3270+
err.SetError((*posix_spawnattr_setarchpref_np_fn)(
3271+
&attr, 1, &cpu_type, &cpu_subtype, &ocount));
32683272
slice_preference_set = err.Success();
32693273
if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS))
32703274
err.LogThreaded(

0 commit comments

Comments
 (0)