Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Feb 26, 2024
1 parent 678fa46 commit 4f019cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions gum/backend-linux/gumprocess-linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@
#ifdef HAVE_SYS_USER_H
# include <sys/user.h>
#endif
#ifdef HAVE_LINUX
#include <sys/time.h>
#include <sys/resource.h>
#endif

#define GUM_PAGE_START(value, page_size) \
(GUM_ADDRESS (value) & ~GUM_ADDRESS (page_size - 1))
Expand Down Expand Up @@ -90,6 +89,9 @@
#ifndef NT_PRSTATUS
# define NT_PRSTATUS 1
#endif
#ifndef RUSAGE_THREAD
# define RUSAGE_THREAD 1
#endif

#define GUM_TEMP_FAILURE_RETRY(expression) \
({ \
Expand Down
4 changes: 2 additions & 2 deletions gum/backend-windows/gumprocess-windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 4f019cc

Please sign in to comment.