Added --noCppExceptions switch
This commit is contained in:
parent
2dd324632d
commit
378c904131
6 changed files with 18 additions and 3 deletions
|
|
@ -2111,8 +2111,10 @@ proc expr(p: BProc, n: PNode, d: var TLoc) =
|
|||
initLocExpr(p, n.sons[0], a)
|
||||
of nkAsmStmt: genAsmStmt(p, n)
|
||||
of nkTryStmt:
|
||||
if p.module.compileToCpp: genTryCpp(p, n, d)
|
||||
else: genTry(p, n, d)
|
||||
if p.module.compileToCpp and optNoCppExceptions notin gGlobalOptions:
|
||||
genTryCpp(p, n, d)
|
||||
else:
|
||||
genTry(p, n, d)
|
||||
of nkRaiseStmt: genRaiseStmt(p, n)
|
||||
of nkTypeSection:
|
||||
# we have to emit the type information for object types here to support
|
||||
|
|
|
|||
|
|
@ -619,6 +619,10 @@ proc processSwitch(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) =
|
|||
cAssembler = nameToCC(arg)
|
||||
if cAssembler notin cValidAssemblers:
|
||||
localError(info, errGenerated, "'$1' is not a valid assembler." % [arg])
|
||||
of "nocppexceptions":
|
||||
expectNoArg(switch, arg, pass, info)
|
||||
incl(gGlobalOptions, optNoCppExceptions)
|
||||
defineSymbol("noCppExceptions")
|
||||
else:
|
||||
if strutils.find(switch, '.') >= 0: options.setConfigVar(switch, arg)
|
||||
else: invalidCmdLineOption(pass, switch, info)
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ type # please make sure we have under 32 options
|
|||
# also: generate header file
|
||||
optIdeDebug # idetools: debug mode
|
||||
optIdeTerse # idetools: use terse descriptions
|
||||
optNoCppExceptions # use C exception handling even with CPP
|
||||
TGlobalOptions* = set[TGlobalOption]
|
||||
TCommands* = enum # Nim's commands
|
||||
# **keep binary compatible**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue