Skip to content

Commit

Permalink
Added architectures
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderOMara committed Jan 19, 2025
1 parent d6ad0d3 commit e9b435f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions macho/universal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,29 @@ export class Universal {
}
}

/**
* Get set of architectures.
*
* @param archs Set of architectures to populate into.
*/
public architectures(archs: Set<Architecture>): void {
if (this.isUniversal()) {
const mArchList = this.mArchList!;
for (let i = 0; i < this.mArchCount; i++) {
const arch = mArchList[i];
archs.add(new Architecture(arch.cputype, arch.cpusubtype));
}
} else {
const mThinArch = this.mThinArch!;
archs.add(
new Architecture(
mThinArch.cpuType(),
mThinArch.cpuSubtypeFull(),
),
);
}
}

/**
* Is a universal binary.
*
Expand Down

0 comments on commit e9b435f

Please sign in to comment.