From: Perttu Ahola Date: Fri, 11 Feb 2011 20:34:34 +0000 (+0200) Subject: some fixes to make compiling on some bsd easier X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=cabe6f1d65a84a6f047553eb5d859f407bff6a70;p=zefram%2Fminetest%2Fminetest_engine.git some fixes to make compiling on some bsd easier --- diff --git a/src/map.h b/src/map.h index e93ba2cd..60cfd698 100644 --- a/src/map.h +++ b/src/map.h @@ -23,7 +23,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include #include -#include #ifdef _WIN32 #include diff --git a/src/porting.h b/src/porting.h index 441a57d7..3133fcc8 100644 --- a/src/porting.h +++ b/src/porting.h @@ -86,13 +86,20 @@ void initializePaths(); return GetTickCount(); } #else // Posix - #include + #include + inline u32 getTimeMs() + { + struct timeval tv; + gettimeofday(&tv, NULL); + return tv.tv_sec * 1000 + tv.tv_usec / 1000; + } + /*#include inline u32 getTimeMs() { struct timeb tb; ftime(&tb); return tb.time * 1000 + tb.millitm; - } + }*/ #endif } // namespace porting diff --git a/src/socket.h b/src/socket.h index 6b7a2462..c2b496e9 100644 --- a/src/socket.h +++ b/src/socket.h @@ -35,6 +35,7 @@ with this program; if not, write to the Free Software Foundation, Inc., typedef SOCKET socket_t; typedef int socklen_t; #else + #include #include #include #include