forked from github/verilator
Fix MSVC++ portability issues (#3812)
This commit is contained in:
parent
424faa883e
commit
7b073fec7d
@ -234,7 +234,7 @@
|
|||||||
//=========================================================================
|
//=========================================================================
|
||||||
// C++-2011
|
// C++-2011
|
||||||
|
|
||||||
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(VL_CPPCHECK)
|
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(VL_CPPCHECK) || (defined(_MSC_VER) && _MSC_VER >= 1900)
|
||||||
#else
|
#else
|
||||||
# error "Verilator requires a C++11 or newer compiler"
|
# error "Verilator requires a C++11 or newer compiler"
|
||||||
#endif
|
#endif
|
||||||
|
@ -100,21 +100,29 @@ AstShiftRS* makeNode<AstShiftRS, DfgShiftRS, AstNodeExpr*, AstNodeExpr*>( //
|
|||||||
template <>
|
template <>
|
||||||
AstCCast* makeNode<AstCCast, DfgCCast, AstNodeExpr*>(const DfgCCast* vtxp, AstNodeExpr*) {
|
AstCCast* makeNode<AstCCast, DfgCCast, AstNodeExpr*>(const DfgCCast* vtxp, AstNodeExpr*) {
|
||||||
vtxp->v3fatalSrc("not implemented");
|
vtxp->v3fatalSrc("not implemented");
|
||||||
|
VL_UNREACHABLE;
|
||||||
|
return nullptr; // LCOV_EXCL_LINE
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
AstAtoN* makeNode<AstAtoN, DfgAtoN, AstNodeExpr*>(const DfgAtoN* vtxp, AstNodeExpr*) {
|
AstAtoN* makeNode<AstAtoN, DfgAtoN, AstNodeExpr*>(const DfgAtoN* vtxp, AstNodeExpr*) {
|
||||||
vtxp->v3fatalSrc("not implemented");
|
vtxp->v3fatalSrc("not implemented");
|
||||||
|
VL_UNREACHABLE;
|
||||||
|
return nullptr; // LCOV_EXCL_LINE
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
AstCompareNN*
|
AstCompareNN*
|
||||||
makeNode<AstCompareNN, DfgCompareNN, AstNodeExpr*, AstNodeExpr*>(const DfgCompareNN* vtxp,
|
makeNode<AstCompareNN, DfgCompareNN, AstNodeExpr*, AstNodeExpr*>(const DfgCompareNN* vtxp,
|
||||||
AstNodeExpr*, AstNodeExpr*) {
|
AstNodeExpr*, AstNodeExpr*) {
|
||||||
vtxp->v3fatalSrc("not implemented");
|
vtxp->v3fatalSrc("not implemented");
|
||||||
|
VL_UNREACHABLE;
|
||||||
|
return nullptr; // LCOV_EXCL_LINE
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
AstSliceSel* makeNode<AstSliceSel, DfgSliceSel, AstNodeExpr*, AstNodeExpr*, AstNodeExpr*>(
|
AstSliceSel* makeNode<AstSliceSel, DfgSliceSel, AstNodeExpr*, AstNodeExpr*, AstNodeExpr*>(
|
||||||
const DfgSliceSel* vtxp, AstNodeExpr*, AstNodeExpr*, AstNodeExpr*) {
|
const DfgSliceSel* vtxp, AstNodeExpr*, AstNodeExpr*, AstNodeExpr*) {
|
||||||
vtxp->v3fatalSrc("not implemented");
|
vtxp->v3fatalSrc("not implemented");
|
||||||
|
VL_UNREACHABLE;
|
||||||
|
return nullptr; // LCOV_EXCL_LINE
|
||||||
}
|
}
|
||||||
// LCOV_EXCL_STOP
|
// LCOV_EXCL_STOP
|
||||||
|
|
||||||
|
@ -80,10 +80,10 @@ string V3Os::getenvStr(const string& envvar, const string& defaultValue) {
|
|||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
// Note: MinGW does not offer _dupenv_s
|
// Note: MinGW does not offer _dupenv_s
|
||||||
const char* envvalue = nullptr;
|
const char* envvalue = nullptr;
|
||||||
_dupenv_s(&envvalue, nullptr, envvar.c_str());
|
_dupenv_s((char **)&envvalue, nullptr, envvar.c_str());
|
||||||
if (envvalue != nullptr) {
|
if (envvalue != nullptr) {
|
||||||
const std::string result{envvalue};
|
const std::string result{envvalue};
|
||||||
free(envvalue);
|
free((void *)envvalue);
|
||||||
ret = result;
|
ret = result;
|
||||||
} else {
|
} else {
|
||||||
ret = defaultValue;
|
ret = defaultValue;
|
||||||
|
@ -45,7 +45,7 @@ def process():
|
|||||||
if status != 0:
|
if status != 0:
|
||||||
unlink_outputs()
|
unlink_outputs()
|
||||||
sys.exit("bisonpre: %Error: " + Args.yacc + " version " +
|
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",
|
clean_output(tmp_prefix() + ".output",
|
||||||
output_prefix() + ".output", True, False)
|
output_prefix() + ".output", True, False)
|
||||||
|
Loading…
Reference in New Issue
Block a user