X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Fstlplus%2Fportability%2Fportability_fixes.cpp;h=32344778ff2707955162b348d906eadae7828dcd;hp=5b49e0c82002d5b0ba915d54247bc1a91d602dc4;hb=4f6e4488a55f7e3ba3f7485d78177f793c0eab9a;hpb=574af38ed616d1adfa5e6ce35f67cda1f707f89d diff --git a/src/stlplus/portability/portability_fixes.cpp b/src/stlplus/portability/portability_fixes.cpp index 5b49e0c..3234477 100644 --- a/src/stlplus/portability/portability_fixes.cpp +++ b/src/stlplus/portability/portability_fixes.cpp @@ -1,39 +1,39 @@ -//////////////////////////////////////////////////////////////////////////////// - -// Author: Andy Rushton -// Copyright: (c) Southampton University 1999-2004 -// (c) Andy Rushton 2004-2009 -// License: BSD License, see ../docs/license.html - -//////////////////////////////////////////////////////////////////////////////// -#include "portability_fixes.hpp" - -#ifdef MSWINDOWS -#include "windows.h" -#endif - -//////////////////////////////////////////////////////////////////////////////// -// problems with missing functions -//////////////////////////////////////////////////////////////////////////////// - -#ifdef MSWINDOWS -unsigned sleep(unsigned seconds) -{ - Sleep(1000*seconds); - // should return remaining time if interrupted - however Windoze Sleep cannot be interrupted - return 0; -} -#endif - -//////////////////////////////////////////////////////////////////////////////// -// Function for establishing endian-ness -//////////////////////////////////////////////////////////////////////////////// - -bool stlplus::little_endian(void) -{ - int sample = 1; - char* sample_bytes = (char*)&sample; - return sample_bytes[0] != 0; -} - -//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +// Author: Andy Rushton +// Copyright: (c) Southampton University 1999-2004 +// (c) Andy Rushton 2004 onwards +// License: BSD License, see ../docs/license.html + +//////////////////////////////////////////////////////////////////////////////// +#include "portability_fixes.hpp" + +#ifdef MSWINDOWS +#include "windows.h" +#endif + +//////////////////////////////////////////////////////////////////////////////// +// problems with missing functions +//////////////////////////////////////////////////////////////////////////////// + +#ifdef MSWINDOWS +unsigned sleep(unsigned seconds) +{ + Sleep(1000*seconds); + // should return remaining time if interrupted - however Windoze Sleep cannot be interrupted + return 0; +} +#endif + +//////////////////////////////////////////////////////////////////////////////// +// Function for establishing endian-ness +//////////////////////////////////////////////////////////////////////////////// + +bool stlplus::little_endian(void) +{ + int sample = 1; + char* sample_bytes = (char*)&sample; + return sample_bytes[0] != 0; +} + +////////////////////////////////////////////////////////////////////////////////