Haiku
Condition de compilation sur Haiku (www.haiku-os.org)
I have the impression the original conditional is rather checking for the wrong thing here.
I have the impression the original conditional is rather checking for the wrong thing here.
I can't say, you wrote the code. Anyway this simple check that i added, it worked for me.
Anyway this simple check that i added, it worked for me.
Cool that it works for you. Meanwhile I have to maintain this code and I certainly do not want to add a check for every OS there, if only because I have used such checks in quite a few other packages.
There's likely a way to detect this in a standard way.
According to POSIX unistd.h declares _POSIX_TIMER when the needed functions are available. Now the only issue is to find out if I can include unistd.h, maybe checking for __unix__ is not exactly right.
Do you have a link to the documentation of the macros defined on your system ?
It "works for me" is not how we do it here. Please come back when you have an anwser to these questions.
There's likely a way to detect this in a standard way.
Since C23 (and C++17) there is __has_include: https://en.cppreference.com/w/c/preprocessor/include