Fix MacOS portability, bug1230.

This commit is contained in:
Wilson Snyder 2017-10-14 09:00:39 -04:00
parent 5bc2f87d3e
commit db8e8392fa
4 changed files with 12 additions and 2 deletions

View File

@ -37,6 +37,8 @@ The contributors that suggested a given feature are shown in []. Thanks!
**** Fix float-conversion warning, bug1229. [Robert Henry]
**** Fix MacOS portability, bug1230. [Jeff Bush]
* Verilator 3.912 2017-09-23

View File

@ -222,6 +222,9 @@ _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-shadow)
AC_SUBST(CFG_CXXFLAGS_NO_UNUSED)
# Checks for library functions.
AC_CHECK_MEMBER([struct stat.st_mtim.tv_nsec],
[AC_DEFINE([HAVE_STAT_NSEC],[1],[Define if struct stat has st_mtim.tv_nsec.])],
[], [#include <sys/stat.h>])
# Checks for system services

View File

@ -34,7 +34,7 @@
# define INFILTER_PIPE // Allow pipe filtering. Needs fork()
#endif
#ifdef st_mtime // Linux 2.6
#ifdef HAVE_STAT_NSEC // i.e. Linux 2.6, from configure
# define VL_STAT_CTIME_NSEC(stat) ((stat).st_ctim.tv_nsec) // Nanoseconds
# define VL_STAT_MTIME_NSEC(stat) ((stat).st_mtim.tv_nsec) // Nanoseconds
#else

View File

@ -68,8 +68,13 @@
using namespace std;
//**********************************************************************
//**** Configure-discovered library options
// Define if struct stat has st_mtim.tv_nsec (from configure)
#undef HAVE_STAT_NSEC
//**********************************************************************
//**** OS and compiler specifics
#include "verilatedos.h"