Commit e3560904 by Alan Mishchenko

Merged in atomb/abc (pull request #1)

Several patches to fix compilation under MINGW32
parents 053c9f54 aa2eae5c
......@@ -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;
......
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment