]> granicus.if.org Git - php/commitdiff
Fix build for new usleep implementation.
authorWez Furlong <wez@php.net>
Sat, 29 Nov 2003 22:59:33 +0000 (22:59 +0000)
committerWez Furlong <wez@php.net>
Sat, 29 Nov 2003 22:59:33 +0000 (22:59 +0000)
NB: we now depend on windows 98 and later;
windows 95 does not have these timing functions.

win32/time.c

index f77dfd2ff8f52914b3a6496d46266f34028c9de4..7edc2a5d3af95f02b4e21df4ea348028b06abac3 100644 (file)
 
 /* Include stuff ************************************************************ */
 
+/* this allows the use of the WaitableTimer functions.
+ * For win98 and later */
+#define _WIN32_WINNT 0x400
+
 #include "time.h"
 #include "unistd.h"
 #include "signal.h"
+#include <windows.h>
 #include <winbase.h>
 #include <mmsystem.h>
 #include <errno.h>
@@ -131,7 +136,7 @@ void usleep(unsigned int useconds)
        HANDLE timer;
        LARGE_INTEGER due;
 
-       due.QuadPart = -useconds * 1000;
+       due.QuadPart = -1000 * useconds;
        timer = CreateWaitableTimer(NULL, TRUE, NULL);
 
        SetWaitableTimer(timer, &due, 0, NULL, NULL, 0);