Redo MingW ifdefs to also work on generic WIN32, MSVC++

This commit is contained in:
Wilson Snyder 2010-02-01 06:41:17 -05:00
parent 59261113d8
commit 46dbc7157d
2 changed files with 8 additions and 5 deletions

View File

@ -161,7 +161,7 @@ inline void V3FileDependImp::writeTimes(const string& filename, const string& cm
*ofp<<"# DESCR"<<"IPTION: Verilator output: Timestamp data for --skip-identical. Delete at will."<<endl;
*ofp<<"C \""<<cmdline<<"\""<<endl;
#if !defined (__MINGW32__)
#ifndef __WIN32
sync(); // Push files so sizes look correct
#endif
for (set<DependFile>::iterator iter=m_filenameList.begin();
@ -258,7 +258,7 @@ void V3File::createMakeDir() {
static bool created = false;
if (!created) {
created = true;
#if !defined (__MINGW32__)
#ifndef __WIN32
mkdir(v3Global.opt.makeDir().c_str(), 0777);
#else
mkdir(v3Global.opt.makeDir().c_str());

View File

@ -23,8 +23,8 @@
#include "verilatedos.h"
#include <sys/types.h>
#include <sys/stat.h>
#if !defined(__MINGW32__)
#include <sys/utsname.h>
#if !defined(__WIN32)
# include <sys/utsname.h>
#endif
#include <cctype>
#include <dirent.h>
@ -330,7 +330,7 @@ void V3Options::setenvStr(const string& envvar, const string& value, const strin
} else {
UINFO(1,"export "<<envvar<<"="<<value<<endl);
}
#if !defined (__MINGW32__)
#ifndef __WIN32
setenv(envvar.c_str(),value.c_str(),true);
#else
//setenv() replaced by putenv() in MinGW environment. Prototype is different
@ -367,6 +367,9 @@ string V3Options::getenvSYSTEMC_ARCH() {
// Hardcoded with MINGW current version. Would like a better way.
string sysname = "MINGW32_NT-5.0";
var = "mingw32";
#elsif defined (__WIN32)
string sysname = "WIN32";
var = "win32";
#else
struct utsname uts;
uname(&uts);