- Added a cure for gettimeofday() for Win32

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@398 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
codemaster 2004-11-28 04:52:54 +00:00
parent 3e591e6634
commit 6caf81a158

View File

@ -6,27 +6,41 @@
///////////////////////////////////////////////////////////////////////////
#include <sys/types.h>
#include <time.h>
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
void Gettimeofday(struct timeval *timenow)
{
time_t t;
t = clock();
timenow->tv_usec = t;
timenow->tv_sec = t / CLK_TCK;
return;
}
#define gettimeofday(timenow, dummy) Gettimeofday(timenow)
#else
#include <sys/socket.h>
#include <stdio.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <sys/time.h> // gettimeofday
#include <time.h>
#include <sys/ioctl.h>
#include <unistd.h> // close
#include <arpa/inet.h> // inet_addr
#include <netdb.h> // gethostbyname
#endif
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <fcntl.h>
#include <string.h> // str*
#include <arpa/inet.h> // inet_addr
#include <netdb.h> // gethostbyname
#include <stdarg.h> // valist
#include <ctype.h> // tolower
#include "core.h"
#include "socket.h"
#include "../common/core.h"
#include "../common/socket.h"
#include "ladmin.h"
#include "version.h"
#include "mmo.h"
#include "../common/version.h"
#include "../common/mmo.h"
#ifdef PASSWORDENC
#include "md5calc.h"