From c6145a23029bdd56b7b4df6864ced87df08e0744 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Thu, 31 Dec 2020 18:15:27 +0000 Subject: [PATCH] fixed an issue with an old compiler --- lib/obj.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/obj.c b/lib/obj.c index 941b51e..1c9bd93 100644 --- a/lib/obj.c +++ b/lib/obj.c @@ -37,14 +37,16 @@ void* hcl_allocbytes (hcl_t* hcl, hcl_oow_t size) hcl_gchdr_t* gch; hcl_oow_t allocsize; int gc_called = 0; +#if defined(HCL_PROFILE_VM) + struct rusage ru; + hcl_ntime_t rut; +#endif #if defined(HCL_BUILD_DEBUG) if ((hcl->option.trait & HCL_TRAIT_DEBUG_GC) && !(hcl->option.trait & HCL_TRAIT_NOGC)) hcl_gc (hcl, 1); #endif #if defined(HCL_PROFILE_VM) - struct rusage ru; - hcl_ntime_t rut; getrusage(RUSAGE_SELF, &ru); HCL_INIT_NTIME (&rut, ru.ru_utime.tv_sec, HCL_USEC_TO_NSEC(ru.ru_utime.tv_usec)); #endif