Since I needed to detect this stuff for a project, I made a Swift package that includes your solutions and improves upon them and makes them easier to use.
It can also detect multiple architectures to have a more general usage.
https://github.com/ITzTravelInTime/SwiftCPUDetect
Here is some example usage of my package
import Foundation
import SwiftCPUDetect
print("Is my app running with Rosetta? \((AppExecutionMode.current() == .emulated) ? "Yes" : "No")")
print("My app is running using the \(CpuArchitecture.current()?.rawValue ?? "[Can't detect architecture]") architecture")
print("My computer is running using the \(CpuArchitecture.actualCurrent()?.rawValue ?? "[Can't detect architecture]") architecture")
Post
Replies
Boosts
Views
Activity
Sorry to bother you, but it still doesn't work with the xonar d2x, it gives me a kernel panic caused by a null pointer or null value, by taking a look at a mirror of your old in-dev code I see that the data structure for the d2x is not fully initialized, can this still be the case for the working driver too?
OFFTOPIC, but in that mirror repo I see you basically re-used a bunch of code from the ALSA project and you have no public source code repo on your github profile, so since ALSA is licensed under GNU GPL, and because this is a derivative work, it means you have to release the code under the GPL too, so you might have to make the source code freely available (for instance on a public git repo), or send it to everyone who asks for it, I know this is not ideal for you, (for instance with dealing with community people), but complying with the licenses is very important and must be taken extremely seriously, even if your project is just for fun or hobby I am afraid you should comply with the GNU.
Again, sorry to bother you, I have no bad intentions, just wanted to let you know about the D2X kernel panic and tell you to be careful with licenses, also keep up the good work man, this driver was quite a thing to pull off.