diff --git a/mozilla/db/mork/src/morkFile.cpp b/mozilla/db/mork/src/morkFile.cpp index 083c523b6d0..011056fa81b 100644 --- a/mozilla/db/mork/src/morkFile.cpp +++ b/mozilla/db/mork/src/morkFile.cpp @@ -929,6 +929,7 @@ morkStdioFile::Steal(nsIMdbEnv* ev, nsIMdbFile* ioThief) void mork_fileflush(FILE * file) { fflush(file); +#ifndef WINCE OSVERSIONINFOA vi = { sizeof(OSVERSIONINFOA) }; if ((GetVersionExA(&vi) && vi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)) { @@ -937,6 +938,7 @@ void mork_fileflush(FILE * file) HANDLE fh = (HANDLE)_get_osfhandle(fd); FlushFileBuffers(fh); } +#endif } #endif /*MORK_WIN*/ diff --git a/mozilla/dbm/include/mcom_db.h b/mozilla/dbm/include/mcom_db.h index dcae849f297..f379020d8cc 100644 --- a/mozilla/dbm/include/mcom_db.h +++ b/mozilla/dbm/include/mcom_db.h @@ -74,6 +74,11 @@ #ifndef _DB_H_ #define _DB_H_ + +#ifdef WINCE +#define off_t long +#endif + #ifndef macintosh #include #endif diff --git a/mozilla/dbm/include/winfile.h b/mozilla/dbm/include/winfile.h index 1fd54d57892..36b59f72126 100644 --- a/mozilla/dbm/include/winfile.h +++ b/mozilla/dbm/include/winfile.h @@ -31,7 +31,13 @@ typedef struct DIR_Struct { typedef unsigned long mode_t; typedef long uid_t; typedef long gid_t; + +#ifdef WINCE + typedef long ino_t; +#else typedef long off_t; +#endif + typedef unsigned long nlink_t; #endif diff --git a/mozilla/dbm/src/Makefile.in b/mozilla/dbm/src/Makefile.in index 280c944d12f..8c8f2c10796 100644 --- a/mozilla/dbm/src/Makefile.in +++ b/mozilla/dbm/src/Makefile.in @@ -69,6 +69,10 @@ include $(topsrcdir)/config/rules.mk DEFINES += -DMEMMOVE -D__DBINTERFACE_PRIVATE $(SECURITY_FLAG) +ifeq ($(OS_ARCH),WINCE) +DEFINES += -D__STDC__ -DDBM_REOPEN_ON_FLUSH +endif + ifeq ($(OS_ARCH),AIX) OS_LIBS += -lc_r endif diff --git a/mozilla/dom/src/base/nsDOMClassInfo.cpp b/mozilla/dom/src/base/nsDOMClassInfo.cpp index 1ba9b99f88e..e3f82f911bb 100644 --- a/mozilla/dom/src/base/nsDOMClassInfo.cpp +++ b/mozilla/dom/src/base/nsDOMClassInfo.cpp @@ -139,7 +139,9 @@ #include "nsIJVMManager.h" // Oh, did I mention that I hate Microsoft for doing this to me? +#ifndef WINCE #undef GetClassName +#endif #include "nsILiveConnectManager.h" #include "nsIJVMPluginInstance.h" diff --git a/mozilla/embedding/components/Makefile.in b/mozilla/embedding/components/Makefile.in index f2d7233ea3f..ff16ae9174f 100644 --- a/mozilla/embedding/components/Makefile.in +++ b/mozilla/embedding/components/Makefile.in @@ -48,8 +48,10 @@ include $(DEPTH)/config/autoconf.mk DIRS = windowwatcher appstartup find webbrowserpersist commandhandler ui jsconsole ifdef MOZ_XUL +ifndef WINCE DIRS += printingui endif +endif ifdef MOZ_PROFILESHARING DIRS += profilesharingsetup diff --git a/mozilla/embedding/components/build/Makefile.in b/mozilla/embedding/components/build/Makefile.in index 8a0190850ae..c4eb35a1c3e 100644 --- a/mozilla/embedding/components/build/Makefile.in +++ b/mozilla/embedding/components/build/Makefile.in @@ -97,9 +97,15 @@ SHARED_LIBRARY_LIBS = \ ifdef MOZ_XUL SHARED_LIBRARY_LIBS += \ - $(DIST)/lib/$(LIB_PREFIX)printingui_s.$(LIB_SUFFIX) \ $(DIST)/lib/$(LIB_PREFIX)jsconsole_s.$(LIB_SUFFIX) \ $(NULL) + +ifndef WINCE +SHARED_LIBRARY_LIBS += \ + $(DIST)/lib/$(LIB_PREFIX)printingui_s.$(LIB_SUFFIX) \ + $(NULL) +endif + endif LOCAL_INCLUDES = \ diff --git a/mozilla/embedding/components/build/nsEmbeddingModule.cpp b/mozilla/embedding/components/build/nsEmbeddingModule.cpp index 4df3454cb1e..984f6f7ebe0 100644 --- a/mozilla/embedding/components/build/nsEmbeddingModule.cpp +++ b/mozilla/embedding/components/build/nsEmbeddingModule.cpp @@ -48,7 +48,9 @@ #include "nsControllerCommandTable.h" #include "nsCommandParams.h" #include "nsCommandGroup.h" +#ifndef WINCE #include "nsPrintingPromptService.h" +#endif #include "nsBaseCommandController.h" #include "nsPrompt.h" #include "nsNetCID.h" @@ -117,8 +119,10 @@ nsDefaultAuthPromptConstructor(nsISupports *outer, const nsIID &iid, void **resu NS_GENERIC_FACTORY_CONSTRUCTOR(nsDialogParamBlock) NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPromptService, Init) NS_GENERIC_FACTORY_CONSTRUCTOR(nsJSConsoleService) +#ifndef WINCE NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintingPromptService, Init) #endif +#endif #ifdef MOZ_PROFILESHARING #include "nsProfileSharingSetup.h" @@ -131,7 +135,9 @@ static const nsModuleComponentInfo gComponents[] = { { "Dialog ParamBlock", NS_DIALOGPARAMBLOCK_CID, NS_DIALOGPARAMBLOCK_CONTRACTID, nsDialogParamBlockConstructor }, { "Prompt Service", NS_PROMPTSERVICE_CID, NS_PROMPTSERVICE_CONTRACTID, nsPromptServiceConstructor }, { "JS Console Service", NS_JSCONSOLESERVICE_CID, NS_JSCONSOLESERVICE_CONTRACTID, nsJSConsoleServiceConstructor }, +#ifndef WINCE { "Printing Prompt Service", NS_PRINTINGPROMPTSERVICE_CID, NS_PRINTINGPROMPTSERVICE_CONTRACTID, nsPrintingPromptServiceConstructor }, +#endif #endif { "Window Watcher", NS_WINDOWWATCHER_CID, NS_WINDOWWATCHER_CONTRACTID, nsWindowWatcherConstructor }, { "Find", NS_FIND_CID, NS_FIND_CONTRACTID, nsFindConstructor }, diff --git a/mozilla/extensions/transformiix/source/xpath/ExprLexer.h b/mozilla/extensions/transformiix/source/xpath/ExprLexer.h index fbcb3118fbb..4748a8c13f5 100644 --- a/mozilla/extensions/transformiix/source/xpath/ExprLexer.h +++ b/mozilla/extensions/transformiix/source/xpath/ExprLexer.h @@ -59,8 +59,7 @@ public: */ enum Type { //-- Trivial Tokens - ERROR = 0, - NULL_TOKEN, + NULL_TOKEN = 1, LITERAL, NUMBER, CNAME, diff --git a/mozilla/js/src/Makefile.in b/mozilla/js/src/Makefile.in index df8fe888a2c..7019d964584 100644 --- a/mozilla/js/src/Makefile.in +++ b/mozilla/js/src/Makefile.in @@ -49,7 +49,7 @@ LIBRARY_NAME = mozjs LIB_IS_C_ONLY = 1 GRE_MODULE = 1 -ifeq ($(OS_ARCH),WINNT) +ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH))) LIBRARY_NAME = js$(MOZ_BITS)$(VERSION_NUMBER) RESFILE = js$(MOZ_BITS)40.res endif @@ -145,7 +145,7 @@ EXPORTS = \ jsxml.h \ $(NULL) -ifeq ($(OS_ARCH),WINNT) +ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH))) EXPORTS += jscpucfg.h endif @@ -159,7 +159,7 @@ include $(topsrcdir)/config/config.mk EXTRA_DSO_LDOPTS += $(NSPR_LIBS) -ifeq (,$(filter-out OS2 WINNT,$(OS_ARCH))) +ifeq (,$(filter-out OS2 WINNT WINCE,$(OS_ARCH))) SHARED_LIBRARY_LIBS += $(FDLIBM_LIBRARY) endif @@ -240,7 +240,7 @@ endif LDFLAGS += $(pathsubst -l%,$(NSPR_STATIC_PATH)/%.a,$(NSPR_LIBS)) # BeOS and HP-UX do not require the extra linking of "-lm" -ifeq (,$(filter BeOS HP-UX WINNT OpenVMS,$(OS_ARCH))) +ifeq (,$(filter BeOS HP-UX WINNT WINCE OpenVMS,$(OS_ARCH))) LDFLAGS += -lm endif @@ -352,11 +352,16 @@ ifeq (,$(CROSS_COMPILE)$(filter-out WINNT,$(OS_ARCH))) jsautocfg.h: touch $@ else +ifeq ($(OS_ARCH),WINCE) +jsautocfg.h: + touch $@ +else jsautocfg.h: jscpucfg$(HOST_BIN_SUFFIX) @rm -f $@ jsautocfg.tmp ./jscpucfg > jsautocfg.tmp mv jsautocfg.tmp $@ endif +endif # jscpucfg is a strange target # Needs to be built with the host compiler but needs to include @@ -375,7 +380,12 @@ jscpucfg: jscpucfg.o $(HOST_CC) $(HOST_CFLAGS) $(DEFINES) -o $@ $< endif else +ifeq ($(OS_ARCH),WINCE) +jscpucfg$(HOST_BIN_SUFFIX): + echo no need to build jscpucfg $< +else jscpucfg$(HOST_BIN_SUFFIX): jscpucfg.c Makefile.in $(HOST_CC) $(HOST_CFLAGS) $(DEFINES) $(NSPR_CFLAGS) $(OUTOPTION)$@ $< endif +endif diff --git a/mozilla/js/src/jsapi.c b/mozilla/js/src/jsapi.c index ee124bfb150..5d326fc1e17 100644 --- a/mozilla/js/src/jsapi.c +++ b/mozilla/js/src/jsapi.c @@ -1842,11 +1842,9 @@ CheckStackGrowthDirection(int *dummy1addr, jsuword limitAddr) #if JS_STACK_GROWTH_DIRECTION > 0 JS_ASSERT(dummy1addr < &dummy2); - JS_ASSERT((jsuword)&dummy2 < limitAddr); #else /* Stack grows downward, the common case on modern architectures. */ JS_ASSERT(&dummy2 < dummy1addr); - JS_ASSERT(limitAddr < (jsuword)&dummy2); #endif } #endif diff --git a/mozilla/js/src/jscpucfg.h b/mozilla/js/src/jscpucfg.h index 897ee577cfe..52a38628124 100644 --- a/mozilla/js/src/jscpucfg.h +++ b/mozilla/js/src/jscpucfg.h @@ -87,13 +87,13 @@ #define JS_BYTES_PER_DWORD_LOG2 3L #define PR_WORDS_PER_DWORD_LOG2 1L -#elif defined(XP_WIN) || defined(XP_OS2) +#elif defined(XP_WIN) || defined(XP_OS2) || defined(WINCE) #ifdef __WATCOMC__ #define HAVE_VA_LIST_AS_ARRAY #endif -#if defined( _WIN32) || defined(XP_OS2) +#if defined(_WIN32) || defined(XP_OS2) || defined(WINCE) #define IS_LITTLE_ENDIAN 1 #undef IS_BIG_ENDIAN @@ -137,7 +137,7 @@ #define JS_BYTES_PER_WORD_LOG2 2L #define JS_BYTES_PER_DWORD_LOG2 3L #define PR_WORDS_PER_DWORD_LOG2 1L -#endif /* _WIN32 || XP_OS2 */ +#endif /* _WIN32 || XP_OS2 || WINCE*/ #if defined(_WINDOWS) && !defined(_WIN32) /* WIN16 */ #define IS_LITTLE_ENDIAN 1 diff --git a/mozilla/js/src/jslibmath.h b/mozilla/js/src/jslibmath.h index 6ed874bd6dc..544d8f800b5 100644 --- a/mozilla/js/src/jslibmath.h +++ b/mozilla/js/src/jslibmath.h @@ -119,7 +119,7 @@ #define __P(p) () #endif -#if defined _WIN32 || defined SUNOS4 +#if (defined _WIN32 && !defined WINCE) || defined SUNOS4 #define fd_acos acos #define fd_asin asin diff --git a/mozilla/js/src/jsnum.c b/mozilla/js/src/jsnum.c index a44261e9566..78bd44bbe41 100644 --- a/mozilla/js/src/jsnum.c +++ b/mozilla/js/src/jsnum.c @@ -505,6 +505,7 @@ static jsdouble NaN; #if (defined XP_WIN || defined XP_OS2) && \ + !defined WINCE && \ !defined __MWERKS__ && \ (defined _M_IX86 || \ (defined __GNUC__ && !defined __MINGW32__)) diff --git a/mozilla/js/src/jstypes.h b/mozilla/js/src/jstypes.h index 1d9e98f6ebb..8b5047712a8 100644 --- a/mozilla/js/src/jstypes.h +++ b/mozilla/js/src/jstypes.h @@ -234,7 +234,7 @@ #define JS_MIN(x,y) ((x)<(y)?(x):(y)) #define JS_MAX(x,y) ((x)>(y)?(x):(y)) -#if (defined(XP_MAC) || defined(XP_WIN)) && !defined(CROSS_COMPILE) +#if ((defined(XP_MAC) || defined(XP_WIN)) && !defined(CROSS_COMPILE)) || defined (WINCE) # include "jscpucfg.h" /* Use standard Mac or Windows configuration */ #elif defined(XP_UNIX) || defined(XP_BEOS) || defined(XP_OS2) || defined(CROSS_COMPILE) # include "jsautocfg.h" /* Use auto-detected configuration */ diff --git a/mozilla/layout/base/nsCaret.cpp b/mozilla/layout/base/nsCaret.cpp index db03599c7d6..bb9dcd0470b 100644 --- a/mozilla/layout/base/nsCaret.cpp +++ b/mozilla/layout/base/nsCaret.cpp @@ -170,9 +170,10 @@ NS_IMETHODIMP nsCaret::Init(nsIPresShell *inPresShell) } #ifdef IBMBIDI - PRBool isRTL; + PRBool isRTL = PR_FALSE; mBidiKeyboard = do_GetService("@mozilla.org/widget/bidikeyboard;1"); - mBidiKeyboard->IsLangRTL(&isRTL); + if (mBidiKeyboard) + mBidiKeyboard->IsLangRTL(&isRTL); mKeyboardRTL = isRTL; #endif diff --git a/mozilla/layout/generic/nsSimplePageSequence.cpp b/mozilla/layout/generic/nsSimplePageSequence.cpp index 78269e97b1d..5174492e50f 100644 --- a/mozilla/layout/generic/nsSimplePageSequence.cpp +++ b/mozilla/layout/generic/nsSimplePageSequence.cpp @@ -461,7 +461,7 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext, // Create current Date/Time String if (!mDateFormatter) mDateFormatter = do_CreateInstance(kDateTimeFormatCID); - +#ifndef WINCE NS_ENSURE_TRUE(mDateFormatter, NS_ERROR_FAILURE); nsAutoString formattedDateString; @@ -475,7 +475,7 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext, PRUnichar * uStr = ToNewUnicode(formattedDateString); SetDateTimeStr(uStr); // memory will be freed } - +#endif } // Return our desired size diff --git a/mozilla/modules/plugin/base/src/Makefile.in b/mozilla/modules/plugin/base/src/Makefile.in index 54c5965798c..41b14ad0650 100644 --- a/mozilla/modules/plugin/base/src/Makefile.in +++ b/mozilla/modules/plugin/base/src/Makefile.in @@ -100,7 +100,7 @@ ifeq ($(OS_ARCH), BeOS) CPPSRCS += nsPluginsDirBeOS.cpp CPPSRCS += nsPluginNativeWindow.cpp else -ifeq ($(OS_ARCH),WINNT) +ifneq (,$(filter WINNT WINCE,$(MOZ_WIDGET_TOOLKIT))) CPPSRCS += nsPluginsDirWin.cpp CPPSRCS += nsPluginNativeWindowWin.cpp else diff --git a/mozilla/parser/htmlparser/public/nsIHTMLContentSink.h b/mozilla/parser/htmlparser/public/nsIHTMLContentSink.h index c5430fd4e45..d36252f679f 100644 --- a/mozilla/parser/htmlparser/public/nsIHTMLContentSink.h +++ b/mozilla/parser/htmlparser/public/nsIHTMLContentSink.h @@ -88,8 +88,10 @@ #define NS_IHTML_CONTENT_SINK_IID \ { 0x59929de5, 0xe60b, 0x48b1,{0x81, 0x69, 0x48, 0x47, 0xb5, 0xc9, 0x44, 0x29}} -#ifdef XP_MAC +#if defined(XP_MAC) || defined(WINCE) #define MAX_REFLOW_DEPTH 75 //setting to 75 to prevent layout from crashing on mac. Bug 55095. + //We will also change this for WinCE as it usually has a strict + //memory upper limit (no vm, ~32mb) #else #define MAX_REFLOW_DEPTH 200 //windows and linux (etc) can do much deeper structures. #endif diff --git a/mozilla/view/src/nsViewManager.cpp b/mozilla/view/src/nsViewManager.cpp index 927b84f8321..48d7253a4e6 100644 --- a/mozilla/view/src/nsViewManager.cpp +++ b/mozilla/view/src/nsViewManager.cpp @@ -1681,6 +1681,11 @@ AccumulateIntersectionsIntoDirtyRegion(nsView* aTargetView, } } +// This gets around an internal compiler error C1001 +// (compiler file 'E:\8799\vc98\p2\src\P2\main.c', line 494) +#ifdef WINCE +#pragma optimize( "", off ) +#endif void nsViewManager::WillBitBlit(nsView* aView, nsPoint aScrollAmount) { @@ -1698,6 +1703,10 @@ nsViewManager::WillBitBlit(nsView* aView, nsPoint aScrollAmount) // offset we want to use when accumulating dirty rects. AccumulateIntersectionsIntoDirtyRegion(aView, GetRootView(), -aScrollAmount); } +#ifdef WINCE +#pragma optimize( "", on ) +#endif + // Invalidate all widgets which overlap the view, other than the view's own widgets. void diff --git a/mozilla/widget/src/windows/nsWindow.cpp b/mozilla/widget/src/windows/nsWindow.cpp index 9c28c83adfd..838bbb60d50 100644 --- a/mozilla/widget/src/windows/nsWindow.cpp +++ b/mozilla/widget/src/windows/nsWindow.cpp @@ -2741,6 +2741,9 @@ HBITMAP nsWindow::DataToBitmap(PRUint8* aImageData, PRUint32 aHeight, PRUint32 aDepth) { +#ifdef WINCE + return NULL; +#else if (aDepth == 8 || aDepth == 4) { NS_WARNING("nsWindow::DataToBitmap can't handle 4 or 8 bit images"); return NULL; @@ -2790,7 +2793,6 @@ HBITMAP nsWindow::DataToBitmap(PRUint8* aImageData, return bmp; } - BITMAPINFOHEADER head = { 0 }; head.biSize = sizeof(BITMAPINFOHEADER); @@ -2824,6 +2826,7 @@ HBITMAP nsWindow::DataToBitmap(PRUint8* aImageData, ::DeleteObject(tBitmap); ::DeleteDC(dc); return bmp; +#endif } // static @@ -3640,6 +3643,7 @@ BOOL nsWindow::OnChar(UINT charCode, PRUint32 aFlags) #ifdef KE_DEBUG printf("%s\tchar=%c\twp=%4x\tlp=%8x\n", (msg == WM_SYSCHAR) ? "WM_SYSCHAR" : "WM_CHAR" , wParam, wParam, lParam); #endif + // These must be checked here too as a lone WM_CHAR could be received // if a child window didn't handle it (for example Alt+Space in a content window) mIsShiftDown = IS_VK_DOWN(NS_VK_SHIFT); @@ -4398,6 +4402,7 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT case WM_SYSKEYUP: case WM_KEYUP: + #ifdef KE_DEBUG printf("%s\t\twp=%x\tlp=%x\n", (WM_KEYUP==msg) ? "WM_KEYUP" : "WM_SYSKEYUP", wParam, lParam); #endif @@ -5899,7 +5904,6 @@ PRBool nsWindow::DispatchMouseEvent(PRUint32 aEventType, WPARAM wParam, nsPoint* result = DispatchWindowEvent(&event); if (aEventType == NS_MOUSE_MOVE) { - // if we are not in mouse capture mode (mouse down and hold) // then use "this" window // if we are in mouse capture, then all events are being directed @@ -5975,7 +5979,6 @@ PRBool nsWindow::DispatchMouseEvent(PRUint32 aEventType, WPARAM wParam, nsPoint* // Release the widget with NS_IF_RELEASE() just in case // the context menu key code in nsEventListenerManager::HandleEvent() // released it already. - NS_IF_RELEASE(event.widget); return result; } @@ -6013,6 +6016,7 @@ PRBool nsWindow::DispatchMouseEvent(PRUint32 aEventType, WPARAM wParam, nsPoint* break; } // switch } + NS_RELEASE(event.widget); return result; } @@ -6372,6 +6376,9 @@ nsWindow::HandleTextEvent(HIMC hIMEContext,PRBool aCheckAttr) BOOL nsWindow::HandleStartComposition(HIMC hIMEContext) { +#ifdef WINCE + return false; +#endif // ATOK send the messages following order at starting composition. // 1. WM_IME_COMPOSITION // 2. WM_IME_STARTCOMPOSITION