Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1301 for code/trunk


Ignore:
Timestamp:
May 15, 2008, 10:10:11 PM (17 years ago)
Author:
rgrieder
Message:
  • see previous message- changed sleep macros to inline functions (caused problem when declaring a function sleep(…) like in boost thread..)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/util/Sleep.h

    r1062 r1301  
    3535
    3636#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32
     37#  ifndef WIN32_LEAN_AND_MEAN
     38#    define WIN32_LEAN_AND_MEAN
     39#  endif
    3740#  include <windows.h>
    38 #  define usleep(x) Sleep((x) / 1000)
    39 #  define msleep(x) Sleep(x)
    40 #  define  sleep(x) Sleep((x) * 1000)
     41inline void usleep(DWORD dwMicroseconds)
     42{
     43  Sleep(dwMicroseconds / 1000);
     44}
     45inline void msleep(DWORD dwMilliseconds)
     46{
     47  Sleep(dwMilliseconds);
     48}
     49inline void sleep(DWORD dwSeconds)
     50{
     51  Sleep(dwSeconds * 1000);
     52}
    4153#else
    4254#  include <unistd.h>
    43 #  define msleep(x) uleep((x) * 1000)
     55inline void msleep(unsigned long msec)
     56{
     57  usleep(msec * 1000);
     58}
    4459#endif
Note: See TracChangeset for help on using the changeset viewer.