From 90f12cfda1810274f23d37c8ea6e6a52224a1a20 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 27 Apr 2020 12:42:41 +0200 Subject: add upstream patch to fix 32-bit and old GCC builds --- 707a7ce38f97a782d0fc7fdbc033c16b146b9809.patch | 38 ++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 707a7ce38f97a782d0fc7fdbc033c16b146b9809.patch (limited to '707a7ce38f97a782d0fc7fdbc033c16b146b9809.patch') diff --git a/707a7ce38f97a782d0fc7fdbc033c16b146b9809.patch b/707a7ce38f97a782d0fc7fdbc033c16b146b9809.patch new file mode 100644 index 0000000..4297164 --- /dev/null +++ b/707a7ce38f97a782d0fc7fdbc033c16b146b9809.patch @@ -0,0 +1,38 @@ +From 707a7ce38f97a782d0fc7fdbc033c16b146b9809 Mon Sep 17 00:00:00 2001 +From: twosee +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); + }; -- cgit