DaemonEngine / crunch

Advanced DXTc texture compression and transcoding library and tool, upgraded with Unity improvements, added features, extended system and hardware support, deeply tested.
https://github.com/DaemonEngine/crunch
Other
16 stars 6 forks source link

crnlib: do not call `sem_destroy` on macOS #55

Closed illwieckz closed 5 months ago

illwieckz commented 5 months ago

On macOS, sem_unlink should be used instead of sem_destroy, what the current code does is to call sem_destroy on every pthread-compatible system and then call sem_unlink on macOS.

It is expected the only macOS implementation of it and other functions like sem_init is to do nothing but to exist and be marked as deprecated so the compiler can print warnings as the -Wdeprecated-declarations flag is enabled by default.

Because sem_destroy is expected to be a stub on macOS and we call sem_unlink anyway, the current code works but raises a “'sem_destroy' is deprecated” warning at build time for something we don't need and we already have the right implementation done anyway.