Decrease the number of chained if-else blocks to fix MSVC build. Pull (#7)
MSVC has a limit of 128 blocks in a chain.
This commit is contained in:
parent
ee184f3f39
commit
4a31b69f84
|
|
@ -727,6 +727,7 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char
|
||||||
VOptionBool bflag;
|
VOptionBool bflag;
|
||||||
// Allow gnu -- switches
|
// Allow gnu -- switches
|
||||||
if (sw[0]=='-' && sw[1]=='-') ++sw;
|
if (sw[0]=='-' && sw[1]=='-') ++sw;
|
||||||
|
bool hadSwitchPart1 = true;
|
||||||
if (0) {}
|
if (0) {}
|
||||||
// Single switches
|
// Single switches
|
||||||
else if (!strcmp(sw, "-E")) { m_preprocOnly = true; }
|
else if (!strcmp(sw, "-E")) { m_preprocOnly = true; }
|
||||||
|
|
@ -799,6 +800,8 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char
|
||||||
else if ( onoff (sw, "-Wpedantic", flag/*ref*/)) { m_pedantic = flag; }
|
else if ( onoff (sw, "-Wpedantic", flag/*ref*/)) { m_pedantic = flag; }
|
||||||
else if ( onoff (sw, "-x-initial-edge", flag/*ref*/)) { m_xInitialEdge = flag; }
|
else if ( onoff (sw, "-x-initial-edge", flag/*ref*/)) { m_xInitialEdge = flag; }
|
||||||
else if ( onoff (sw, "-xml-only", flag/*ref*/)) { m_xmlOnly = flag; } // Undocumented, still experimental
|
else if ( onoff (sw, "-xml-only", flag/*ref*/)) { m_xmlOnly = flag; } // Undocumented, still experimental
|
||||||
|
else { hadSwitchPart1 = false; }
|
||||||
|
if (hadSwitchPart1) {}
|
||||||
// Optimization
|
// Optimization
|
||||||
else if (!strncmp (sw, "-O", 2)) {
|
else if (!strncmp (sw, "-O", 2)) {
|
||||||
for (const char* cp=sw+strlen("-O"); *cp; ++cp) {
|
for (const char* cp=sw+strlen("-O"); *cp; ++cp) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue