]> Dogcows Code - chaz/yoink/blob - src/stlplus/portability/portability_fixes.cpp
import stlplus 3.7
[chaz/yoink] / src / stlplus / portability / portability_fixes.cpp
1 ////////////////////////////////////////////////////////////////////////////////
2
3 // Author: Andy Rushton
4 // Copyright: (c) Southampton University 1999-2004
5 // (c) Andy Rushton 2004 onwards
6 // License: BSD License, see ../docs/license.html
7
8 ////////////////////////////////////////////////////////////////////////////////
9 #include "portability_fixes.hpp"
10
11 #ifdef MSWINDOWS
12 #include "windows.h"
13 #endif
14
15 ////////////////////////////////////////////////////////////////////////////////
16 // problems with missing functions
17 ////////////////////////////////////////////////////////////////////////////////
18
19 #ifdef MSWINDOWS
20 unsigned sleep(unsigned seconds)
21 {
22 Sleep(1000*seconds);
23 // should return remaining time if interrupted - however Windoze Sleep cannot be interrupted
24 return 0;
25 }
26 #endif
27
28 ////////////////////////////////////////////////////////////////////////////////
29 // Function for establishing endian-ness
30 ////////////////////////////////////////////////////////////////////////////////
31
32 bool stlplus::little_endian(void)
33 {
34 int sample = 1;
35 char* sample_bytes = (char*)&sample;
36 return sample_bytes[0] != 0;
37 }
38
39 ////////////////////////////////////////////////////////////////////////////////
This page took 0.031301 seconds and 4 git commands to generate.