Skip to content

Commit

Permalink
Fix exceptions mismatch.
Browse files Browse the repository at this point in the history
  • Loading branch information
tritao committed Oct 27, 2024
1 parent 5e6fd48 commit 6f26cfb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#define _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
#define _LIBCPP_HIDE_FROM_ABI
#define _LIBCPP_NO_ABI_TAG

#include <string>
#include <new>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#define _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
#define _LIBCPP_HIDE_FROM_ABI
#define _LIBCPP_NO_ABI_TAG

#include <string>
#include <new>
Expand Down
1 change: 1 addition & 0 deletions src/CppParser/ParserGen/ParserGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public void Setup(Driver driver)
{
var parserOptions = driver.ParserOptions;
parserOptions.TargetTriple = Triple;
parserOptions.EnableExceptions = false;

var options = driver.Options;
options.GeneratorKind = Kind;
Expand Down
2 changes: 2 additions & 0 deletions src/CppParser/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ project "Std-symbols"
language "C++"
SetupNativeProject()
rtti "Off"
exceptionhandling "Off"

defines { "DLL_EXPORT" }

filter { "toolset:msc*" }
Expand Down
5 changes: 3 additions & 2 deletions src/Parser/ParserOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public ParserOptions()
TargetTriple.Contains("windows") || TargetTriple.Contains("msvc");

public bool EnableRTTI { get; set; }
public bool EnableExceptions { get; set; }
public LanguageVersion? LanguageVersion { get; set; }

public void BuildForSourceFile(
Expand Down Expand Up @@ -373,8 +374,8 @@ private void SetupArguments(TargetPlatform targetPlatform)
break;
}

if (!EnableRTTI)
AddArguments("-fno-rtti");
AddArguments(EnableRTTI ? "-frtti" : "-fno-rtti");
AddArguments(EnableExceptions ? "-fexceptions" : "-fno-exceptions");
}

internal string BuiltinsDirBasePath
Expand Down

0 comments on commit 6f26cfb

Please sign in to comment.