void-packages/srcpkgs/heaptrack/patches/001.compile-on-32bit.patch

71 lines
2.0 KiB
Diff

# reason: current release is unable to build on 32bit arches
# src: upstream/master
From 76fd2e84ba133e96d2cfdf90cb715e66e923eb8f Mon Sep 17 00:00:00 2001
From: Milian Wolff <mail@milianw.de>
Date: Thu, 17 May 2018 13:31:25 +0200
Subject: [PATCH] Fix compile on 32bit
BUG: 394330
---
src/util/linewriter.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/util/linewriter.h b/src/util/linewriter.h
index 73a7930..e895e87 100644
--- src/util/linewriter.h
+++ src/util/linewriter.h
@@ -158,6 +158,11 @@ class LineWriter
return __builtin_clzl(V);
}
+ inline static unsigned clz(long long unsigned V)
+ {
+ return __builtin_clzll(V);
+ }
+
template <typename V>
static char* writeHexNumber(char* buffer, V value)
{
From 49577e019ea791ee63962cdfe7e9c0c5b5c6ea4b Mon Sep 17 00:00:00 2001
From: Milian Wolff <milian.wolff@kdab.com>
Date: Tue, 29 May 2018 10:41:10 +0200
Subject: [PATCH] Fix another compile error on 32bit
Introduce a user-defined _u64 literal for uint64_t
and use that instead of ul/ull.
BUG: 394330
---
tests/auto/tst_io.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tests/auto/tst_io.cpp b/tests/auto/tst_io.cpp
index 48abda6..fd31b31 100644
--- tests/auto/tst_io.cpp
+++ tests/auto/tst_io.cpp
@@ -27,6 +27,11 @@
using namespace std;
+constexpr uint64_t operator"" _u64(unsigned long long v)
+{
+ return static_cast<uint64_t>(v);
+}
+
TEST_CASE ("write data", "[write]") {
TempFile file;
REQUIRE(file.open());
@@ -124,7 +129,7 @@ TEST_CASE ("read line 64bit", "[read]") {
REQUIRE(reader >> module);
REQUIRE(module == "/tmp/KDevelop-5.2.1-x86_64/usr/lib/libKF5Completion.so.5");
- for (uint64_t expected : {0x7f48beedc00ul, 0x0ul, 0x36854ul, 0x236858ul, 0x2700ul}) {
+ for (auto expected : {0x7f48beedc00_u64, 0x0_u64, 0x36854_u64, 0x236858_u64, 0x2700_u64}) {
uint64_t addr = 0;
REQUIRE(reader >> addr);
REQUIRE(addr == expected);