diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-02-11 22:34:34 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-02-11 22:34:34 +0200 |
commit | cabe6f1d65a84a6f047553eb5d859f407bff6a70 (patch) | |
tree | b70aaf5b3937dea408aea5c7481c90481eefbe03 | |
parent | dad2455a032d6b3911cd650429f9c0c4c1642cc0 (diff) | |
download | minetest-cabe6f1d65a84a6f047553eb5d859f407bff6a70.tar.gz minetest-cabe6f1d65a84a6f047553eb5d859f407bff6a70.tar.bz2 minetest-cabe6f1d65a84a6f047553eb5d859f407bff6a70.zip |
some fixes to make compiling on some bsd easier
-rw-r--r-- | src/map.h | 1 | ||||
-rw-r--r-- | src/porting.h | 11 | ||||
-rw-r--r-- | src/socket.h | 1 |
3 files changed, 10 insertions, 3 deletions
@@ -23,7 +23,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include <jmutex.h> #include <jthread.h> #include <iostream> -#include <malloc.h> #ifdef _WIN32 #include <windows.h> diff --git a/src/porting.h b/src/porting.h index 441a57d77..3133fcc80 100644 --- a/src/porting.h +++ b/src/porting.h @@ -86,13 +86,20 @@ void initializePaths(); return GetTickCount(); } #else // Posix - #include <sys/timeb.h> + #include <sys/time.h> + inline u32 getTimeMs() + { + struct timeval tv; + gettimeofday(&tv, NULL); + return tv.tv_sec * 1000 + tv.tv_usec / 1000; + } + /*#include <sys/timeb.h> 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 6b7a2462e..c2b496e9e 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 <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <fcntl.h> |