Commit 6a4d430e by Aaron Tomb

Choose Windows file operations with MINGW32.

parent cf1746e3
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h> #include <sys/stat.h>
#if defined(_MSC_VER) #if defined(_MSC_VER) || defined(__MINGW32__)
#include <Windows.h> #include <Windows.h>
#include <process.h> #include <process.h>
#include <io.h> #include <io.h>
...@@ -88,7 +88,7 @@ static ABC_UINT64_T realTimeAbs() // -- absolute time in nano-seconds ...@@ -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) int tmpFile(const char* prefix, const char* suffix, char** out_name)
{ {
#if defined(_MSC_VER) #if defined(_MSC_VER) || defined(__MINGW32__)
int i, fd; int i, fd;
*out_name = (char*)malloc(strlen(prefix) + strlen(suffix) + 27); *out_name = (char*)malloc(strlen(prefix) + strlen(suffix) + 27);
for (i = 0; i < 10; i++){ for (i = 0; i < 10; i++){
...@@ -174,7 +174,7 @@ char* vnsprintf(const char* format, va_list args) ...@@ -174,7 +174,7 @@ char* vnsprintf(const char* format, va_list args)
static FILE* dummy_file = NULL; static FILE* dummy_file = NULL;
if (!dummy_file) if (!dummy_file)
{ {
#if !defined(_MSC_VER) #if !defined(_MSC_VER) && !defined(__MINGW32)
dummy_file = fopen("/dev/null", "wb"); dummy_file = fopen("/dev/null", "wb");
#else #else
dummy_file = fopen("NUL", "wb"); 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