diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-07-03 08:20:18 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-07-03 08:20:18 +0200 |
commit | ad1285c05bc93fe0cb9851334c5d8bd7fddf96ab (patch) | |
tree | 7f2863f4fa5764a84bafa23de7d1510a70c3a3fc /compat/sleep.hpp | |
parent | f1f0c43eeecef064719d72b398d245db12d6afe6 (diff) |
compat/sleep: don't pull windows.h into the header
Diffstat (limited to 'compat/sleep.hpp')
-rw-r--r-- | compat/sleep.hpp | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/compat/sleep.hpp b/compat/sleep.hpp index 4cd7a397..9419b36b 100644 --- a/compat/sleep.hpp +++ b/compat/sleep.hpp @@ -1,24 +1,7 @@ #pragma once -#ifdef _WIN32 -# include <windows.h> -#else -# include <unistd.h> -#endif +#include "export.hpp" -namespace portable -{ -#ifdef _WIN32 - inline void sleep(int milliseconds) - { - if (milliseconds > 0) - Sleep(milliseconds); - } -#else - inline void sleep(int milliseconds) - { - if (milliseconds > 0) - usleep(unsigned(milliseconds) * 1000U); // takes microseconds - } -#endif +namespace portable { + OTR_COMPAT_EXPORT void sleep(int milliseconds); } |