From 6670474519ddd1852276bd8231d1387f8bab0474 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Thu, 7 Feb 2019 17:46:10 +0100 Subject: [PATCH 1/2] Add #include "stdint.h" to please Alpine/Musl? --- timer.h | 1 + 1 file changed, 1 insertion(+) diff --git a/timer.h b/timer.h index ecd940f..8db0440 100644 --- a/timer.h +++ b/timer.h @@ -11,6 +11,7 @@ #include "win32/getrusage.h" #else +#include "stdint.h" #include #include #endif From 4f4ebbbaf2347436c18725e11bf3d03d6781ba05 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Fri, 8 Feb 2019 19:46:05 +0100 Subject: [PATCH 2/2] Move type definition around. --- timer.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/timer.h b/timer.h index 8db0440..fd535e7 100644 --- a/timer.h +++ b/timer.h @@ -11,7 +11,6 @@ #include "win32/getrusage.h" #else -#include "stdint.h" #include #include #endif @@ -54,6 +53,9 @@ static zend_always_inline uint64 time_milliseconds(int source, double timebase_f struct timespec s; uint32 a, d; uint64 val; +#if defined(__i386__) + int64_t ret; +#endif switch (source) { #if HAVE_CLOCK_GETTIME @@ -77,7 +79,6 @@ static zend_always_inline uint64 time_milliseconds(int source, double timebase_f #endif case TIDEWAYS_XHPROF_CLOCK_TSC: #if defined(__i386__) - int64_t ret; __asm__ volatile("rdtsc" : "=A"(ret)); return ret; #elif defined(__x86_64__) || defined(__amd64__)