From d68ed8ff20b71d99234ae8615e32bd496adefe08 Mon Sep 17 00:00:00 2001 From: Martin Nilsson <nilsson@fastmail.com> Date: Thu, 10 Aug 2017 23:23:35 +0200 Subject: [PATCH] Fix compilation issue with f_gethrdtime without threads. Don't know if the result makes sense though. --- src/builtin_functions.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/builtin_functions.c b/src/builtin_functions.c index 2059da41e0..3bd150cf0f 100644 --- a/src/builtin_functions.c +++ b/src/builtin_functions.c @@ -8135,12 +8135,17 @@ PMOD_EXPORT void f_gethrtime(INT32 args) static void f_gethrdtime(INT32 args) { int nsec = args && !UNSAFE_IS_ZERO(Pike_sp-args); - cpu_time_t time = threads_disabled_acc_time; - pop_n_elems(args); - + cpu_time_t time; +#ifdef PIKE_THREADS + time = threads_disabled_acc_time; if (threads_disabled) { time += get_real_time() - threads_disabled_start; } +#else + time = get_real_time(); +#endif + pop_n_elems(args); + if (nsec) { push_int64(time); #ifndef LONG_CPU_TIME -- GitLab