Add toggle for (un)named semaphores and prevent linux header inclusion on non-linux paltforms
#986
Merged
AGraber
merged 2 commits from nx-upstream
into master
4 years ago
Loading…
Reference in New Issue
There is no content yet.
Delete Branch 'nx-upstream'
Deleting a branch is permanent. It CANNOT be undone. Continue?
This adds a compile-time define that decides whether unnamed or named semaphores are used, since some platforms may not support one or the other.
Also prevents a Linux header from being included if we're not building for Linux.
This originally was a PR for the Nintendo Switch port but it's going to take a while, so let's just merge the 2 commits that are ready for now.
Original PR contents (for archival purposes):
This PR will bring Nintendo Switch fork loosely based on the old fork I did a couple months ago.
macrofunction (named semaphore returns ENOSYS which means not implemented on the Switch)DIGITALRATE
macro for the Switch (on the old fork any value other than 48000 seems to crash)realpath
which is apparently missing from the Switch's toolchain (?)Switch stuff on mainglfw seems to handle this for us so no need to do that like on the old forkOptional but nice-to-haves:
Regarding
pthread_kill
usage: I think we should be able to replace it withpthread_cancel
without issues, that way we can also get rid of#include <sys/syscall.h>
. Thoughts?syscall.h header was actually used for some stuff under a
#ifdef __linux__
, so I'll do the same for the inclusionUndid pthread_kill -> pthread_cancel replacement for now, after some investigation I found out the Switch can't even kill threads, this will be checked later.
I also had that issue on the Wii U port.
Loading the function pointers using
alGetProcAddress
instead of linking against them fixes it.Since commit
5a1ea7bcf5
they also don't collide anymore.