-
Notifications
You must be signed in to change notification settings - Fork 2
/
3630-Prevent-future-msvc-byte-and-std-byte-headache.patch
107 lines (104 loc) · 3.38 KB
/
3630-Prevent-future-msvc-byte-and-std-byte-headache.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
105
106
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Andrew Strelsky <ajs222@njit.edu>
Date: Sun, 14 Nov 2021 09:02:04 -0500
Subject: [PATCH] 3630: Prevent future msvc byte and std::byte headache
---
.../Features/Decompiler/buildNatives.gradle | 29 ++++++++++---------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/Ghidra/Features/Decompiler/buildNatives.gradle b/Ghidra/Features/Decompiler/buildNatives.gradle
index eba71e460b..bc50d9d307 100644
--- a/Ghidra/Features/Decompiler/buildNatives.gradle
+++ b/Ghidra/Features/Decompiler/buildNatives.gradle
@@ -4,16 +4,16 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+
// Native build files are already applied in development mode (indicated by presence of the
// Generic project). Only need to apply them if we are in a distribution.
if (findProject(':Generic') == null) {
@@ -31,11 +31,11 @@ model {
// the same directory with other files that are not used by the decompiler.
// That is why we have to list every cpp file that makes up the decomplier.
components {
-
+
decompile(NativeExecutableSpec) {
-
+
baseName "decompile"
-
+
// these tell gradle for which platforms to build a decompiler executable.
targetPlatform "win_x86_64"
targetPlatform "linux_x86_64"
@@ -132,19 +132,19 @@ model {
// include "ifacedecomp.cc" // uncomment for debug
// include "ifaceterm.cc" // uncomment for debug
// include "interface.cc" // uncomment for debug
-
+
// generated source files
-
+
include "xml.cc"
// include "grammar.cc" // used by diagnostic console mode
}
exportedHeaders {
srcDir "src/decompile/cpp"
}
- } // end cpp
+ } // end cpp
} // end sources
} // end decompile
-
+
sleigh(NativeExecutableSpec) {
targetPlatform "win_x86_64"
targetPlatform "linux_x86_64"
@@ -181,9 +181,9 @@ model {
include "compression.cc"
include "filemanage.cc"
include "slgh_compile.cc"
-
+
// generated source files
-
+
include "xml.cc"
include "pcodeparse.cc"
include "slghparse.cc"
@@ -209,9 +209,9 @@ model {
}
} // end binaries.all (sleigh)
} // end sleigh
-
+
} // end components
-
+
binaries {
all{ b ->
if (b.toolChain in Gcc) {
@@ -230,6 +230,7 @@ model {
b.cppCompiler.args "/EHsc"
b.cppCompiler.define "_SECURE_SCL=0"
b.cppCompiler.define "_HAS_ITERATOR_DEBUGGING=0"
+ b.cppCompiler.define "_HAS_STD_BYTE=0" // msvc has a byte typedef that conflicts with c++17 std::byte
// b.cppCompiler.args "/Zi" // for DEBUG, uncomment this line
// b.cppCompiler.args "/FS" // for DEBUG, uncomment this line
// b.linker.args "/DEBUG" // for DEBUG, uncomment this line
--
2.45.1