WSJT-X/map65/libm65/sleep.h
Bill Somerville 280c8344cd
Move project files to map65 sub-directory
Preparation for merging with the wsjtx project repository.
2021-04-09 13:57:41 +01:00

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 */