Allow dynamically compiled extensions to use gettimeofday() on win32.

This commit is contained in:
Edin Kadribasic 2002-06-23 23:22:33 +00:00
parent 8a04592352
commit 2183565321
2 changed files with 5 additions and 4 deletions

View file

@ -44,7 +44,7 @@ __int64 ff;
int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info) PHPAPI int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info)
{ {
static struct timeval starttime = {0, 0}; static struct timeval starttime = {0, 0};
@ -186,7 +186,7 @@ LPTIMECALLBACK setitimer_timeout(UINT uTimerID, UINT info, DWORD dwUser, DWORD d
return 0; return 0;
} }
int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue) PHPAPI int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue)
{ {
int timeout = value->it_value.tv_sec * 1000 + value->it_value.tv_usec; int timeout = value->it_value.tv_sec * 1000 + value->it_value.tv_usec;
int repeat = TIME_ONESHOT; int repeat = TIME_ONESHOT;

View file

@ -15,6 +15,7 @@
/* Include stuff ************************************************************ */ /* Include stuff ************************************************************ */
#include <winsock.h> #include <winsock.h>
#include <time.h> #include <time.h>
#include <php.h>
/* Struct stuff ************************************************************* */ /* Struct stuff ************************************************************* */
struct timezone { struct timezone {
@ -34,10 +35,10 @@ struct itimerval {
#define ITIMER_PROF 2 /*generates sigprof */ #define ITIMER_PROF 2 /*generates sigprof */
/* Prototype stuff ********************************************************** */ /* Prototype stuff ********************************************************** */
extern int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info); PHPAPI extern int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info);
/* setitimer operates at 100 millisecond resolution */ /* setitimer operates at 100 millisecond resolution */
extern int setitimer(int which, const struct itimerval *value, PHPAPI extern int setitimer(int which, const struct itimerval *value,
struct itimerval *ovalue); struct itimerval *ovalue);
#endif #endif