From: ggn Date: Fri, 14 Apr 2017 21:47:23 +0000 (+0300) Subject: Make .incbin and object writing work ok under MinGW. X-Git-Tag: v2.1.0~145 X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=commitdiff_plain;h=5f3b8bc35e84eb1e658a61b2f64f82011d0218d9;ds=sidebyside Make .incbin and object writing work ok under MinGW. --- 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))