Looks like in MinGW you're supposed to use _fmode = _O_BINARY instead. See here for example.
Fix compiler errors in shobjidl.h when NOGDI is defined
Ok, I subscribed and sent it. https://sourceforge.net/p/mingw-w64/mailman/mingw-w64-public/thread/CAGHpTBLEXQ4AL_1XmZq%2BjFycGEvPAqKhXPk0X9j5_mLAv_-ckA%40mail.gmail.com/#msg37288603
Still waiting... :(
Sent yesterday. Waiting for moderator approval.
Fix compiler errors in shobjidl.h when NOGDI is defined
Fix compiler errors in shobjidl.h when NOGDI is defined
shobjidl.h header is incompatible with NOGDI and Win7