I'm compiling some simple code:
import std.c.time;
.
.
.
timespec zero;
nanosleep(&zero, null);
.
.
.
What I get is:
Error: undefined identifier timespec
Error: undefined identifier nanosleep
std.c.time is merely a shortcut to C's time.h.
If I call other functions defined in time.h, say clock(), it's Ok.
If I write analogous code in C (with nanosleep()), it's Ok.
In time.h I see that timespec and nanosleep declarations are put under some #ifdef, possibly it has something to do with my problem ?
How can I get it to compile ?
My working environment is: dmd v2.059 Ubuntu 12.04
timespec and nanosleep is mentioned exactly 0 times in the C99 standard. It's not part of standard C, can not be found in a standard time.h file and thus can not be found in std.c.time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With