add usleep() for vc++

SVN revision: 55525
This commit is contained in:
Vincent Torri 2010-12-12 22:44:06 +00:00
parent d8f05983b7
commit 562d84c432
3 changed files with 41 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2010-12-12 Vincent Torri <doursse at users dot sf dot net>
* src/lib/evil_unistd.c:
* src/lib/evil_unistd.h:
add usleep() for vc++
2010-12-10 Vincent Torri <doursse at users dot sf dot net>
reviewed by: Vincent Torri

View File

@ -78,6 +78,15 @@ evil_gettimeofday(struct timeval *tp, void *tzp __UNUSED__)
return 1;
}
#ifdef _MSC_VER
int
evil_usleep(unsigned long usec)
{
Sleep(usec / 1000);
return 0;
}
#endif
/*
* Process identifer related functions

View File

@ -62,6 +62,32 @@ EAPI int evil_gettimeofday(struct timeval * tp, void * tzp);
*/
#define gettimeofday(tp,tzp) evil_gettimeofday((tp),(tzp))
#ifdef _MSC_VER
/**
* @brief Suspend the execution of the calling process for microsecond
* intervals.
*
* @param usec The interval in microseconds.
* @return Always 0 (success).
*
* This function suspends the execution of the calling process for (at
* least) @p usec microseconds.
*
* Conformity: Not appliclable.
*
* Supported OS: Windows XP, Windows CE.
*/
EAPI int evil_usleep(unsigned long usec);
/**
* @def usleep(usec)
*
* Wrapper around evil_usleep().
*/
#define usleep(usec) evil_usleep(usec);
#endif /* _MSC_VER */
/*
* Process identifer related functions