aboutsummaryrefslogtreecommitdiffstats
path: root/testing/php7-tideways_xhprof/73.patch
blob: 1986d0572eb84736de8e837a4e7869daa7ec9b6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
From 6670474519ddd1852276bd8231d1387f8bab0474 Mon Sep 17 00:00:00 2001
From: Benjamin Eberlei <kontakt@beberlei.de>
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 <sys/time.h>
 #include <sys/resource.h>
 #endif

From 4f4ebbbaf2347436c18725e11bf3d03d6781ba05 Mon Sep 17 00:00:00 2001
From: Benjamin Eberlei <kontakt@beberlei.de>
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 <sys/time.h>
 #include <sys/resource.h>
 #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__)