Commit c35f6c1b authored by KO Myung-Hun's avatar KO Myung-Hun Committed by Jean-Baptiste Kempf

skins2: os2: save and restore FPU cw

WinCreateMsgQueue() changes FPU cw but does not restore it. This causes
SIGFPE later.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent cbce4489
......@@ -31,6 +31,7 @@
#include <io.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <cfloat>
#include "os2_factory.hpp"
#include "os2_graphics.hpp"
......@@ -169,8 +170,16 @@ bool OS2Factory::init()
MorphToPM();
m_hab = WinInitialize( 0 );
// save FPU CW
unsigned saved_cw = _control87( 0, 0 );
// WinCreateMsgQueue() changes FPU CW but does not restore it
m_hmq = WinCreateMsgQueue( m_hab, 0 );
// restore FPU CW
_control87( saved_cw, MCW_EM | MCW_IC | MCW_RC | MCW_PC );
if( !WinRegisterClass( m_hab, vlc_class, OS2Factory::OS2Proc,
CS_SIZEREDRAW, sizeof( PVOID )))
{
......
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