Closed emoon closed 2 years ago
Thanks for the report. Do you know what I should use to check for this at compile time so it works on both older and newer versions of the compiler?
Hey,
So I'm not really sure but I found this post https://developer.apple.com/forums/thread/109760?answerId=696147022#696147022 which states
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 120000
// ... compiles only when using the macOS12.0 SDK (or later) that comes with Xcode 13.1
#endif
So maybe that can be used to detect which version of the SDK that is being compiled against.
Edit: I asked around and got a reply about this
The downside with such code, generally, is you have to write both compile time and runtime check nested I think;
thus nonzero runtime overhead (since building against 11 SDK implies deployment target <= 11, so you cannot assume 12+)
So tbh, I'm not sure what the best way to solve this is (unless requiring users to use an older SDK, but I would assume more people would run into this later on)
This workaround with __is_identifier, as qemu has done, looks safe to me.
https://lists.gnu.org/archive/html/qemu-devel/2022-01/msg02375.html
fwiw, here's where the damage was done: https://www.mail-archive.com/qemu-devel@nongnu.org/msg860665.html
The pattern I'd suggest is test for the Main identifier, if not found test for the Master identifier, if not compile time assert.
and docs on __is_identifier: https://github.com/intel/llvm/blob/sycl/clang/docs/LanguageExtensions.rst#__is_identifier
This avoids needing to check OS versions. Don't know if this code has to compile under gcc, and if there's a similar affordance in gcc.
This should be fixed thanks to this PR: https://github.com/mackron/miniaudio/pull/519
Hi,
First thanks for a great lib! When building for macOS I get the following warnings: I have Xcode 13.3 installed and my OS version is 12.3.1