Modernize va args (#2214)

Verilator uses a form of variadic macros that are nonstandard, making it
unable to be compiled under MSVC.  Replace the old synax with the
standard syntax.  This fixes MSVC usage.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2020-03-29 22:29:12 +08:00 committed by GitHub
parent 07d00f26aa
commit a1a2650f1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -31,6 +31,7 @@ Philipp Wagner
Pieter Kapsenberg Pieter Kapsenberg
Richard Myers Richard Myers
Sebastien Van Cauwenberghe Sebastien Van Cauwenberghe
Sean Cross
Stefan Wallentowitz Stefan Wallentowitz
Tobias Rosenkranz Tobias Rosenkranz
Tobias Wölfel Tobias Wölfel

View File

@ -62,10 +62,10 @@
/// VL_COVER_INSERT(&m_cases[i], "comment", "Coverage Case", "i", cvtToNumStr(i)); /// VL_COVER_INSERT(&m_cases[i], "comment", "Coverage Case", "i", cvtToNumStr(i));
/// } /// }
#define VL_COVER_INSERT(countp,args...) \ #define VL_COVER_INSERT(countp,...) \
VL_IF_COVER(VerilatedCov::_inserti(countp); \ VL_IF_COVER(VerilatedCov::_inserti(countp); \
VerilatedCov::_insertf(__FILE__, __LINE__); \ VerilatedCov::_insertf(__FILE__, __LINE__); \
VerilatedCov::_insertp("hier", name(), args)) VerilatedCov::_insertp("hier", name(), __VA_ARGS__))
//============================================================================= //=============================================================================
/// Convert VL_COVER_INSERT value arguments to strings /// Convert VL_COVER_INSERT value arguments to strings

View File

@ -42,8 +42,8 @@
VL_FATAL_MT(__FILE__, __LINE__, "", \ VL_FATAL_MT(__FILE__, __LINE__, "", \
(std::string("%%Error: Unsupported DPI function: ")+VL_FUNC).c_str()) (std::string("%%Error: Unsupported DPI function: ")+VL_FUNC).c_str())
#define _VL_SVDPI_WARN(message...) \ #define _VL_SVDPI_WARN(...) \
VL_PRINTF_MT(message) VL_PRINTF_MT(__VA_ARGS__)
// Function requires a "context" in the import declaration // Function requires a "context" in the import declaration
#define _VL_SVDPI_CONTEXT_WARN() \ #define _VL_SVDPI_CONTEXT_WARN() \