From 2cedd14d43be3a103dc22944c3c44249ed047ba8 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Tue, 11 Jun 2019 21:38:17 -0400 Subject: [PATCH] Fix build error on MinGW, bug1460. --- Changes | 2 ++ docs/CONTRIBUTORS | 1 + include/verilatedos.h | 9 +++++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Changes b/Changes index 789752794..c02a6ad79 100644 --- a/Changes +++ b/Changes @@ -30,6 +30,8 @@ The contributors that suggested a given feature are shown in []. Thanks! **** Fix type and real parameter issues, bug1427, bug1456, bug1458. [Todd Strader] +**** Fix build error on MinGW, bug1460. [Richard Myers] + * Verilator 4.014 2019-05-08 diff --git a/docs/CONTRIBUTORS b/docs/CONTRIBUTORS index d606f5995..baf9f5909 100644 --- a/docs/CONTRIBUTORS +++ b/docs/CONTRIBUTORS @@ -7,5 +7,6 @@ Please see the Verilator manual for additional contributors. Jeremy Bennett John Coiner Kanad Kanhere +Richard Myers Stefan Wallentowitz Wilson Snyder diff --git a/include/verilatedos.h b/include/verilatedos.h index 951bb4660..68477daa3 100644 --- a/include/verilatedos.h +++ b/include/verilatedos.h @@ -206,6 +206,11 @@ //========================================================================= // Basic integer types +#ifdef __MINGW32__ +# define __USE_MINGW_ANSI_STDIO 1 // Force old MinGW (GCC 5 and older) to use C99 formats +# define __STDC_FORMAT_MACROS 1 // Otherwise MinGW doesn't get PRId64 for fstapi.c +#endif + #if defined(__CYGWIN__) # include @@ -278,10 +283,6 @@ typedef unsigned long long vluint64_t; ///< 64-bit unsigned type #ifdef _MSC_VER # define VL_PRI64 "I64" #else // use standard C99 format specifiers -# ifdef __MINGW32__ -# define __USE_MINGW_ANSI_STDIO 1 // Force old MinGW (GCC 5 and older) to use C99 formats -# define __STDC_FORMAT_MACROS 1 // Otherwise MinGW doesn't get PRId64 for fstapi.c -# endif # if defined(__WORDSIZE) && (__WORDSIZE == 64) # define VL_PRI64 "l" # else