diff --git a/mozilla/xpcom/build/Makefile.in b/mozilla/xpcom/build/Makefile.in index eaf56ec5543..8a9df0107a3 100644 --- a/mozilla/xpcom/build/Makefile.in +++ b/mozilla/xpcom/build/Makefile.in @@ -108,6 +108,10 @@ ifeq ($(MOZ_OS2_TOOLS),VACPP) OS_LIBS += libconv.lib libuls.lib endif +ifeq ($(MOZ_OS2_TOOLS),EMX) +OS_LIBS += -luconv +endif + # UNIX98 iconv support OS_LIBS += $(LIBICONV) diff --git a/mozilla/xpcom/glue/nsDebug.cpp b/mozilla/xpcom/glue/nsDebug.cpp index 02b85256406..1cf6d382f57 100644 --- a/mozilla/xpcom/glue/nsDebug.cpp +++ b/mozilla/xpcom/glue/nsDebug.cpp @@ -18,15 +18,8 @@ * Rights Reserved. * * Contributor(s): - * - * This Original Code has been modified by IBM Corporation. Modifications made by IBM - * described herein are Copyright (c) International Business Machines Corporation, 2000. - * Modifications to Mozilla code or documentation identified per MPL Section 3.3 - * - * Date Modified by Description of modification - * 04/10/2000 IBM Corp. Added DebugBreak() definitions for OS/2 - * 06/19/2000 IBM Corp. Fix DebugBreak() messagebox defaults for OS/2 - * 06/19/2000 Henry Sobotka Fix DebugBreak() for OS/2 on retail build. + * IBM Corp. + * Henry Sobotka */ #include "nsDebug.h" @@ -64,28 +57,25 @@ #endif #if defined(XP_OS2) -/* Added definitions for DebugBreak() for 2 different OS/2 compilers. Doing - * the int3 on purpose for Visual Age so that a developer can step over the - * instruction if so desired. Not always possible if trapping due to exception - * handling IBM-AKR - */ -#define INCL_WINDIALOGS // need for WinMessageBox -#include - -#if defined(DEBUG) -#if defined(XP_OS2_VACPP) - #include - #define DebugBreak() { _interrupt(3); } -#elif defined(XP_OS2_EMX) - /* Force a trap */ - #define DebugBreak() { int *pTrap=NULL; *pTrap = 1; } -#else - #define DebugBreak() -#endif - -#else - #define DebugBreak() -#endif /* DEBUG */ + /* Added definitions for DebugBreak() for 2 different OS/2 compilers. Doing + * the int3 on purpose for Visual Age so that a developer can step over the + * instruction if so desired. Not always possible if trapping due to exception + * handling IBM-AKR + */ + #define INCL_WINDIALOGS // need for WinMessageBox + #include + #include + + #if defined(DEBUG) + #if defined(XP_OS2_VACPP) + #include + #define DebugBreak() { _interrupt(3); } + #else + #define DebugBreak() { asm("int $3"); } + #endif + #else + #define DebugBreak() + #endif /* DEBUG */ #endif /* XP_OS2 */ #if defined(_WIN32) diff --git a/mozilla/xpcom/io/nsNativeCharsetUtils.cpp b/mozilla/xpcom/io/nsNativeCharsetUtils.cpp index 98f28c883b0..f9433ba0b36 100644 --- a/mozilla/xpcom/io/nsNativeCharsetUtils.cpp +++ b/mozilla/xpcom/io/nsNativeCharsetUtils.cpp @@ -950,6 +950,10 @@ NS_ShutdownNativeCharsetUtils() #include #include "nsPromiseFlatString.h" +#ifdef XP_OS2_EMX +#include +#endif + static UconvObject UnicodeConverter = NULL; NS_COM nsresult diff --git a/mozilla/xpcom/threads/plevent.c b/mozilla/xpcom/threads/plevent.c index d98d717efaa..cd4c39dc658 100644 --- a/mozilla/xpcom/threads/plevent.c +++ b/mozilla/xpcom/threads/plevent.c @@ -1468,6 +1468,16 @@ static void _md_CreateEventQueue( PLEventQueue *eventQueue ) #endif /* Winxx */ #if defined(XP_OS2) +/* These functions/values are defined in the EMX libraries, but are not declared + in the GCC 3.2.1 headers. */ +#ifdef XP_OS2_EMX +unsigned _control87 (unsigned, unsigned); +#define MCW_EM 0x003f +#define MCW_IC 0x1000 +#define MCW_RC 0x0c00 +#define MCW_PC 0x0300 +#endif + /* ** _md_CreateEventQueue() -- ModelDependent initializer */ @@ -1476,8 +1486,22 @@ static void _md_CreateEventQueue( PLEventQueue *eventQueue ) /* Must have HMQ for this & can't assume we already have appshell */ if( FALSE == WinQueryQueueInfo( HMQ_CURRENT, NULL, 0)) { + unsigned cw; + HAB hab = WinInitialize( 0); + +#ifdef XP_OS2_EMX + /* It seems that WinCreateMsgQueue likes to change the floating point + control word for undocumented reasons. Unfortunately, it causes + floating point exceptions (SIGFPE) to be unmasked, so we crash in + javascript on startup. The two calls to _control87 simply save the + current value of the control word and resets it after the call */ + cw = _control87(0,0); +#endif WinCreateMsgQueue( hab, 0); +#ifdef XP_OS2_EMX + _control87(cw, MCW_EM | MCW_IC | MCW_RC | MCW_PC); +#endif } if( !_pr_PostEventMsgId)