# macos: add fallback version detection · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/3df0a3a528ad28dc1ff0c79e2c9860515f5c5826)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 3df0a3a528ad28dc1ff0c79e2c9860515f5c5826

Requested commit: 3df0a3a528ad28dc1ff0c79e2c9860515f5c5826

Commit: 3df0a3a528ad28dc1ff0c79e2c9860515f5c5826

Tree: dd606a6f116e52f77c39b414636e017586f84310

Author: Michael Dusan

Committer: Michael Dusan

## Message

```
macos: add fallback version detection

Fallback to sysctl `kern.osversion` when `kern.osproductversion` is not
available (prior to 10.13.4) .

The mapping from `sw_vers -buildVersion` to `-productVersion` is
formulaic from 10.8 to 10.15 and older is handled with switch.

closes #5119

```

## Parents

- [aca6b7018443bfc012f39be486f848d6e62c532c](https://git.cafe/gitcafe/zig/commit/aca6b7018443bfc012f39be486f848d6e62c532c?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/3df0a3a528ad28dc1ff0c79e2c9860515f5c5826?format=markdown)
