Work around the missing _controlfp prototypes in MinGW

This commit is contained in:
Yamagi Burmeister 2012-06-05 10:29:20 +02:00
parent 58c3b22c8a
commit 28be8cda8e
3 changed files with 14 additions and 7 deletions

6
TODO
View file

@ -2,12 +2,6 @@ Windows Port TODO
-----------------
- Check WITH_SYSTEMWIDE
- Check if we really need all the stuff in winquake.h
- Due to a bug in MinGW the _controlfp() option defines _PC_24
and _MCW_PC are not available. While Quake II may work without
them, we should try to find a workaround. See:
http://mingw-users.1079350.n2.nabble.com/MinGW-missing-
controlfp-and-related-defines-Looks-like-not-td7278570.html
- Currently the Makefiles needs a special "mkdir.exe" which
supports the -p option. We need a better aproach so that
the Windows buildin "mkdir" can be used.

View file

@ -28,6 +28,19 @@
#define WINDOW_STYLE (WS_OVERLAPPED | WS_BORDER | WS_CAPTION | WS_VISIBLE)
#ifndef _PC_24
#define _PC_24 0x00020000
#endif
#ifndef _MCW_PC
#define _MCW_PC 0x00030000
#endif
/* This is a hack to work around a missing MinGW prototype */
#ifndef _controlfp
unsigned int _controlfp(unsigned int new, unsigned int mask);
#endif
extern HINSTANCE global_hInstance;
extern HWND cl_hwnd;

View file

@ -693,7 +693,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
}
while (time < 1);
/*_controlfp(_PC_24, _MCW_PC); */
_controlfp(_PC_24, _MCW_PC);
Qcommon_Frame(time);
oldtime = newtime;