Skip to content

Commit 4926470

Browse files
committed
Fix exceptions mismatch.
1 parent 62d2792 commit 4926470

File tree

10 files changed

+10
-5
lines changed

10 files changed

+10
-5
lines changed

src/CLI/Generator.cs

+1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ public void Setup(Driver driver)
146146

147147
parserOptions.UnityBuild = options.UnityBuild;
148148
parserOptions.EnableRTTI = options.EnableRTTI;
149+
parserOptions.EnableExceptions = options.EnableExceptions;
149150

150151
parserOptions.Setup(options.Platform ?? Platform.Host);
151152

src/CppParser/Bindings/CSharp/arm64-apple-darwin/Std-symbols.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#define _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
22
#define _LIBCPP_HIDE_FROM_ABI
3-
#define _LIBCPP_NO_ABI_TAG
43

54
#include <string>
65
#include <new>

src/CppParser/Bindings/CSharp/i686-apple-darwin/Std-symbols.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#define _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
22
#define _LIBCPP_HIDE_FROM_ABI
3-
#define _LIBCPP_NO_ABI_TAG
43

54
#include <string>
65
#include <new>

src/CppParser/Bindings/CSharp/x86_64-apple-darwin/Std-symbols.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#define _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
22
#define _LIBCPP_HIDE_FROM_ABI
3-
#define _LIBCPP_NO_ABI_TAG
43

54
#include <string>
65
#include <new>

src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/Std-symbols.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#define _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
22
#define _LIBCPP_HIDE_FROM_ABI
3-
#define _LIBCPP_NO_ABI_TAG
43

54
#include <string>
65
#include <new>

src/CppParser/Bindings/CSharp/x86_64-linux-gnu/Std-symbols.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#define _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
22
#define _LIBCPP_HIDE_FROM_ABI
3-
#define _LIBCPP_NO_ABI_TAG
43

54
#include <string>
65
#include <new>

src/CppParser/ParserGen/ParserGen.cs

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public void Setup(Driver driver)
4949
{
5050
var parserOptions = driver.ParserOptions;
5151
parserOptions.TargetTriple = Triple;
52+
parserOptions.EnableExceptions = false;
5253

5354
var options = driver.Options;
5455
options.GeneratorKind = Kind;

src/CppParser/premake5.lua

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ project "Std-symbols"
5151
language "C++"
5252
SetupNativeProject()
5353
rtti "Off"
54+
exceptionhandling "Off"
55+
5456
defines { "DLL_EXPORT" }
5557

5658
filter { "toolset:msc*" }

src/Generator/Passes/SymbolsCodeGenerator.cs

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public override void Process()
3333
WriteLine("#define _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS");
3434
WriteLine("#define _LIBCPP_HIDE_FROM_ABI");
3535
WriteLine("#define _LIBCPP_NO_ABI_TAG");
36+
if (!Context.ParserOptions.EnableExceptions)
37+
WriteLine("#define _LIBCPP_HAS_NO_EXCEPTIONS");
3638
NewLine();
3739
WriteLine("#include <string>");
3840
}

src/Parser/ParserOptions.cs

+4
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public ParserOptions()
8484
TargetTriple.Contains("windows") || TargetTriple.Contains("msvc");
8585

8686
public bool EnableRTTI { get; set; }
87+
public bool EnableExceptions { get; set; }
8788
public LanguageVersion? LanguageVersion { get; set; }
8889

8990
public void BuildForSourceFile(
@@ -375,6 +376,9 @@ private void SetupArguments(TargetPlatform targetPlatform)
375376

376377
if (!EnableRTTI)
377378
AddArguments("-fno-rtti");
379+
380+
if (EnableExceptions)
381+
AddArguments("-fexceptions");
378382
}
379383

380384
internal string BuiltinsDirBasePath

0 commit comments

Comments
 (0)