diff options
Diffstat (limited to 'compatbits.c')
| -rw-r--r-- | compatbits.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/compatbits.c b/compatbits.c index f93b2e5..a6ce8f5 100644 --- a/compatbits.c +++ b/compatbits.c @@ -25,6 +25,8 @@ Stuff to make compiling on WINDOWS and LINUX easier #ifdef WIN32
+#include <windows.h>
+
typedef unsigned int uint32_t;
#define pthread_t uint32_t
@@ -41,6 +43,7 @@ int pthread_equal(pthread_t T1, pthread_t T2) #include <syslog.h>
#include <stdarg.h>
#include <unistd.h>
+#include <stdint.h>
#define BOOL int
@@ -188,3 +191,27 @@ void closesocket(int sock) }
#endif
+
+#ifdef WIN32
+
+uint32_t GetTickCountINP3()
+{
+ // Returns system uptime in 10 mS, lower 20 bits only
+
+ return (GetTickCount() / 10) & 0xfffff;
+}
+#else
+
+uint64_t GetTickCount();
+
+uint32_t GetTickCountINP3()
+{
+ uint64_t Ticks = GetTickCount();
+
+ // Returns system uptime in 10 mS, lower 20 bits only
+
+ return (Ticks / 10) & 0xfffff;
+}
+
+#endif
+
|
