summaryrefslogtreecommitdiff
path: root/src/porting.h
diff options
context:
space:
mode:
authorWeblate <42@minetest.ru>2013-02-02 21:34:12 +0400
committerWeblate <42@minetest.ru>2013-02-02 21:34:12 +0400
commit1d248cce30105a66a411d327b5400f37a35db3b9 (patch)
treee489f681757416b8b9ab3c965689fb50a5a73d9c /src/porting.h
parentc33654c21ab13b072baadc65a72d31ae839ceec8 (diff)
parent6424c5b69809ad4799c08e93dd8cbdb13547da1c (diff)
downloadminetest-1d248cce30105a66a411d327b5400f37a35db3b9.tar.gz
minetest-1d248cce30105a66a411d327b5400f37a35db3b9.tar.bz2
minetest-1d248cce30105a66a411d327b5400f37a35db3b9.zip
Merge remote branch 'origin/master'
Diffstat (limited to 'src/porting.h')
-rw-r--r--src/porting.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/porting.h b/src/porting.h
index 184e1ab54..c8d19154c 100644
--- a/src/porting.h
+++ b/src/porting.h
@@ -42,18 +42,26 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#ifdef _WIN32
#include <windows.h>
- #define ALIGNOF(x) __alignof(x)
#define sleep_ms(x) Sleep(x)
+#else
+ #include <unistd.h>
+ #include <stdint.h> //for uintptr_t
+
+ #define sleep_ms(x) usleep(x*1000)
+#endif
+
+#ifdef _MSC_VER
+ #define ALIGNOF(x) __alignof(x)
#define strtok_r(x, y, z) strtok_s(x, y, z)
#define strtof(x, y) (float)strtod(x, y)
#define strtoll(x, y, z) _strtoi64(x, y, z)
#define strtoull(x, y, z) _strtoui64(x, y, z)
#else
- #include <unistd.h>
- #include <stdint.h> //for uintptr_t
-
#define ALIGNOF(x) __alignof__(x)
- #define sleep_ms(x) usleep(x*1000)
+#endif
+
+#ifdef __MINGW32__
+ #define strtok_r(x, y, z) mystrtok_r(x, y, z)
#endif
#define PADDING(x, y) ((ALIGNOF(y) - ((uintptr_t)(x) & (ALIGNOF(y) - 1))) & (ALIGNOF(y) - 1))