From 5f3b8bc35e84eb1e658a61b2f64f82011d0218d9 Mon Sep 17 00:00:00 2001 From: ggn Date: Sat, 15 Apr 2017 00:47:23 +0300 Subject: [PATCH] Make .incbin and object writing work ok under MinGW. --- rmac.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/rmac.h b/rmac.h index f81b9a9..ee252ef 100644 --- a/rmac.h +++ b/rmac.h @@ -55,10 +55,6 @@ #else #ifdef __GCCUNIX__ - #ifdef __MINGW32__ - #define off64_t long - #define off_t long - #endif #include #include @@ -67,6 +63,16 @@ #define _OPEN_FLAGS O_TRUNC|O_CREAT|O_RDWR #define _OPEN_INC O_RDONLY #define _PERM_MODE S_IRUSR|S_IWUSR + + #ifdef __MINGW32__ + #define off64_t long + #define off_t long + #undef _OPEN_FLAGS + #undef _OPEN_INC + #define _OPEN_FLAGS _O_TRUNC|_O_CREAT|_O_BINARY|_O_RDWR + #define _OPEN_INC O_RDONLY|_O_BINARY + #endif + // WARNING WARNING WARNING #define DO_PRAGMA(x) _Pragma (#x) #define WARNING(desc) DO_PRAGMA(message (#desc)) -- 2.37.2