summaryrefslogtreecommitdiffstats
path: root/707a7ce38f97a782d0fc7fdbc033c16b146b9809.patch
blob: 4297164c00c1e03b571a2bc0361196d59b25f377 (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
From 707a7ce38f97a782d0fc7fdbc033c16b146b9809 Mon Sep 17 00:00:00 2001
From: twosee <twose@qq.com>
Date: Mon, 27 Apr 2020 17:01:05 +0800
Subject: [PATCH] Fix 32-bit build (#3276) (#3277)

---
 include/swoole.h | 4 ++++
 swoole_table.cc  | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/swoole.h b/include/swoole.h
index e6facb100..2dcef076e 100644
--- a/include/swoole.h
+++ b/include/swoole.h
@@ -104,6 +104,10 @@ int clock_gettime(clock_id_t which_clock, struct timespec *t);
 #endif
 typedef unsigned long ulong_t;
 
+#ifndef PRId64
+#define PRId64 "lld"
+#endif
+
 #ifndef PRIu64
 #define PRIu64 "llu"
 #endif
diff --git a/swoole_table.cc b/swoole_table.cc
index c3b055b35..d07818ee5 100644
--- a/swoole_table.cc
+++ b/swoole_table.cc
@@ -393,7 +393,7 @@ PHP_METHOD(swoole_table, __construct)
         zend_throw_exception(swoole_exception_ce, "global memory allocation failure", SW_ERROR_MALLOC_FAIL);
         RETURN_FALSE;
     }
-    table->hash_func = [](const char *key, size_t len) {
+    table->hash_func = [](const char *key, size_t len) -> uint64_t {
         zend_string *string = (zend_string *) (key - offsetof(zend_string, val));
         return zend_string_hash_val(string);
     };