diff options
-rw-r--r-- | src/misc/util/abc_global.h | 4 | ||||
-rw-r--r-- | src/misc/util/utilFile.c | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/misc/util/abc_global.h b/src/misc/util/abc_global.h index 950a8889..144177da 100644 --- a/src/misc/util/abc_global.h +++ b/src/misc/util/abc_global.h @@ -26,6 +26,7 @@ //////////////////////////////////////////////////////////////////////// #ifdef _WIN32 +#ifndef __MINGW32__ #define inline __inline // compatible with MS VS 6.0 #pragma warning(disable : 4152) // warning C4152: nonstandard extension, function/data pointer conversion in expression #pragma warning(disable : 4200) // warning C4200: nonstandard extension used : zero-sized array in struct/union @@ -34,6 +35,7 @@ #pragma warning(disable : 4710) // warning C4710: function 'Vec_PtrGrow' not inlined //#pragma warning( disable : 4273 ) #endif +#endif #ifdef WIN32 #ifdef WIN32_NO_DLL @@ -272,7 +274,7 @@ static inline int Abc_Lit2LitL( int * pMap, int Lit ) { return Abc_LitNo typedef ABC_INT64_T abctime; static inline abctime Abc_Clock() { -#if defined(LIN) || defined(LIN64) && !(__APPLE__ & __MACH__) +#if (defined(LIN) || defined(LIN64) && !(__APPLE__ & __MACH__)) && !defined(__MINGW32__) struct timespec ts; if ( clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) < 0 ) return (abctime)-1; diff --git a/src/misc/util/utilFile.c b/src/misc/util/utilFile.c index 41438c57..c5c5a08f 100644 --- a/src/misc/util/utilFile.c +++ b/src/misc/util/utilFile.c @@ -25,7 +25,7 @@ #include <fcntl.h> #include <sys/stat.h> -#if defined(_MSC_VER) +#if defined(_MSC_VER) || defined(__MINGW32__) #include <Windows.h> #include <process.h> #include <io.h> @@ -88,7 +88,7 @@ static ABC_UINT64_T realTimeAbs() // -- absolute time in nano-seconds ***********************************************************************/ int tmpFile(const char* prefix, const char* suffix, char** out_name) { -#if defined(_MSC_VER) +#if defined(_MSC_VER) || defined(__MINGW32__) int i, fd; *out_name = (char*)malloc(strlen(prefix) + strlen(suffix) + 27); for (i = 0; i < 10; i++){ @@ -174,7 +174,7 @@ char* vnsprintf(const char* format, va_list args) static FILE* dummy_file = NULL; if (!dummy_file) { -#if !defined(_MSC_VER) +#if !defined(_MSC_VER) && !defined(__MINGW32) dummy_file = fopen("/dev/null", "wb"); #else dummy_file = fopen("NUL", "wb"); |