Translated using Weblate (Russian)
[oweals/minetest.git] / src / porting.h
index 0062c11f3f426b9820e59bfedc2329f1f7cd2db8..c8d19154c9c341fde8b708d4939e7c8e71f82233 100644 (file)
@@ -42,17 +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>
-       
        #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))