Fix MSVC++ portability issues (#3812)

This commit is contained in:
Kritik Bhimani
2022-12-12 18:45:32 -05:00
committed by GitHub
parent 424faa883e
commit 7b073fec7d
4 changed files with 12 additions and 4 deletions
+8
View File
@@ -100,21 +100,29 @@ AstShiftRS* makeNode<AstShiftRS, DfgShiftRS, AstNodeExpr*, AstNodeExpr*>( //
template <>
AstCCast* makeNode<AstCCast, DfgCCast, AstNodeExpr*>(const DfgCCast* vtxp, AstNodeExpr*) {
vtxp->v3fatalSrc("not implemented");
VL_UNREACHABLE;
return nullptr; // LCOV_EXCL_LINE
}
template <>
AstAtoN* makeNode<AstAtoN, DfgAtoN, AstNodeExpr*>(const DfgAtoN* vtxp, AstNodeExpr*) {
vtxp->v3fatalSrc("not implemented");
VL_UNREACHABLE;
return nullptr; // LCOV_EXCL_LINE
}
template <>
AstCompareNN*
makeNode<AstCompareNN, DfgCompareNN, AstNodeExpr*, AstNodeExpr*>(const DfgCompareNN* vtxp,
AstNodeExpr*, AstNodeExpr*) {
vtxp->v3fatalSrc("not implemented");
VL_UNREACHABLE;
return nullptr; // LCOV_EXCL_LINE
}
template <>
AstSliceSel* makeNode<AstSliceSel, DfgSliceSel, AstNodeExpr*, AstNodeExpr*, AstNodeExpr*>(
const DfgSliceSel* vtxp, AstNodeExpr*, AstNodeExpr*, AstNodeExpr*) {
vtxp->v3fatalSrc("not implemented");
VL_UNREACHABLE;
return nullptr; // LCOV_EXCL_LINE
}
// LCOV_EXCL_STOP
+2 -2
View File
@@ -80,10 +80,10 @@ string V3Os::getenvStr(const string& envvar, const string& defaultValue) {
#if defined(_MSC_VER)
// Note: MinGW does not offer _dupenv_s
const char* envvalue = nullptr;
_dupenv_s(&envvalue, nullptr, envvar.c_str());
_dupenv_s((char **)&envvalue, nullptr, envvar.c_str());
if (envvalue != nullptr) {
const std::string result{envvalue};
free(envvalue);
free((void *)envvalue);
ret = result;
} else {
ret = defaultValue;
+1 -1
View File
@@ -45,7 +45,7 @@ def process():
if status != 0:
unlink_outputs()
sys.exit("bisonpre: %Error: " + Args.yacc + " version " +
Bison_Version + " run failed due to errors\n")
str(Bison_Version) + " run failed due to errors\n")
clean_output(tmp_prefix() + ".output",
output_prefix() + ".output", True, False)