forked from WearCode/magiskboot_build
-
Notifications
You must be signed in to change notification settings - Fork 1
/
0029-workaround-support-building-with-libstdcxx.patch
105 lines (92 loc) · 2.49 KB
/
0029-workaround-support-building-with-libstdcxx.patch
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
From 03220a4a97225457eb88e25ceb1d11abcc80f84c Mon Sep 17 00:00:00 2001
From: Ookiineko <[email protected]>
Date: Tue, 12 Dec 2023 03:07:40 +0000
Subject: [PATCH] workaround: support building with libstdc++
* may be useful for some really old distros
Signed-off-by: Ookiineko <[email protected]>
---
native/src/base/files.cpp | 3 +++
native/src/base/files.hpp | 3 +++
native/src/base/misc.cpp | 3 +++
native/src/base/misc.hpp | 3 +++
native/src/base/stream.cpp | 3 +++
native/src/boot/format.hpp | 3 +++
6 files changed, 18 insertions(+)
diff --git a/native/src/base/files.cpp b/native/src/base/files.cpp
index 050bda6..c05cf18 100644
--- a/native/src/base/files.cpp
+++ b/native/src/base/files.cpp
@@ -32,6 +32,9 @@
#define dirent _dirent_stub
#define getline msvc_getline
#endif
+#ifndef _LIBCPP_VERSION
+#include <cstring>
+#endif
#include <base.hpp>
diff --git a/native/src/base/files.hpp b/native/src/base/files.hpp
index 9c2d890..19c2dd6 100644
--- a/native/src/base/files.hpp
+++ b/native/src/base/files.hpp
@@ -5,6 +5,10 @@
#include <string_view>
#include <string>
#include <vector>
+#ifndef _LIBCPP_VERSION
+#include <cstring>
+#include <memory>
+#endif
#ifdef __linux__
#include <linux/fs.h>
diff --git a/native/src/base/misc.cpp b/native/src/base/misc.cpp
index 249b698..4e3c342 100644
--- a/native/src/base/misc.cpp
+++ b/native/src/base/misc.cpp
@@ -28,6 +28,9 @@
#ifdef _WIN32
#include <winsup/str_compat.h>
#endif
+#ifndef _LIBCPP_VERSION
+#include <cstring>
+#endif
#include <base.hpp>
diff --git a/native/src/base/misc.hpp b/native/src/base/misc.hpp
index 7ced155..3e9869f 100644
--- a/native/src/base/misc.hpp
+++ b/native/src/base/misc.hpp
@@ -6,6 +6,10 @@
#include <string_view>
#include <bitset>
#include <random>
+#ifndef _LIBCPP_VERSION
+#include <cstring>
+#include <memory>
+#endif
#include <cxx.h>
#include "xwrap.hpp"
diff --git a/native/src/base/stream.cpp b/native/src/base/stream.cpp
index 271cad2..850beb0 100644
--- a/native/src/base/stream.cpp
+++ b/native/src/base/stream.cpp
@@ -1,5 +1,8 @@
#include <unistd.h>
#include <cstddef>
+#ifndef _LIBCPP_VERSION
+#include <cstring>
+#endif
#include <base.hpp>
#include <stream.hpp>
diff --git a/native/src/boot/format.hpp b/native/src/boot/format.hpp
index e0634ba..c9e3773 100644
--- a/native/src/boot/format.hpp
+++ b/native/src/boot/format.hpp
@@ -1,6 +1,9 @@
#pragma once
#include <string_view>
+#ifndef _LIBCPP_VERSION
+#include <cstring>
+#endif
typedef enum {
UNKNOWN,
--
2.41.0