summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2010-12-12 22:44:06 +0000
committerVincent Torri <vincent.torri@gmail.com>2010-12-12 22:44:06 +0000
commit562d84c4320d80b0f06e2fd788cfd30bf0f1138c (patch)
tree4c9700f79d2b3a14d761ec1068ae3b45a6f69b1b /legacy
parentd8f05983b71ed7aafae7df80c829099aa7c3b270 (diff)
add usleep() for vc++
SVN revision: 55525
Diffstat (limited to 'legacy')
-rw-r--r--legacy/evil/ChangeLog6
-rw-r--r--legacy/evil/src/lib/evil_unistd.c9
-rw-r--r--legacy/evil/src/lib/evil_unistd.h26
3 files changed, 41 insertions, 0 deletions
diff --git a/legacy/evil/ChangeLog b/legacy/evil/ChangeLog
index b883e2911e..a4176f80bf 100644
--- a/legacy/evil/ChangeLog
+++ b/legacy/evil/ChangeLog
@@ -1,3 +1,9 @@
12010-12-12 Vincent Torri <doursse at users dot sf dot net>
2
3 * src/lib/evil_unistd.c:
4 * src/lib/evil_unistd.h:
5 add usleep() for vc++
6
12010-12-10 Vincent Torri <doursse at users dot sf dot net> 72010-12-10 Vincent Torri <doursse at users dot sf dot net>
2 8
3 reviewed by: Vincent Torri 9 reviewed by: Vincent Torri
diff --git a/legacy/evil/src/lib/evil_unistd.c b/legacy/evil/src/lib/evil_unistd.c
index 897c86abab..dce441ce28 100644
--- a/legacy/evil/src/lib/evil_unistd.c
+++ b/legacy/evil/src/lib/evil_unistd.c
@@ -78,6 +78,15 @@ evil_gettimeofday(struct timeval *tp, void *tzp __UNUSED__)
78 return 1; 78 return 1;
79} 79}
80 80
81#ifdef _MSC_VER
82int
83evil_usleep(unsigned long usec)
84{
85 Sleep(usec / 1000);
86 return 0;
87}
88#endif
89
81 90
82/* 91/*
83 * Process identifer related functions 92 * Process identifer related functions
diff --git a/legacy/evil/src/lib/evil_unistd.h b/legacy/evil/src/lib/evil_unistd.h
index cdb4c3122b..b9ad67e8a6 100644
--- a/legacy/evil/src/lib/evil_unistd.h
+++ b/legacy/evil/src/lib/evil_unistd.h
@@ -62,6 +62,32 @@ EAPI int evil_gettimeofday(struct timeval * tp, void * tzp);
62 */ 62 */
63#define gettimeofday(tp,tzp) evil_gettimeofday((tp),(tzp)) 63#define gettimeofday(tp,tzp) evil_gettimeofday((tp),(tzp))
64 64
65#ifdef _MSC_VER
66
67/**
68 * @brief Suspend the execution of the calling process for microsecond
69 * intervals.
70 *
71 * @param usec The interval in microseconds.
72 * @return Always 0 (success).
73 *
74 * This function suspends the execution of the calling process for (at
75 * least) @p usec microseconds.
76 *
77 * Conformity: Not appliclable.
78 *
79 * Supported OS: Windows XP, Windows CE.
80 */
81EAPI int evil_usleep(unsigned long usec);
82
83/**
84 * @def usleep(usec)
85 *
86 * Wrapper around evil_usleep().
87 */
88#define usleep(usec) evil_usleep(usec);
89
90#endif /* _MSC_VER */
65 91
66/* 92/*
67 * Process identifer related functions 93 * Process identifer related functions