Main Page | Namespace List | Class Hierarchy | Data Structures | File List | Data Fields | Globals

sleep.h

Go to the documentation of this file.
00001 /*
00002  * sleep.h  1.0 02/03/10
00003  *
00004  * Defines cross-platform sleep, usleep, etc.
00005  *
00006  * By Wu Yongwei
00007  *
00008  */
00009 
00010 #ifndef _SLEEP_H
00011 #define _SLEEP_H
00012 
00013 #ifdef _WIN32
00014 # if defined(_NEED_SLEEP_ONLY) && (defined(_MSC_VER) || defined(__MINGW32__))
00015 #  include <stdlib.h>
00016 #  define sleep(t) _sleep((t) * 1000)
00017 # else
00018 #  include <windows.h>
00019 #  define sleep(t)  Sleep((t) * 1000)
00020 # endif
00021 # ifndef _NEED_SLEEP_ONLY
00022 #  define msleep(t) Sleep(t)
00023 #  define usleep(t) Sleep((t) / 1000)
00024 # endif
00025 #else
00026 # include <unistd.h>
00027 # ifndef _NEED_SLEEP_ONLY
00028 #  define msleep(t) usleep((t) * 1000)
00029 # endif
00030 #endif
00031 
00032 #endif /* _SLEEP_H */

Generated on Wed Jun 23 18:47:21 2004 for cZUI by doxygen 1.3.5