summaryrefslogtreecommitdiff
path: root/compatbits.c
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2025-11-22 15:09:21 +0000
committerDave Hibberd <hibby@debian.org>2025-11-22 15:09:21 +0000
commit52e35f45b4cfefc21707b42883dd1afa142ac7d4 (patch)
tree0a9b58677b2f8dad558593277a547b17c38af976 /compatbits.c
parent453f162d225b192d5da5a843633208f0307e6afc (diff)
New upstream version 6.0.25.12+repack
Diffstat (limited to 'compatbits.c')
-rw-r--r--compatbits.c27
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
+