diff options
author | codemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-11-28 04:51:01 +0000 |
---|---|---|
committer | codemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-11-28 04:51:01 +0000 |
commit | cd7a045dc8430e13bfd6133800f21722b15a44f8 (patch) | |
tree | 79f7347f0fd6eaf030c736f3e08e506bbc1dac7c /src/login_sql/login.c | |
parent | 5350a1f37eaeb69adcf3b55c818efdb1f0076aeb (diff) | |
download | hercules-cd7a045dc8430e13bfd6133800f21722b15a44f8.tar.gz hercules-cd7a045dc8430e13bfd6133800f21722b15a44f8.tar.bz2 hercules-cd7a045dc8430e13bfd6133800f21722b15a44f8.tar.xz hercules-cd7a045dc8430e13bfd6133800f21722b15a44f8.zip |
- Added a cure for gettimeofday() for Win32
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@397 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login_sql/login.c')
-rw-r--r-- | src/login_sql/login.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/login_sql/login.c b/src/login_sql/login.c index b5a8d0ec1..ba03848e8 100644 --- a/src/login_sql/login.c +++ b/src/login_sql/login.c @@ -8,25 +8,38 @@ #include <winsock.h> #pragma lib <libmysql.lib> #else +#ifdef WIN32 +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#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) +#pragma comment(lib,"libmysql.lib") +#else #include <sys/socket.h> #include <netinet/in.h> #include <sys/time.h> #include <sys/ioctl.h> #include <arpa/inet.h> +#include <unistd.h> +#endif #endif #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 <signal.h> #include <fcntl.h> #include <string.h> -#include <arpa/inet.h> //add include for DBMS(mysql) #include <mysql.h> |