From aab304c0cf651f92c8db5500534be97b3224636d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 27 Nov 2016 17:43:11 +0100 Subject: [PATCH] - fixed: Lemon includes ParseTrace only in debug builds so the option to use it must be #ifdef'd. --- src/scripting/zscript/zcc_parser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/scripting/zscript/zcc_parser.cpp b/src/scripting/zscript/zcc_parser.cpp index 989ec10ae..3b2ada4c8 100644 --- a/src/scripting/zscript/zcc_parser.cpp +++ b/src/scripting/zscript/zcc_parser.cpp @@ -303,6 +303,7 @@ static void DoParse(int lumpnum) parser = ZCCParseAlloc(malloc); ZCCParseState state; +#ifndef NDEBUG FILE *f = nullptr; const char *tracefile = Args->CheckValue("-tracefile"); if (tracefile != nullptr) @@ -311,6 +312,7 @@ static void DoParse(int lumpnum) char prompt = '\0'; ZCCParseTrace(f, &prompt); } +#endif sc.OpenLumpNum(lumpnum); auto saved = sc.SavePos(); @@ -360,10 +362,12 @@ static void DoParse(int lumpnum) I_Error("%d errors while parsing %s", FScriptPosition::ErrorCounter, Wads.GetLumpFullPath(lumpnum).GetChars()); } +#ifndef NDEBUG if (f != nullptr) { fclose(f); } +#endif // Make a dump of the AST before running the compiler for diagnostic purposes. if (Args->CheckParm("-dumpast"))