summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcodemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-28 04:49:38 +0000
committercodemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-28 04:49:38 +0000
commit5350a1f37eaeb69adcf3b55c818efdb1f0076aeb (patch)
tree88850bc0c5906a2ed1d213def44e4f1e3eb8dc5c /src
parentbd6e84abfbb76a56b93597761fd5158a3aa265d5 (diff)
downloadhercules-5350a1f37eaeb69adcf3b55c818efdb1f0076aeb.tar.gz
hercules-5350a1f37eaeb69adcf3b55c818efdb1f0076aeb.tar.bz2
hercules-5350a1f37eaeb69adcf3b55c818efdb1f0076aeb.tar.xz
hercules-5350a1f37eaeb69adcf3b55c818efdb1f0076aeb.zip
- Added a cure for gettimeofday() for Win32
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@396 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/login/login.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/login/login.c b/src/login/login.c
index 8d7ce12a2..e55e9e3c5 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -2,20 +2,35 @@
// new version of the login-server by [Yor]
#include <sys/types.h>
+#ifdef WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <winsock2.h>
+#include <time.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>
-#include <time.h>
#include <sys/ioctl.h>
-#include <sys/stat.h> // for stat/lstat/fstat
#include <unistd.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <sys/stat.h> // for stat/lstat/fstat
#include <signal.h>
#include <fcntl.h>
#include <string.h>
-#include <arpa/inet.h>
-#include <netdb.h>
#include <stdarg.h>
#include "../common/core.h"