Moved idris_usleep to idris_stdfgn

This commit is contained in:
Jonas Claeson 2020-01-21 08:54:25 +01:00
parent 0fd2dab506
commit 33be12cabe
4 changed files with 13 additions and 14 deletions

View File

@ -1158,16 +1158,6 @@ void idris_disableBuffering(void) {
setvbuf(stdout, NULL, _IONBF, 0);
}
#ifndef SEL4
int idris_usleep(int usec) {
struct timespec t;
t.tv_sec = usec / 1000000;
t.tv_nsec = (usec % 1000000) * 1000;
return nanosleep(&t, NULL);
}
#endif // SEL4
void stackOverflow(void) {
fprintf(stderr, "Stack overflow");
exit(-1);

View File

@ -507,10 +507,6 @@ const char *idris_getArg(int i);
// disable stdin/stdout buffering
void idris_disableBuffering(void);
#ifndef SEL4
int idris_usleep(int usec);
#endif // SEL4
// Handle stack overflow.
// Just reports an error and exits.

View File

@ -228,6 +228,16 @@ VAL idris_clock(VM* vm) {
return result;
}
#ifndef SEL4
int idris_usleep(int usec) {
struct timespec t;
t.tv_sec = usec / 1000000;
t.tv_nsec = (usec % 1000000) * 1000;
return nanosleep(&t, NULL);
}
#endif // SEL4
VAL idris_mkFileError(VM* vm) {
VAL result;
switch(errno) {

View File

@ -54,6 +54,9 @@ char* getEnvPair(int i);
VAL idris_time();
VAL idris_clock(VM* vm);
#ifndef SEL4
int idris_usleep(int usec);
#endif // SEL4
void idris_forceGC();