Commit 6f5b0ebb 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: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit c35f6c1be0c06204a7b9787695cfa1150c5e5f90)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 53d6fa00
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <io.h> #include <io.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <cfloat>
#include "os2_factory.hpp" #include "os2_factory.hpp"
#include "os2_graphics.hpp" #include "os2_graphics.hpp"
...@@ -169,8 +170,16 @@ bool OS2Factory::init() ...@@ -169,8 +170,16 @@ bool OS2Factory::init()
MorphToPM(); MorphToPM();
m_hab = WinInitialize( 0 ); 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 ); 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, if( !WinRegisterClass( m_hab, vlc_class, OS2Factory::OS2Proc,
CS_SIZEREDRAW, sizeof( PVOID ))) 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