From 88f98068809dd55c78becb73890ec865d745394c Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 26 Feb 2024 14:00:20 +0000 Subject: [PATCH] Fixes --- gum/backend-linux/gumprocess-linux.c | 6 ++++-- gum/backend-windows/gumprocess-windows.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gum/backend-linux/gumprocess-linux.c b/gum/backend-linux/gumprocess-linux.c index 7b1cd7b4f..d2fb39892 100644 --- a/gum/backend-linux/gumprocess-linux.c +++ b/gum/backend-linux/gumprocess-linux.c @@ -48,9 +48,8 @@ #ifdef HAVE_SYS_USER_H # include #endif -#ifdef HAVE_LINUX +#include #include -#endif #define GUM_PAGE_START(value, page_size) \ (GUM_ADDRESS (value) & ~GUM_ADDRESS (page_size - 1)) @@ -90,6 +89,9 @@ #ifndef NT_PRSTATUS # define NT_PRSTATUS 1 #endif +#ifndef RUSAGE_THREAD +# define RUSAGE_THREAD +#endif #define GUM_TEMP_FAILURE_RETRY(expression) \ ({ \ diff --git a/gum/backend-windows/gumprocess-windows.c b/gum/backend-windows/gumprocess-windows.c index a4197ef4d..c5d926c33 100644 --- a/gum/backend-windows/gumprocess-windows.c +++ b/gum/backend-windows/gumprocess-windows.c @@ -643,7 +643,7 @@ gum_thread_resume (GumThreadId thread_id, guint64 gum_thead_get_user_time (void) { - static gboolean initialized = false; + static gboolean initialized = FALSE; static GetThreadTimesFunc get_thread_times = NULL; HMODULE mod; @@ -668,7 +668,7 @@ gum_thead_get_user_time (void) if (!get_thread_times (GetCurrentThread (), NULL, NULL, NULL, &userTime)) return 0; - result = ((guint64) userTime.dwHighDateTime) << 32 + userTime.dwLowDateTime; + result = (((guint64) userTime.dwHighDateTime) << 32) + userTime.dwLowDateTime; /* Timings on Windows are to 100-nanosecond granularity. Convert to u-secs */ return result / 10;