mtime icon indicating copy to clipboard operation
mtime copied to clipboard

Haiku

Open Sylvain78 opened this issue 3 years ago • 3 comments

Condition de compilation sur Haiku (www.haiku-os.org)

Sylvain78 avatar May 07 '22 21:05 Sylvain78

I have the impression the original conditional is rather checking for the wrong thing here.

dbuenzli avatar May 07 '22 22:05 dbuenzli

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.

Sylvain78 avatar May 08 '22 19:05 Sylvain78

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 ?

dbuenzli avatar May 08 '22 19:05 dbuenzli

It "works for me" is not how we do it here. Please come back when you have an anwser to these questions.

dbuenzli avatar Dec 02 '22 08:12 dbuenzli

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

jmairboeck avatar Nov 16 '23 19:11 jmairboeck