From e69bf418de9d48227d8011d075bb9ce44b0b2758 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Fri, 29 Nov 2013 08:28:48 -0500 Subject: [PATCH] Fix --lint-only with MinGW, msg1283. --- Changes | 5 +++++ configure.ac | 2 +- include/verilatedos.h | 9 +++++++++ src/V3EmitC.cpp | 2 +- src/V3File.h | 4 ++-- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index 7e4abe595..c6c0b2af0 100644 --- a/Changes +++ b/Changes @@ -3,6 +3,11 @@ Revision history for Verilator The contributors that suggested a given feature are shown in []. [by ...] indicates the contributor was also the author of the fix; Thanks! +* Verilator 3.855 devel + +**** Fix --lint-only with MinGW, msg1283. [HyungKi Jeong] + + * Verilator 3.854 2013-11-26 *** Add UNPACKED warning to convert unpacked structs. [Jeremy Bennett] diff --git a/configure.ac b/configure.ac index 02cc92721..d7b9182c6 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ #AC_INIT([Verilator],[#.### YYYY-MM-DD]) #AC_INIT([Verilator],[#.### devel]) -AC_INIT([Verilator],[3.854 2013-11-26]) +AC_INIT([Verilator],[3.855 devel]) AC_CONFIG_HEADER(src/config_build.h) AC_CONFIG_FILES(Makefile src/Makefile src/Makefile_obj include/verilated.mk include/verilated_config.h) diff --git a/include/verilatedos.h b/include/verilatedos.h index e419cfce5..6db62794f 100644 --- a/include/verilatedos.h +++ b/include/verilatedos.h @@ -189,6 +189,15 @@ typedef unsigned long long vluint64_t; ///< 64-bit unsigned type # endif #endif +//========================================================================= +// File system functions + +#ifdef _WIN32 +# define VL_DEV_NULL "nul" +#else // Linux or compliant Unix flavors +# define VL_DEV_NULL "/dev/null" +#endif + //========================================================================= // Integer size macros diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index 6a1206462..397fed373 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -706,7 +706,7 @@ class EmitCImp : EmitCStmts { if (v3Global.opt.lintOnly()) { // Unfortunately we have some lint checks here, so we can't just skip processing. // We should move them to a different stage. - string filename = "/dev/null"; + string filename = VL_DEV_NULL; newCFile(filename, slow, source); ofp = new V3OutSpFile (filename); } diff --git a/src/V3File.h b/src/V3File.h index 31275fe19..0522cd8a3 100644 --- a/src/V3File.h +++ b/src/V3File.h @@ -46,7 +46,7 @@ public: return new_ofstream_nodepend (filename, append); } static ofstream* new_ofstream_nodepend(const string& filename, bool append=false) { - if (filename != "/dev/null") createMakeDir(); + if (filename != VL_DEV_NULL) createMakeDir(); if (append) { return new ofstream(filename.c_str(), ios::app); } else { @@ -54,7 +54,7 @@ public: } } static FILE* new_fopen_w(const string& filename) { - if (filename != "/dev/null") createMakeDir(); + if (filename != VL_DEV_NULL) createMakeDir(); addTgtDepend(filename); return fopen(filename.c_str(),"w"); }