summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcodemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-28 04:52:54 +0000
committercodemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-28 04:52:54 +0000
commitd105f239f4dd8c4a11e1796f6b7562d7b0216103 (patch)
treea9478c7134d77288179d2807588ef969e20c6d9f /src
parentcd7a045dc8430e13bfd6133800f21722b15a44f8 (diff)
downloadhercules-d105f239f4dd8c4a11e1796f6b7562d7b0216103.tar.gz
hercules-d105f239f4dd8c4a11e1796f6b7562d7b0216103.tar.bz2
hercules-d105f239f4dd8c4a11e1796f6b7562d7b0216103.tar.xz
hercules-d105f239f4dd8c4a11e1796f6b7562d7b0216103.zip
- Added a cure for gettimeofday() for Win32
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@398 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/ladmin/ladmin.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/src/ladmin/ladmin.c b/src/ladmin/ladmin.c
index 497f3bdab..c8b0d60f0 100644
--- a/src/ladmin/ladmin.c
+++ b/src/ladmin/ladmin.c
@@ -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"