mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-22 20:28:42 -05:00
7369062c4a
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2635 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
33 lines
599 B
C
33 lines
599 B
C
/*
|
|
* sleep.h 1.0 02/03/10
|
|
*
|
|
* Defines cross-platform sleep, usleep, etc.
|
|
*
|
|
* By Wu Yongwei
|
|
*
|
|
*/
|
|
|
|
#ifndef _SLEEP_H
|
|
#define _SLEEP_H
|
|
|
|
#ifdef _WIN32
|
|
# if defined(_NEED_SLEEP_ONLY) && (defined(_MSC_VER) || defined(__MINGW32__))
|
|
# include <stdlib.h>
|
|
# define sleep(t) _sleep((t) * 1000)
|
|
# else
|
|
# include <windows.h>
|
|
# define sleep(t) Sleep((t) * 1000)
|
|
# endif
|
|
# ifndef _NEED_SLEEP_ONLY
|
|
# define msleep(t) Sleep(t)
|
|
# define usleep(t) Sleep((t) / 1000)
|
|
# endif
|
|
#else
|
|
# include <unistd.h>
|
|
# ifndef _NEED_SLEEP_ONLY
|
|
# define msleep(t) usleep((t) * 1000)
|
|
# endif
|
|
#endif
|
|
|
|
#endif /* _SLEEP_H */
|