diff options
author | dos-reis <gdr@axiomatics.org> | 2008-09-09 05:24:24 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2008-09-09 05:24:24 +0000 |
commit | c6dc46b33cae5230dcbdf024da95532ea0cd1891 (patch) | |
tree | bec45d8eafffbf2c1ff769bfed962bf1f86b4567 /src/include | |
parent | c0f80aca887462749a7cdc4fcacc579ee59aa850 (diff) | |
download | open-axiom-c6dc46b33cae5230dcbdf024da95532ea0cd1891.tar.gz |
* lib/sockio-c.c (openaxiom_sleep): Move to open-axiom.h.
* clef/edible.c: Include "open-axiom.h". Use openaxiom_sleep, not
sleep.
* graph/view2D/viewport2D.c: Likewise.
* graph/viewAlone/spoon2D.c: Likewise.
* graph/viewAlone/spoonComp.c: Likewise.
* graph/viewman/fun2D.c: Likewise.
* graph/viewman/fun3D.c: Likewise.
* hyper/spadint.c: Likewise.
* sman/session.c: Likewise.
* sman/sman.c: Likewise.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/open-axiom.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/include/open-axiom.h b/src/include/open-axiom.h index 391e12e3..19cbfedf 100644 --- a/src/include/open-axiom.h +++ b/src/include/open-axiom.h @@ -63,6 +63,8 @@ typedef HANDLE openaxiom_handle; typedef void* openaxiom_handle; #endif +#include <unistd.h> + /* Do we have graphics support? */ #ifdef X_DISPLAY_MISSING # define OPENAXIOM_HAVE_GRAPHICS 0 @@ -76,5 +78,20 @@ typedef void* openaxiom_handle; #define oa_buffer_address(BUF) ((openaxiom_byte*)&BUF[0]) +/* The function sleep() is not available under Windows. Instead, they + have Sleep(); with capital S, please. Furthermore, it does not + take argument in second, but in milliseconds, three order + of magnitude of difference when compared to the Unix world. + We abstract over that difference here. */ + +static inline void +openaxiom_sleep(int n) +{ +#ifdef __WIN32__ + Sleep(n * 1000); +#else + sleep(n); +#endif +} #endif /* OPENAXIOM_included */ |