diff --git a/mozilla/base/macbuild/base.mcp b/mozilla/base/macbuild/base.mcp index 2b2a344a0c7..c46ac17b79e 100644 Binary files a/mozilla/base/macbuild/base.mcp and b/mozilla/base/macbuild/base.mcp differ diff --git a/mozilla/base/src/nscore.h b/mozilla/base/src/nscore.h index 2eecf758a4d..2cba7e48115 100644 --- a/mozilla/base/src/nscore.h +++ b/mozilla/base/src/nscore.h @@ -73,8 +73,8 @@ typedef PRUcs2 PRUnichar; #undef NS_EXPORT #undef NS_EXPORT_ -#define NS_EXPORT -#define NS_EXPORT_(type) type +#define NS_EXPORT __declspec(export) +#define NS_EXPORT_(type) type __declspec(export) #else /* XXX do something useful? */ diff --git a/mozilla/build/mac/NGLayoutBuildList.pm b/mozilla/build/mac/NGLayoutBuildList.pm index edc6519feb1..32038db9f7d 100644 --- a/mozilla/build/mac/NGLayoutBuildList.pm +++ b/mozilla/build/mac/NGLayoutBuildList.pm @@ -117,8 +117,12 @@ sub Checkout() #// if ($main::pull{all}) { - $session->checkout("RaptorMac") || die "checkout failure"; - $session->checkout("mozilla/modules/libpref") || die "checkout failure"; + $session->checkout("RaptorMac") || die "checkout failure"; + #//$session->checkout("mozilla/modules/libpref") || die "checkout failure"; + + #// beard: additional libraries needed to make shared libraries link. + #//$session->checkout("mozilla/lib/mac/PowerPlant") || die "checkout failure"; + #//$session->checkout("mozilla/lib/xlate") || die "checkout failure"; } } @@ -141,21 +145,21 @@ sub BuildDist() #MAC_COMMON InstallFromManifest(":mozilla:build:mac:MANIFEST", "$distdirectory:mac:common:"); InstallFromManifest(":mozilla:lib:mac:NSStdLib:include:MANIFEST", "$distdirectory:mac:common:"); - InstallFromManifest(":mozilla:lib:mac:MacMemoryAllocator:include:MANIFEST", "$distdirectory:mac:common:"); + InstallFromManifest(":mozilla:lib:mac:MacMemoryAllocator:include:MANIFEST", "$distdirectory:mac:common:"); InstallFromManifest(":mozilla:lib:mac:Misc:MANIFEST", "$distdirectory:mac:common:"); InstallFromManifest(":mozilla:lib:mac:MoreFiles:MANIFEST", "$distdirectory:mac:common:morefiles:"); #INCLUDE - InstallFromManifest(":mozilla:config:mac:MANIFEST", "$distdirectory:config:"); + InstallFromManifest(":mozilla:config:mac:MANIFEST", "$distdirectory:config:"); InstallFromManifest(":mozilla:config:mac:MANIFEST_config", "$distdirectory:config:"); InstallFromManifest(":mozilla:include:MANIFEST", "$distdirectory:include:"); InstallFromManifest(":mozilla:cmd:macfe:pch:MANIFEST", "$distdirectory:include:"); InstallFromManifest(":mozilla:cmd:macfe:utility:MANIFEST", "$distdirectory:include:"); #NSPR - InstallFromManifest(":mozilla:nsprpub:pr:include:MANIFEST", "$distdirectory:nspr:"); + InstallFromManifest(":mozilla:nsprpub:pr:include:MANIFEST", "$distdirectory:nspr:"); InstallFromManifest(":mozilla:nsprpub:pr:src:md:mac:MANIFEST", "$distdirectory:nspr:mac:"); - InstallFromManifest(":mozilla:nsprpub:lib:ds:MANIFEST", "$distdirectory:nspr:"); + InstallFromManifest(":mozilla:nsprpub:lib:ds:MANIFEST", "$distdirectory:nspr:"); InstallFromManifest(":mozilla:nsprpub:lib:libc:include:MANIFEST", "$distdirectory:nspr:"); InstallFromManifest(":mozilla:nsprpub:lib:msgc:include:MANIFEST", "$distdirectory:nspr:"); @@ -163,58 +167,58 @@ sub BuildDist() InstallFromManifest(":mozilla:jpeg:MANIFEST", "$distdirectory:jpeg:"); #LIBREG - InstallFromManifest(":mozilla:modules:libreg:include:MANIFEST", "$distdirectory:libreg:"); + InstallFromManifest(":mozilla:modules:libreg:include:MANIFEST", "$distdirectory:libreg:"); #XPCOM - InstallFromManifest(":mozilla:xpcom:public:MANIFEST", "$distdirectory:xpcom:"); + InstallFromManifest(":mozilla:xpcom:public:MANIFEST", "$distdirectory:xpcom:"); #ZLIB InstallFromManifest(":mozilla:modules:zlib:src:MANIFEST", "$distdirectory:zlib:"); #LIBUTIL - InstallFromManifest(":mozilla:modules:libutil:public:MANIFEST", "$distdirectory:libutil:"); + InstallFromManifest(":mozilla:modules:libutil:public:MANIFEST", "$distdirectory:libutil:"); #SUN_JAVA - InstallFromManifest(":mozilla:sun-java:stubs:include:MANIFEST", "$distdirectory:sun-java:"); + InstallFromManifest(":mozilla:sun-java:stubs:include:MANIFEST", "$distdirectory:sun-java:"); InstallFromManifest(":mozilla:sun-java:stubs:macjri:MANIFEST", "$distdirectory:sun-java:"); #NAV_JAVA - InstallFromManifest(":mozilla:nav-java:stubs:include:MANIFEST", "$distdirectory:nav-java:"); + InstallFromManifest(":mozilla:nav-java:stubs:include:MANIFEST", "$distdirectory:nav-java:"); InstallFromManifest(":mozilla:nav-java:stubs:macjri:MANIFEST", "$distdirectory:nav-java:"); #JS - InstallFromManifest(":mozilla:js:src:MANIFEST", "$distdirectory:js:"); + InstallFromManifest(":mozilla:js:src:MANIFEST", "$distdirectory:js:"); #SECURITY_freenav InstallFromManifest(":mozilla:modules:security:freenav:MANIFEST", "$distdirectory:security:"); #LIBPREF - InstallFromManifest(":mozilla:modules:libpref:public:MANIFEST", "$distdirectory:libpref:"); + InstallFromManifest(":mozilla:modules:libpref:public:MANIFEST", "$distdirectory:libpref:"); #LIBIMAGE - InstallFromManifest(":mozilla:modules:libimg:png:MANIFEST", "$distdirectory:libimg:"); - InstallFromManifest(":mozilla:modules:libimg:src:MANIFEST", "$distdirectory:libimg:"); + InstallFromManifest(":mozilla:modules:libimg:png:MANIFEST", "$distdirectory:libimg:"); + InstallFromManifest(":mozilla:modules:libimg:src:MANIFEST", "$distdirectory:libimg:"); InstallFromManifest(":mozilla:modules:libimg:public:MANIFEST", "$distdirectory:libimg:"); #PLUGIN InstallFromManifest(":mozilla:modules:plugin:nglsrc:MANIFEST", "$distdirectory:plugin:"); InstallFromManifest(":mozilla:modules:plugin:public:MANIFEST", "$distdirectory:plugin:"); - InstallFromManifest(":mozilla:modules:plugin:src:MANIFEST", "$distdirectory:plugin:"); + InstallFromManifest(":mozilla:modules:plugin:src:MANIFEST", "$distdirectory:plugin:"); InstallFromManifest(":mozilla:modules:oji:src:MANIFEST", "$distdirectory:oji:"); - InstallFromManifest(":mozilla:modules:oji:public:MANIFEST", "$distdirectory:oji:"); + InstallFromManifest(":mozilla:modules:oji:public:MANIFEST", "$distdirectory:oji:"); #LAYERS (IS THIS STILL NEEDED) InstallFromManifest(":mozilla:lib:liblayer:include:MANIFEST", "$distdirectory:layers:"); #NETWORK InstallFromManifest(":mozilla:network:cache:MANIFEST", "$distdirectory:network:"); - InstallFromManifest(":mozilla:network:client:MANIFEST", "$distdirectory:network:"); + InstallFromManifest(":mozilla:network:client:MANIFEST", "$distdirectory:network:"); InstallFromManifest(":mozilla:network:cnvts:MANIFEST", "$distdirectory:network:"); InstallFromManifest(":mozilla:network:cstream:MANIFEST", "$distdirectory:network:"); InstallFromManifest(":mozilla:network:main:MANIFEST", "$distdirectory:network:"); InstallFromManifest(":mozilla:network:mimetype:MANIFEST", "$distdirectory:network:"); InstallFromManifest(":mozilla:network:util:MANIFEST", "$distdirectory:network:"); - InstallFromManifest(":mozilla:network:protocol:about:MANIFEST", "$distdirectory:network:"); + InstallFromManifest(":mozilla:network:protocol:about:MANIFEST", "$distdirectory:network:"); InstallFromManifest(":mozilla:network:protocol:certld:MANIFEST", "$distdirectory:network:"); InstallFromManifest(":mozilla:network:protocol:dataurl:MANIFEST", "$distdirectory:network:"); InstallFromManifest(":mozilla:network:protocol:file:MANIFEST", "$distdirectory:network:"); @@ -228,7 +232,7 @@ sub BuildDist() InstallFromManifest(":mozilla:network:protocol:pop3:MANIFEST", "$distdirectory:network:"); InstallFromManifest(":mozilla:network:protocol:remote:MANIFEST", "$distdirectory:network:"); InstallFromManifest(":mozilla:network:protocol:smtp:MANIFEST", "$distdirectory:network:"); - InstallFromManifest(":mozilla:network:module:MANIFEST", "$distdirectory:network:module"); + InstallFromManifest(":mozilla:network:module:MANIFEST", "$distdirectory:network:module"); #BASE InstallFromManifest(":mozilla:base:src:MANIFEST", "$distdirectory:base:"); @@ -239,7 +243,7 @@ sub BuildDist() #LAYOUT InstallFromManifest(":mozilla:layout:build:MANIFEST", "$distdirectory:layout:"); - InstallFromManifest(":mozilla:layout:base:public:MANIFEST", "$distdirectory:layout:"); + InstallFromManifest(":mozilla:layout:base:public:MANIFEST", "$distdirectory:layout:"); InstallFromManifest(":mozilla:layout:html:style:public:MANIFEST", "$distdirectory:layout:"); InstallFromManifest(":mozilla:layout:html:base:src:MANIFEST", "$distdirectory:layout:"); InstallFromManifest(":mozilla:layout:base:src:MANIFEST", "$distdirectory:layout:"); @@ -248,10 +252,10 @@ sub BuildDist() #WIDGET InstallFromManifest(":mozilla:widget:public:MANIFEST", "$distdirectory:widget:"); - InstallFromManifest(":mozilla:widget:src:mac:MANIFEST", "$distdirectory:widget:"); + InstallFromManifest(":mozilla:widget:src:mac:MANIFEST", "$distdirectory:widget:"); #GFX - InstallFromManifest(":mozilla:gfx:src:MANIFEST", "$distdirectory:gfx:"); + InstallFromManifest(":mozilla:gfx:src:MANIFEST", "$distdirectory:gfx:"); InstallFromManifest(":mozilla:gfx:public:MANIFEST", "$distdirectory:gfx:"); #VIEW @@ -262,7 +266,7 @@ sub BuildDist() InstallFromManifest(":mozilla:dom:public:coreDom:MANIFEST", "$distdirectory:dom:"); InstallFromManifest(":mozilla:dom:public:coreEvents:MANIFEST", "$distdirectory:dom:"); InstallFromManifest(":mozilla:dom:public:events:MANIFEST", "$distdirectory:dom:"); - InstallFromManifest(":mozilla:dom:public:html:MANIFEST", "$distdirectory:dom:"); + InstallFromManifest(":mozilla:dom:public:html:MANIFEST", "$distdirectory:dom:"); InstallFromManifest(":mozilla:dom:public:css:MANIFEST", "$distdirectory:dom:"); InstallFromManifest(":mozilla:dom:src:jsurl:MANIFEST", "$distdirectory:dom:"); @@ -298,6 +302,11 @@ sub BuildCommonProjects() Moz::BuildProjectClean(":mozilla:lib:mac:NSRuntime:NSRuntime.mcp", "Stubs"); Moz::BuildProjectClean(":mozilla:cmd:macfe:projects:client:Client.mcp", "Stubs"); + #// + #// Stub libraries + #// + BuildProject(":mozilla:modules:security:freenav:macbuild:NoSecurity.mcp", "Security.o"); + #// #// Shared libraries #// @@ -341,30 +350,14 @@ sub BuildCommonProjects() BuildProject(":mozilla:modules:zlib:macbuild:zlib.mcp", "zlib$D.shlb"); MakeAlias(":mozilla:modules:zlib:macbuild:zlib$D.shlb", "$dist_dir"); $main::DEBUG ? MakeAlias(":mozilla:modules:zlib:macbuild:zlib$D.shlb.xSYM", "$dist_dir") : 0; - - #// - #// Static libraries - #// - if ($main::SHARED) - { - BuildProject(":mozilla:xpcom:macbuild:xpcomPPC.mcp", "xpcom$D.shlb"); - $main::DEBUG ? MakeAlias(":mozilla:xpcom:macbuild:xpcom$D.shlb.xSYM", "$dist_dir") : 0; - BuildProject(":mozilla:modules:security:freenav:macbuild:NoSecurity.mcp", "Security.o"); - BuildProject(":mozilla:modules:libimg:macbuild:png.mcp", "png$D.o"); - BuildProject(":mozilla:modules:libimg:macbuild:libimg.mcp", "libimg$D.o (standalone)"); + BuildProject(":mozilla:xpcom:macbuild:xpcomPPC.mcp", "xpcom$D.shlb"); + MakeAlias(":mozilla:xpcom:macbuild:xpcom$D.shlb", "$dist_dir"); + $main::DEBUG ? MakeAlias(":mozilla:xpcom:macbuild:xpcom$D.shlb.xSYM", "$dist_dir") : 0; - BuildProject(":mozilla:network:macbuild:network.mcp", "network$D.shlb"); - $main::DEBUG ? MakeAlias(":mozilla:network:macbuild:network$D.shlb.xSYM", "$dist_dir") : 0; - } - else - { - BuildProject(":mozilla:xpcom:macbuild:xpcomPPC.mcp", "xpcom$D.o"); - BuildProject(":mozilla:modules:security:freenav:macbuild:NoSecurity.mcp", "Security.o"); - BuildProject(":mozilla:modules:libimg:macbuild:png.mcp", "png$D.o"); - BuildProject(":mozilla:modules:libimg:macbuild:libimg.mcp", "libimg$D.o (standalone)"); - BuildProject(":mozilla:network:macbuild:network.mcp", "NetworkModular$D.o"); - } + BuildProject(":mozilla:modules:libpref:macbuild:libpref.mcp", "libpref$D.shlb"); + MakeAlias(":mozilla:modules:libpref:macbuild:libpref$D.shlb", "$dist_dir"); + $main::DEBUG ? MakeAlias(":mozilla:modules:libpref:macbuild:libpref$D.shlb.xSYM", "$dist_dir") : 0; } @@ -400,72 +393,76 @@ sub BuildLayoutProjects() # $D becomes a suffix to target names for selecting either the debug or non-debug target of a project my($D) = $main::DEBUG ? "Debug" : ""; my($dist_dir) = _getDistDirectory(); - + #// #// Make aliases of resource files #// my($resource_dir) = "$dist_dir" . "res:"; - MakeAlias(":mozilla:layout:html:document:src:ua.css", "$resource_dir"); + MakeAlias(":mozilla:layout:html:document:src:ua.css", "$resource_dir"); my($html_dir) = "$resource_dir" . "html:"; - MakeAlias(":mozilla:layout:html:base:src:broken-image.gif", "$html_dir"); + MakeAlias(":mozilla:layout:html:base:src:broken-image.gif", "$html_dir"); my($throbber_dir) = "$resource_dir" . "throbber:"; - BuildResourceAliases(":mozilla:webshell:tests:viewer:throbber:", "$throbber_dir"); + BuildResourceAliases(":mozilla:webshell:tests:viewer:throbber:", "$throbber_dir"); my($samples_dir) = "$resource_dir" . "samples:"; - BuildResourceAliases(":mozilla:webshell:tests:viewer:samples:", "$samples_dir"); + BuildResourceAliases(":mozilla:webshell:tests:viewer:samples:", "$samples_dir"); my($chrome_dir) = "$resource_dir" . "chrome:"; - BuildResourceAliases(":mozilla:xpfe:xpviewer:src:resources:chrome:", "$chrome_dir"); + BuildResourceAliases(":mozilla:xpfe:xpviewer:src:resources:chrome:", "$chrome_dir"); my($toolbar_dir) = "$resource_dir" . "toolbar:"; - BuildResourceAliases(":mozilla:xpfe:xpviewer:src:resources:toolbar:", "$toolbar_dir"); + BuildResourceAliases(":mozilla:xpfe:xpviewer:src:resources:toolbar:", "$toolbar_dir"); #// #// Build Layout projects #// - if ($main::SHARED) - { - BuildProject(":mozilla:base:macbuild:base.mcp", "base$D.o"); - #BuildProject(":mozilla:base:macbuild:base.mcp", "base$D.shlb"); - #$main::DEBUG ? MakeAlias(":mozilla:base:macbuild:base$D.shlb.xSYM", "$dist_dir") : 0; + BuildProject(":mozilla:base:macbuild:base.mcp", "base$D.shlb"); + MakeAlias(":mozilla:base:macbuild:base$D.shlb", "$dist_dir"); + + BuildProject(":mozilla:modules:libutil:macbuild:libutil.mcp", "libutil$D.shlb"); + MakeAlias(":mozilla:modules:libutil:macbuild:libutil$D.shlb", "$dist_dir"); + $main::DEBUG ? MakeAlias(":mozilla:modules:libutil:macbuild:libutil$D.shlb.xSYM", "$dist_dir") : 0; - BuildProject(":mozilla:htmlparser:macbuild:htmlparser.mcp", "htmlparser$D.shlb"); - $main::DEBUG ? MakeAlias(":mozilla:htmlparser:macbuild:htmlparser$D.shlb.xSYM", "$dist_dir") : 0; - - BuildProject(":mozilla:dom:macbuild:dom.mcp", "dom$D.shlb"); - $main::DEBUG ? MakeAlias(":mozilla:dom:macbuild:dom$D.shlb.xSYM", "$dist_dir") : 0; + BuildProject(":mozilla:modules:libimg:macbuild:png.mcp", "png$D.o"); + BuildProject(":mozilla:modules:libimg:macbuild:libimg.mcp", "libimg$D.shlb"); + MakeAlias(":mozilla:modules:libimg:macbuild:libimg$D.shlb", "$dist_dir"); + $main::DEBUG ? MakeAlias(":mozilla:modules:libimg:macbuild:libimg$D.shlb.xSYM", "$dist_dir") : 0; - BuildProject(":mozilla:gfx:macbuild:gfx.mcp", "gfx$D.shlb"); - $main::DEBUG ? MakeAlias(":mozilla:gfx:macbuild:gfx$D.shlb.xSYM", "$dist_dir") : 0; + #// beard: now depends on libimg. + BuildProject(":mozilla:network:macbuild:network.mcp", "NetworkModular$D.shlb"); + MakeAlias(":mozilla:network:macbuild:NetworkModular$D.shlb", "$dist_dir"); + $main::DEBUG ? MakeAlias(":mozilla:network:macbuild:NetworkModular$D.shlb", "$dist_dir") : 0; - BuildProject(":mozilla:layout:macbuild:layout.mcp", "layout$D.shlb"); - $main::DEBUG ? MakeAlias(":mozilla:layout:macbuild:layout$D.shlb.xSYM", "$dist_dir") : 0; + BuildProject(":mozilla:htmlparser:macbuild:htmlparser.mcp", "htmlparser$D.shlb"); + MakeAlias(":mozilla:htmlparser:macbuild:htmlparser$D.shlb", "$dist_dir"); + + BuildProject(":mozilla:dom:macbuild:dom.mcp", "dom$D.shlb"); + MakeAlias(":mozilla:dom:macbuild:dom$D.shlb", "$dist_dir") ; - BuildProject(":mozilla:view:macbuild:view.mcp", "view$D.shlb"); - $main::DEBUG ? MakeAlias(":mozilla:view:macbuild:view$D.shlb.xSYM", "$dist_dir") : 0; + BuildProject(":mozilla:gfx:macbuild:gfx.mcp", "gfx$D.shlb"); + MakeAlias(":mozilla:gfx:macbuild:gfx$D.shlb", "$dist_dir"); + + BuildProject(":mozilla:layout:macbuild:layout.mcp", "layout$D.shlb"); + MakeAlias(":mozilla:layout:macbuild:layout$D.shlb", "$dist_dir"); + + BuildProject(":mozilla:view:macbuild:view.mcp", "view$D.shlb"); + MakeAlias(":mozilla:view:macbuild:view$D.shlb", "$dist_dir"); + $main::DEBUG ? MakeAlias(":mozilla:view:macbuild:view$D.shlb.xSYM", "$dist_dir") : 0; - BuildProject(":mozilla:widget:macbuild:widget.mcp", "widget$D.shlb"); - $main::DEBUG ? MakeAlias(":mozilla:widget:macbuild:widget$D.shlb.xSYM", "$dist_dir") : 0; + #// PowerPlant now used by widget, etc. + BuildProject(":mozilla:lib:mac:PowerPlant:PowerPlant.mcp", "PowerPlant$D.shlb"); + MakeAlias(":mozilla:lib:mac:PowerPlant:PowerPlant$D.shlb", "$dist_dir"); - BuildProject(":mozilla:webshell:macbuild:webshell.mcp", "webshell$D.shlb"); - $main::DEBUG ? MakeAlias(":mozilla:webshell:macbuild:webshell$D.shlb.xSYM", "$dist_dir") : 0; - } - else - { - BuildProject(":mozilla:base:macbuild:base.mcp", "base$D.o"); - BuildProject(":mozilla:htmlparser:macbuild:htmlparser.mcp", "htmlparser$D.o"); - BuildProject(":mozilla:dom:macbuild:dom.mcp", "dom$D.o"); - BuildProject(":mozilla:gfx:macbuild:gfx.mcp", "gfx$D.o"); - BuildProject(":mozilla:layout:macbuild:layout.mcp", "layout$D.o"); - BuildProject(":mozilla:view:macbuild:view.mcp", "view$D.o"); - BuildProject(":mozilla:widget:macbuild:widget.mcp", "widget$D.o"); - BuildProject(":mozilla:webshell:macbuild:webshell.mcp", "webshell$D.o"); - } - - BuildProject(":mozilla:webshell:tests:viewer:mac:viewer.mcp", "viewer$D"); - BuildProject(":mozilla:xpfe:macbuild:xpfeviewer.mcp", "xpfeViewer$D"); + BuildProject(":mozilla:widget:macbuild:widget.mcp", "widget$D.shlb"); + MakeAlias(":mozilla:widget:macbuild:widget$D.shlb", "$dist_dir"); + + BuildProject(":mozilla:webshell:macbuild:webshell.mcp", "webshell$D.shlb"); + MakeAlias(":mozilla:webshell:macbuild:webshell$D.shlb", "$dist_dir"); + + BuildProject(":mozilla:webshell:tests:viewer:mac:viewer.mcp", "viewer$D"); + BuildProject(":mozilla:xpfe:macbuild:xpfeviewer.mcp", "xpfeViewer$D"); } diff --git a/mozilla/cmd/macfe/utility/xp_file_mac.cp b/mozilla/cmd/macfe/utility/xp_file_mac.cp index 4556694c926..c0aa77bbd85 100644 --- a/mozilla/cmd/macfe/utility/xp_file_mac.cp +++ b/mozilla/cmd/macfe/utility/xp_file_mac.cp @@ -31,7 +31,8 @@ #include "FSpCompat.h" #include "FileCopy.h" #include "PascalString.h" -#include "Files.h" +#include +#include #include #include "cstring.h" diff --git a/mozilla/dom/macbuild/dom.mcp b/mozilla/dom/macbuild/dom.mcp index bc46c047b37..e08d8cb361e 100644 Binary files a/mozilla/dom/macbuild/dom.mcp and b/mozilla/dom/macbuild/dom.mcp differ diff --git a/mozilla/dom/src/build/nsDOMFactory.cpp b/mozilla/dom/src/build/nsDOMFactory.cpp index e07d4c2fd1e..f2ace3f306f 100644 --- a/mozilla/dom/src/build/nsDOMFactory.cpp +++ b/mozilla/dom/src/build/nsDOMFactory.cpp @@ -660,10 +660,10 @@ nsresult nsDOMFactory::LockFactory(PRBool aLock) } // return the proper factory to the caller -#ifdef XP_MAC +#if defined(XP_MAC) && defined(MAC_STATIC) extern "C" NS_DOM nsresult NSGetFactory_DOM_DLL(const nsCID &aClass, nsIFactory **aFactory) #else -extern "C" NS_DOM nsresult NSGetFactory(const nsCID &aClass, nsIFactory **aFactory) +extern "C" NS_DOM NS_EXPORT_(nsresult) NSGetFactory(const nsCID &aClass, nsIFactory **aFactory) #endif { if (nsnull == aFactory) { diff --git a/mozilla/gfx/macbuild/GFXSharedDebugPrefix.h b/mozilla/gfx/macbuild/GFXSharedDebugPrefix.h index c217a4f93fc..e03bec4fbab 100644 --- a/mozilla/gfx/macbuild/GFXSharedDebugPrefix.h +++ b/mozilla/gfx/macbuild/GFXSharedDebugPrefix.h @@ -16,6 +16,6 @@ * Reserved. */ -#define GFX_SHARED 1 +#define _IMPL_NS_GFX 1 #include "MacPrefix_debug.h" \ No newline at end of file diff --git a/mozilla/gfx/macbuild/GFXSharedPrefix.h b/mozilla/gfx/macbuild/GFXSharedPrefix.h index c7152329892..2e4f7799227 100644 --- a/mozilla/gfx/macbuild/GFXSharedPrefix.h +++ b/mozilla/gfx/macbuild/GFXSharedPrefix.h @@ -16,6 +16,6 @@ * Reserved. */ -#define GFX_SHARED 1 +#define _IMPL_NS_GFX 1 -#include "MacPrefix.h" \ No newline at end of file +#include "MacSharedPrefix.h" diff --git a/mozilla/gfx/macbuild/gfx.mcp b/mozilla/gfx/macbuild/gfx.mcp index e077ce0a611..24a5826a350 100644 Binary files a/mozilla/gfx/macbuild/gfx.mcp and b/mozilla/gfx/macbuild/gfx.mcp differ diff --git a/mozilla/gfx/src/mac/nsFontMetricsMac.cpp b/mozilla/gfx/src/mac/nsFontMetricsMac.cpp index a35e35c02bd..23414d336a6 100644 --- a/mozilla/gfx/src/mac/nsFontMetricsMac.cpp +++ b/mozilla/gfx/src/mac/nsFontMetricsMac.cpp @@ -179,7 +179,7 @@ NS_IMETHODIMP nsFontMetricsMac :: GetFontHandle(nsFontHandle &aHandle) //------------------------------------------------------------------------ -void nsFontMetricsMac :: SetFont(const nsFont& aFont, nsIDeviceContext* aContext) +NS_GFX void nsFontMetricsMac :: SetFont(const nsFont& aFont, nsIDeviceContext* aContext) { short fontNum; //¥TODO?: This is not very efficient. Look in nsDeviceContextMac::GetMacFontNumber() diff --git a/mozilla/gfx/src/mac/nsGfxFactoryMac.cpp b/mozilla/gfx/src/mac/nsGfxFactoryMac.cpp index e2322a6c2e9..a232444bae8 100644 --- a/mozilla/gfx/src/mac/nsGfxFactoryMac.cpp +++ b/mozilla/gfx/src/mac/nsGfxFactoryMac.cpp @@ -160,12 +160,10 @@ nsresult nsGfxFactoryMac::LockFactory(PRBool aLock) } // return the proper factory to the caller -#ifdef MAC_STATIC -extern "C" NS_GFXNONXP nsresult NSGetFactory_GFXWIN_DLL(const nsCID &aClass, nsIFactory **aFactory) -#elif defined(MAC_SHARED) -#pragma export on -extern "C" NS_GFXNONXP nsresult NSGetFactory(const nsCID &aClass, nsIFactory **aFactory) -#pragma export off +#if defined(XP_MAC) && defined(MAC_STATIC) +extern "C" NS_GFX nsresult NSGetFactory_GFXWIN_DLL(const nsCID &aClass, nsIFactory **aFactory) +#else +extern "C" NS_GFX nsresult NSGetFactory(const nsCID &aClass, nsIFactory **aFactory) #endif { if (nsnull == aFactory) { diff --git a/mozilla/htmlparser/macbuild/htmlparser.mcp b/mozilla/htmlparser/macbuild/htmlparser.mcp index b09981ee3f9..366a4f01a1e 100644 Binary files a/mozilla/htmlparser/macbuild/htmlparser.mcp and b/mozilla/htmlparser/macbuild/htmlparser.mcp differ diff --git a/mozilla/htmlparser/src/nsParserFactory.cpp b/mozilla/htmlparser/src/nsParserFactory.cpp index ac27179b434..a3e5540234f 100644 --- a/mozilla/htmlparser/src/nsParserFactory.cpp +++ b/mozilla/htmlparser/src/nsParserFactory.cpp @@ -158,7 +158,7 @@ nsresult nsParserFactory::LockFactory(PRBool aLock) } // return the proper factory to the caller -#ifdef XP_MAC +#if defined(XP_MAC) && defined(MAC_STATIC) extern "C" NS_EXPORT nsresult NSGetFactory_PARSER_DLL(const nsCID &aClass, nsIFactory **aFactory) #else extern "C" NS_EXPORT nsresult NSGetFactory(const nsCID &aClass, nsIFactory **aFactory) diff --git a/mozilla/jpeg/macbuild/JPEG.mcp b/mozilla/jpeg/macbuild/JPEG.mcp index dbf74ce88d9..e1fa0448447 100644 Binary files a/mozilla/jpeg/macbuild/JPEG.mcp and b/mozilla/jpeg/macbuild/JPEG.mcp differ diff --git a/mozilla/layout/build/nsLayoutFactory.cpp b/mozilla/layout/build/nsLayoutFactory.cpp index eb7e147bb82..5e3c4979fdf 100644 --- a/mozilla/layout/build/nsLayoutFactory.cpp +++ b/mozilla/layout/build/nsLayoutFactory.cpp @@ -257,13 +257,8 @@ nsIDOMNativeObjectRegistry *NativeObjectRegistryManager::gRegistry = nsnull; static NativeObjectRegistryManager gManager; // return the proper factory to the caller -#ifdef MAC_STATIC +#if defined(XP_MAC) && defined(MAC_STATIC) extern "C" NS_LAYOUT nsresult NSGetFactory_LAYOUT_DLL(const nsCID &aClass, nsIFactory **aFactory) -#elif defined(MAC_SHARED) -#pragma export on -extern "C" NS_LAYOUT nsresult NSGetFactory(const nsCID &aClass, nsIFactory **aFactory) -#pragma export off -// for non-mac platforms: #else extern "C" NS_LAYOUT nsresult NSGetFactory(const nsCID &aClass, nsIFactory **aFactory) #endif diff --git a/mozilla/layout/macbuild/layout.mcp b/mozilla/layout/macbuild/layout.mcp index 07d583cbae8..ed36d58f62c 100644 Binary files a/mozilla/layout/macbuild/layout.mcp and b/mozilla/layout/macbuild/layout.mcp differ diff --git a/mozilla/lib/mac/Misc/mactime.c b/mozilla/lib/mac/Misc/mactime.c index e5882f0c92c..a4f58a5a329 100644 --- a/mozilla/lib/mac/Misc/mactime.c +++ b/mozilla/lib/mac/Misc/mactime.c @@ -31,6 +31,13 @@ _END_C_LIB_DECL #endif #include +#ifndef __OSUTILS__ +#include +#endif +#ifndef __TOOLUTILS__ +#include +#endif + // Because serial port and SLIP conflict with ReadXPram calls, // we cache the call here // The symptoms are the @@ -41,11 +48,11 @@ long GMTDelta(); void MyReadLocation(MachineLocation * loc) { static MachineLocation storedLoc; // InsideMac, OSUtilities, page 4-20 - static Boolean didReadLocation = FALSE; + static Boolean didReadLocation = false; if (!didReadLocation) { ReadLocation(&storedLoc); - didReadLocation = TRUE; + didReadLocation = true; } *loc = storedLoc; } diff --git a/mozilla/lib/xp/xp_stub.c b/mozilla/lib/xp/xp_stub.c index d85cffbf7e2..37cf00c6f5d 100644 --- a/mozilla/lib/xp/xp_stub.c +++ b/mozilla/lib/xp/xp_stub.c @@ -31,10 +31,12 @@ NOT_NULL (const char *x) #endif +#ifdef DEBUG void XP_AssertAtLine( char *pFileName, int iLine ) { PR_Assert("XP Assert", pFileName, iLine); } +#endif /* XP_GetString * diff --git a/mozilla/modules/libimg/macbuild/libimg.mcp b/mozilla/modules/libimg/macbuild/libimg.mcp index d2514222f1b..a163391d172 100644 Binary files a/mozilla/modules/libimg/macbuild/libimg.mcp and b/mozilla/modules/libimg/macbuild/libimg.mcp differ diff --git a/mozilla/modules/libimg/src/xpcompat.cpp b/mozilla/modules/libimg/src/xpcompat.cpp index a5c5008a91e..24502e86f94 100644 --- a/mozilla/modules/libimg/src/xpcompat.cpp +++ b/mozilla/modules/libimg/src/xpcompat.cpp @@ -25,6 +25,7 @@ * of the XP_ library. */ #include "xpcompat.h" +#include "xp_mcom.h" #include /* BSDI did not have this header and we do not need it here. -slamm */ /* #include */ @@ -41,7 +42,6 @@ extern ilISystemServices *il_ss; #include #endif /* XP_PC */ -#ifndef XP_MAC PR_BEGIN_EXTERN_C int MK_UNABLE_TO_LOCATE_FILE = -1; int MK_OUT_OF_MEMORY = -2; @@ -68,7 +68,6 @@ int XP_MSG_COMMENT = -25; int XP_MSG_UNKNOWN = -26; int XP_MSG_COMPRESS_REMOVE = -27; PR_END_EXTERN_C -#endif /* XP_MAC */ char *XP_GetString(int i) { @@ -120,8 +119,8 @@ static void swap(char *p, char *q, unsigned int width); void XP_QSORT ( void *base, - unsigned num, - unsigned width, + size_t num, + size_t width, int ( *comp)(const void *, const void *) ) { @@ -369,10 +368,60 @@ static void swap ( #endif /* SOLARIS or XP_MAC */ +#ifdef XP_MAC +#include + +static void MyReadLocation(MachineLocation * loc) +{ + static MachineLocation storedLoc; // InsideMac, OSUtilities, page 4-20 + static Boolean didReadLocation = FALSE; + if (!didReadLocation) + { + ReadLocation(&storedLoc); + didReadLocation = TRUE; + } + *loc = storedLoc; +} + +// current local time = GMTDelta() + GMT +// GMT = local time - GMTDelta() +static long GMTDelta() +{ + MachineLocation loc; + long gmtDelta; + + MyReadLocation(&loc); + gmtDelta = loc.u.gmtDelta & 0x00FFFFFF; + if ((gmtDelta & 0x00800000) != 0) + gmtDelta |= 0xFF000000; + return gmtDelta; +} + +// This routine simulates stdclib time(), time in seconds since 1.1.1970 +// The time is in GMT +time_t GetTimeMac() +{ + unsigned long maclocal; + // Get Mac local time + GetDateTime(&maclocal); + // Get Mac GMT + maclocal -= GMTDelta(); + // return unix GMT + return (maclocal - UNIXMINUSMACTIME); +} + +// Returns the GMT times +time_t Mactime(time_t *timer) +{ + time_t t = GetTimeMac(); + if (timer != NULL) + *timer = t; + return t; +} +#endif /* XP_MAC */ /* Allocate a new copy of a block of binary data, and returns it */ -#ifndef XP_MAC char * NET_BACopy (char **destination, const char *source, size_t length) { @@ -395,7 +444,6 @@ NET_BACopy (char **destination, const char *source, size_t length) } return *destination; } -#endif /* XP_MAC */ /* binary block Allocate and Concatenate * @@ -403,7 +451,6 @@ NET_BACopy (char **destination, const char *source, size_t length) * source_length is the length of the block being added to the * destination block */ -#ifndef XP_MAC char * NET_BACat (char **destination, size_t destination_length, @@ -433,11 +480,9 @@ NET_BACat (char **destination, return *destination; } -#endif /* XP_MAC */ /* Very similar to strdup except it free's too */ -#ifndef XP_MAC char * NET_SACopy (char **destination, const char *source) { @@ -460,11 +505,9 @@ NET_SACopy (char **destination, const char *source) } return *destination; } -#endif /* XP_MAC */ /* Again like strdup but it concatinates and free's and uses Realloc */ -#ifndef XP_MAC char * NET_SACat (char **destination, const char *source) { @@ -490,7 +533,6 @@ NET_SACat (char **destination, const char *source) } return *destination; } -#endif /* XP_MAC */ #if 0 #include @@ -770,14 +812,14 @@ static void wfe_ProcessTimeouts(DWORD dwNow) dwSyncHack = 0; } #else -void * +NS_EXPORT void * FE_SetTimeout(TimeoutCallbackFunction func, void * closure, uint32 msecs) { return il_ss->SetTimeout((ilTimeoutCallbackFunction)func, closure, msecs); } -void +NS_EXPORT void FE_ClearTimeout(void *timer_id) { il_ss->ClearTimeout(timer_id); diff --git a/mozilla/modules/libpref/macbuild/libpref.mcp b/mozilla/modules/libpref/macbuild/libpref.mcp index 1e70636d7ad..c13104103da 100644 Binary files a/mozilla/modules/libpref/macbuild/libpref.mcp and b/mozilla/modules/libpref/macbuild/libpref.mcp differ diff --git a/mozilla/modules/libpref/src/mac/MacPrefUtils.cpp b/mozilla/modules/libpref/src/mac/MacPrefUtils.cpp index 82458b63ccc..fb196ae73af 100644 --- a/mozilla/modules/libpref/src/mac/MacPrefUtils.cpp +++ b/mozilla/modules/libpref/src/mac/MacPrefUtils.cpp @@ -26,7 +26,9 @@ #include #include "prmem.h" +#include "plstr.h" #include "FullPath.h" +#include "net.h" // Returns a full pathname to the given file // Returned value is allocated with XP_ALLOC, and must be freed with XP_FREE @@ -175,8 +177,8 @@ static char* encodeMacPath(char* inPath, Boolean prependSlash) if (newPath != NULL) { swapSlashColon(newPath); - // finalPath = NET_Escape(newPath, URL_PATH); - // XP_FREE(newPath); + finalPath = NET_Escape(newPath, URL_PATH); + XP_FREE(newPath); } PR_Free( inPath ); @@ -201,7 +203,7 @@ static char* macPathFromUnixPath(const char* unixPath) else if (strchr(src, '/')) // ¥ partial path, and not just a leaf name *dst++ = ':'; strcpy(dst, src); - // NET_UnEscape(dst); // Hex Decode + NET_UnEscape(dst); // Hex Decode swapSlashColon(dst); } return result; @@ -275,3 +277,137 @@ Boolean FileExists(const FSSpec& fsSpec) return (err == noErr); } + + +// beard: brought over from mkparse.c to break dependency. + +/* encode illegal characters into % escaped hex codes. + * + * mallocs and returns a string that must be freed + */ +static int netCharType[256] = +/* Bit 0 xalpha -- the alphas +** Bit 1 xpalpha -- as xalpha but +** converts spaces to plus and plus to %20 +** Bit 3 ... path -- as xalphas but doesn't escape '/' +*/ + /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ + { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 1x */ + 0,0,0,0,0,0,0,0,0,0,7,4,0,7,7,4, /* 2x !"#$%&'()*+,-./ */ + 7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,0, /* 3x 0123456789:;<=>? */ + 0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, /* 4x @ABCDEFGHIJKLMNO */ + /* bits for '@' changed from 7 to 0 so '@' can be escaped */ + /* in usernames and passwords in publishing. */ + 7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,7, /* 5X PQRSTUVWXYZ[\]^_ */ + 0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, /* 6x `abcdefghijklmno */ + 7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0, /* 7X pqrstuvwxyz{\}~ DEL */ + 0, }; + +#define HEX_ESCAPE '%' + +#define IS_OK(C) (netCharType[((unsigned int) (C))] & (mask)) + +PUBLIC char * +NET_Escape (const char * str, int mask) +{ + if(!str) + return NULL; + return NET_EscapeBytes (str, (int32)PL_strlen(str), mask, NULL); +} + +PUBLIC char * +NET_EscapeBytes (const char * str, int32 len, int mask, int32 * out_len) +{ + register const unsigned char *src; + register unsigned char *dst; + char *result; + int32 i, extra = 0; + char *hexChars = "0123456789ABCDEF"; + + if(!str) + return(0); + + src = (unsigned char *) str; + for(i = 0; i < len; i++) + { + if (!IS_OK(src[i])) + extra+=2; /* the escape, plus an extra byte for each nibble */ + } + + if(!(result = (char *) PR_Malloc(len + extra + 1))) + return(0); + + dst = (unsigned char *) result; + for(i = 0; i < len; i++) + { + unsigned char c = src[i]; + if (IS_OK(c)) + { + *dst++ = c; + } + else if(mask == URL_XPALPHAS && c == ' ') + { + *dst++ = '+'; /* convert spaces to pluses */ + } + else + { + *dst++ = HEX_ESCAPE; + *dst++ = hexChars[c >> 4]; /* high nibble */ + *dst++ = hexChars[c & 0x0f]; /* low nibble */ + } + } + + *dst = '\0'; /* tack on eos */ + if(out_len) + *out_len = dst - (unsigned char *) result; + return result; +} + +/* decode % escaped hex codes into character values + */ +#define UNHEX(C) \ + ((C >= '0' && C <= '9') ? C - '0' : \ + ((C >= 'A' && C <= 'F') ? C - 'A' + 10 : \ + ((C >= 'a' && C <= 'f') ? C - 'a' + 10 : 0))) + +PUBLIC int +NET_UnEscapeCnt (char * str) +{ + register char *src = str; + register char *dst = str; + + while(*src) + if (*src != HEX_ESCAPE) + { + *dst++ = *src++; + } + else + { + src++; /* walk over escape */ + if (*src) + { + *dst = UNHEX(*src) << 4; + src++; + } + if (*src) + { + *dst = (*dst + UNHEX(*src)); + src++; + } + dst++; + } + + *dst = 0; + + return (int)(dst - str); + +} /* NET_UnEscapeCnt */ + +PUBLIC char * +NET_UnEscape(char * str) +{ + (void)NET_UnEscapeCnt(str); + + return str; +} diff --git a/mozilla/modules/libpref/src/mac/macpref.cp b/mozilla/modules/libpref/src/mac/macpref.cp index 8ddf7795f5b..32c1174ce93 100644 --- a/mozilla/modules/libpref/src/mac/macpref.cp +++ b/mozilla/modules/libpref/src/mac/macpref.cp @@ -20,13 +20,26 @@ #include "prefapi.h" #include "jsapi.h" #include "prlink.h" + +#if 0 +// beard these are old world APIs that must be excised in the new world. +#include "LString.h" #include "ufilemgr.h" #include "uprefd.h" -#include "LString.h" +#endif -#include +#include "MacPrefUtils.h" + +#ifndef __RESOURCES__ #include +#endif +#ifndef __MEMORY__ #include +#endif +#ifndef __ALIASES__ +#include +#endif + /* * Mac-specific libpref routines @@ -111,7 +124,7 @@ PREF_CopyPathPref(const char *pref_name, char ** return_buffer) if (err != noErr) return PREF_ERROR; // bad alias - *return_buffer = CFileMgr::EncodedPathNameFromFSSpec(fileSpec, TRUE); + *return_buffer = EncodedPathNameFromFSSpec(fileSpec, TRUE); return PREF_NOERROR; } @@ -121,7 +134,7 @@ PREF_SetPathPref(const char *pref_name, const char *path, PRBool set_default) { FSSpec fileSpec; AliasHandle aliasH; - OSErr err = CFileMgr::FSSpecFromLocalUnixPath(path, &fileSpec); + OSErr err = FSSpecFromLocalUnixPath(path, &fileSpec); if (err != noErr) return PREF_ERROR; @@ -142,6 +155,7 @@ PREF_SetPathPref(const char *pref_name, const char *path, PRBool set_default) return result; } +#if 0 /* Looks for AutoAdminLib in Essential Files and returns FSSpec */ Boolean pref_FindAutoAdminLib(FSSpec& spec) @@ -154,10 +168,14 @@ pref_FindAutoAdminLib(FSSpec& spec) return CFileMgr::FileExists(spec); } +#endif PR_IMPLEMENT(PRBool) PREF_IsAutoAdminEnabled() { +#if 0 FSSpec spec; return (XP_Bool) pref_FindAutoAdminLib(spec); +#endif + return PR_FALSE; } diff --git a/mozilla/modules/libpref/src/nsPref.cpp b/mozilla/modules/libpref/src/nsPref.cpp index 8120fc9451f..5c5901d1904 100644 --- a/mozilla/modules/libpref/src/nsPref.cpp +++ b/mozilla/modules/libpref/src/nsPref.cpp @@ -586,11 +586,7 @@ nsresult nsPrefFactory::CreateInstance(nsISupports *aDelegate, return res; } -#ifdef XP_MAC -extern "C" NS_EXPORT nsresult NSGetFactory_PREF_DLL(const nsCID &aCID, nsIFactory **aFactory) -#else extern "C" NS_EXPORT nsresult NSGetFactory(const nsCID &aCID, nsIFactory **aFactory) -#endif { if (aFactory == NULL) { return NS_ERROR_NULL_POINTER; @@ -607,11 +603,7 @@ extern "C" NS_EXPORT nsresult NSGetFactory(const nsCID &aCID, nsIFactory **aFact return NS_NOINTERFACE; } -#ifdef XP_MAC -extern "C" NS_EXPORT PRBool NSCanUnload_PREF_DLL() -#else extern "C" NS_EXPORT PRBool NSCanUnload() -#endif { return PRBool(g_InstanceCount == 0 && g_LockCount == 0); } diff --git a/mozilla/modules/libpref/src/prefapi.c b/mozilla/modules/libpref/src/prefapi.c index 0c974f64162..05f314ca7be 100644 --- a/mozilla/modules/libpref/src/prefapi.c +++ b/mozilla/modules/libpref/src/prefapi.c @@ -2225,10 +2225,26 @@ pref_ErrorReporter(JSContext *cx, const char *message, } } +#if defined(XP_MAC) + +#include +#include + +void pref_Alert(char* msg) +{ + Str255 pmsg; + SInt16 itemHit; + pmsg[0] = strlen(msg); + BlockMoveData(msg, pmsg + 1, pmsg[0]); + StandardAlert(kAlertPlainAlert, "\pNetscape -- JS Preference Warning", pmsg, NULL, &itemHit); +} + +#else + /* Platform specific alert messages */ void pref_Alert(char* msg) { -#if defined(XP_MAC) || defined(XP_UNIX) || defined(XP_OS2) +#if defined(XP_UNIX) || defined(XP_OS2) #if defined(XP_UNIX) if ( getenv("NO_PREF_SPAM") == NULL ) #endif @@ -2239,6 +2255,7 @@ void pref_Alert(char* msg) #endif } +#endif #ifdef XP_WIN16 #define ADMNLIBNAME "adm1640.dll" diff --git a/mozilla/modules/libpref/src/prefapi.cpp b/mozilla/modules/libpref/src/prefapi.cpp index 0c974f64162..05f314ca7be 100644 --- a/mozilla/modules/libpref/src/prefapi.cpp +++ b/mozilla/modules/libpref/src/prefapi.cpp @@ -2225,10 +2225,26 @@ pref_ErrorReporter(JSContext *cx, const char *message, } } +#if defined(XP_MAC) + +#include +#include + +void pref_Alert(char* msg) +{ + Str255 pmsg; + SInt16 itemHit; + pmsg[0] = strlen(msg); + BlockMoveData(msg, pmsg + 1, pmsg[0]); + StandardAlert(kAlertPlainAlert, "\pNetscape -- JS Preference Warning", pmsg, NULL, &itemHit); +} + +#else + /* Platform specific alert messages */ void pref_Alert(char* msg) { -#if defined(XP_MAC) || defined(XP_UNIX) || defined(XP_OS2) +#if defined(XP_UNIX) || defined(XP_OS2) #if defined(XP_UNIX) if ( getenv("NO_PREF_SPAM") == NULL ) #endif @@ -2239,6 +2255,7 @@ void pref_Alert(char* msg) #endif } +#endif #ifdef XP_WIN16 #define ADMNLIBNAME "adm1640.dll" diff --git a/mozilla/network/macbuild/network.mcp b/mozilla/network/macbuild/network.mcp index 3cdd0c50265..3cbb2946f02 100644 Binary files a/mozilla/network/macbuild/network.mcp and b/mozilla/network/macbuild/network.mcp differ diff --git a/mozilla/network/module/nsNetFactory.cpp b/mozilla/network/module/nsNetFactory.cpp index 6b63603f4e3..166b73a432a 100644 --- a/mozilla/network/module/nsNetFactory.cpp +++ b/mozilla/network/module/nsNetFactory.cpp @@ -15,6 +15,7 @@ * Copyright (C) 1998 Netscape Communications Corporation. All Rights * Reserved. */ + #include "nscore.h" #include "nsIFactory.h" #include "nsISupports.h" @@ -143,7 +144,7 @@ nsresult nsNetFactory::LockFactory(PRBool aLock) } // return the proper factory to the caller -#ifdef XP_MAC +#if defined(XP_MAC) && defined(MAC_STATIC) extern "C" NS_NET nsresult NSGetFactory_NETLIB_DLL(const nsCID &aClass, nsIFactory **aFactory) #else extern "C" NS_NET nsresult NSGetFactory(const nsCID &aClass, nsIFactory **aFactory) diff --git a/mozilla/parser/htmlparser/macbuild/htmlparser.mcp b/mozilla/parser/htmlparser/macbuild/htmlparser.mcp index b09981ee3f9..366a4f01a1e 100644 Binary files a/mozilla/parser/htmlparser/macbuild/htmlparser.mcp and b/mozilla/parser/htmlparser/macbuild/htmlparser.mcp differ diff --git a/mozilla/parser/htmlparser/src/nsParserFactory.cpp b/mozilla/parser/htmlparser/src/nsParserFactory.cpp index ac27179b434..a3e5540234f 100644 --- a/mozilla/parser/htmlparser/src/nsParserFactory.cpp +++ b/mozilla/parser/htmlparser/src/nsParserFactory.cpp @@ -158,7 +158,7 @@ nsresult nsParserFactory::LockFactory(PRBool aLock) } // return the proper factory to the caller -#ifdef XP_MAC +#if defined(XP_MAC) && defined(MAC_STATIC) extern "C" NS_EXPORT nsresult NSGetFactory_PARSER_DLL(const nsCID &aClass, nsIFactory **aFactory) #else extern "C" NS_EXPORT nsresult NSGetFactory(const nsCID &aClass, nsIFactory **aFactory) diff --git a/mozilla/view/macbuild/view.mcp b/mozilla/view/macbuild/view.mcp index 2da763ba1bf..8547b432ae0 100644 Binary files a/mozilla/view/macbuild/view.mcp and b/mozilla/view/macbuild/view.mcp differ diff --git a/mozilla/view/src/nsViewFactory.cpp b/mozilla/view/src/nsViewFactory.cpp index 63557db3dc5..d78d56c9d03 100644 --- a/mozilla/view/src/nsViewFactory.cpp +++ b/mozilla/view/src/nsViewFactory.cpp @@ -150,12 +150,8 @@ nsresult nsViewFactory::LockFactory(PRBool aLock) } // return the proper factory to the caller -#ifdef MAC_STATIC +#if defined(XP_MAC) && defined(MAC_STATIC) extern "C" NS_VIEW nsresult NSGetFactory_VIEW_DLL(const nsCID &aClass, nsIFactory **aFactory) -#elif defined(MAC_SHARED) -#pragma export on -extern "C" NS_VIEW nsresult NSGetFactory(const nsCID &aClass, nsIFactory **aFactory) -#pragma export off #else extern "C" NS_VIEW nsresult NSGetFactory(const nsCID &aClass, nsIFactory **aFactory) #endif diff --git a/mozilla/webshell/macbuild/webshell.mcp b/mozilla/webshell/macbuild/webshell.mcp index 6a3ec3655fe..efa1fa6f645 100644 Binary files a/mozilla/webshell/macbuild/webshell.mcp and b/mozilla/webshell/macbuild/webshell.mcp differ diff --git a/mozilla/webshell/src/nsDLLFactory.cpp b/mozilla/webshell/src/nsDLLFactory.cpp index ee9c0da0940..20b2084d7f3 100644 --- a/mozilla/webshell/src/nsDLLFactory.cpp +++ b/mozilla/webshell/src/nsDLLFactory.cpp @@ -27,12 +27,8 @@ static NS_DEFINE_IID(kThrobberCID, NS_THROBBER_CID); static NS_DEFINE_IID(kWebShellCID, NS_WEB_SHELL_CID); -#ifdef MAC_STATIC +#if defined(XP_MAC) && defined(MAC_STATIC) extern "C" NS_WEB nsresult NSGetFactory_WEB_DLL(const nsCID& aClass, nsIFactory** aFactory) -#elif defined(MAC_SHARED) -#pragma export on -extern "C" NS_WEB nsresult NSGetFactory(const nsCID& aClass, nsIFactory** aFactory) -#pragma export on #else extern "C" NS_WEB nsresult NSGetFactory(const nsCID& aClass, nsIFactory** aFactory) #endif diff --git a/mozilla/webshell/tests/viewer/mac/viewer.mcp b/mozilla/webshell/tests/viewer/mac/viewer.mcp index a7cbeb5ca78..6fd137f48d9 100644 Binary files a/mozilla/webshell/tests/viewer/mac/viewer.mcp and b/mozilla/webshell/tests/viewer/mac/viewer.mcp differ diff --git a/mozilla/webshell/tests/viewer/macToBeImplemented.cp b/mozilla/webshell/tests/viewer/macToBeImplemented.cp index d02a4f7e45a..72c8a1aec3c 100644 --- a/mozilla/webshell/tests/viewer/macToBeImplemented.cp +++ b/mozilla/webshell/tests/viewer/macToBeImplemented.cp @@ -47,3 +47,79 @@ char * XP_FileReadLine(char * dest, int32 bufferSize, XP_File file) return NULL; } +#include "il_strm.h" + +/* Given the first few bytes of a stream, identify the image format */ +static int +il_type(int suspected_type, const char *buf, int32 len) +{ + int i; + + if (len >= 4 && !strncmp(buf, "GIF8", 4)) + { + return IL_GIF; + } + + /* for PNG */ + if (len >= 4 && ((unsigned char)buf[0]==0x89 && + (unsigned char)buf[1]==0x50 && + (unsigned char)buf[2]==0x4E && + (unsigned char)buf[3]==0x47)) + { + return IL_PNG; + } + + + /* JFIF files start with SOI APP0 but older files can start with SOI DQT + * so we test for SOI followed by any marker, i.e. FF D8 FF + * this will also work for SPIFF JPEG files if they appear in the future. + * + * (JFIF is 0XFF 0XD8 0XFF 0XE0 0X4A 0X46 0X49 0X46 0X00) + */ + if (len >= 3 && + ((unsigned char)buf[0])==0xFF && + ((unsigned char)buf[1])==0xD8 && + ((unsigned char)buf[2])==0xFF) + { + return IL_JPEG; + } + + /* no simple test for XBM vs, say, XPM so punt for now */ + if (len >= 8 && !strncmp(buf, "#define ", 8) ) + { + /* Don't contradict the given type, since this ID isn't definitive */ + if ((suspected_type == IL_UNKNOWN) || (suspected_type == IL_XBM)) + return IL_XBM; + } + + if (len < 35) + { + /* ILTRACE(1,("il: too few bytes to determine type")); */ + return suspected_type; + } + + /* all the servers return different formats so root around */ + for (i=0; i<28; i++) + { + if (!strncmp(&buf[i], "Not Fou", 7)) + return IL_NOTFOUND; + } + + return suspected_type; +} + +/* + * determine what kind of image data we are dealing with + */ +extern "C" +int IL_Type(const char *buf, int32 len) +{ + return il_type(IL_UNKNOWN, buf, len); +} + +/* Set limit on approximate size, in bytes, of all pixmap storage used + by the imagelib. */ +extern "C" +void IL_SetCacheSize(uint32 new_size) +{ +} diff --git a/mozilla/webshell/tests/viewer/nsSetupRegistry.cpp b/mozilla/webshell/tests/viewer/nsSetupRegistry.cpp index 18b4fdd21f9..a5ba0bdfaf9 100644 --- a/mozilla/webshell/tests/viewer/nsSetupRegistry.cpp +++ b/mozilla/webshell/tests/viewer/nsSetupRegistry.cpp @@ -16,14 +16,8 @@ * Corporation. Portions created by Netscape are Copyright (C) 1998 * Netscape Communications Corporation. All Rights Reserved. */ -#ifdef XP_MAC -#include "nsIPref.h" -#define NS_IMPL_IDS -#else #define NS_IMPL_IDS #include "nsIPref.h" -#endif - #include "nsRepository.h" #include "nsWidgetsCID.h" #include "nsGfxCIID.h" diff --git a/mozilla/widget/macbuild/WidgetSharedDebugPrefix.h b/mozilla/widget/macbuild/WidgetSharedDebugPrefix.h index e88b07244fa..465e3fb085e 100644 --- a/mozilla/widget/macbuild/WidgetSharedDebugPrefix.h +++ b/mozilla/widget/macbuild/WidgetSharedDebugPrefix.h @@ -17,5 +17,6 @@ */ #define MAC_SHARED 1 +#define _IMPL_NS_WIDGET 1 -#include "WidgetDebug.prefix" \ No newline at end of file +#include "WidgetDebug.prefix" diff --git a/mozilla/widget/macbuild/WidgetSharedPrefix.h b/mozilla/widget/macbuild/WidgetSharedPrefix.h index 6e439546916..8d654d09c04 100644 --- a/mozilla/widget/macbuild/WidgetSharedPrefix.h +++ b/mozilla/widget/macbuild/WidgetSharedPrefix.h @@ -17,5 +17,6 @@ */ #define MAC_SHARED 1 +#define _IMPL_NS_WIDGET 1 -#include "Widget.prefix" \ No newline at end of file +#include "Widget.prefix" diff --git a/mozilla/widget/macbuild/widget.mcp b/mozilla/widget/macbuild/widget.mcp index c99472a55a6..2df4b5ef235 100644 Binary files a/mozilla/widget/macbuild/widget.mcp and b/mozilla/widget/macbuild/widget.mcp differ diff --git a/mozilla/widget/src/mac/nsMacMessagePump.cpp b/mozilla/widget/src/mac/nsMacMessagePump.cpp index 32acbdeb844..9a13556a73e 100644 --- a/mozilla/widget/src/mac/nsMacMessagePump.cpp +++ b/mozilla/widget/src/mac/nsMacMessagePump.cpp @@ -51,7 +51,7 @@ const char MOUSEMOVEDMESSAGE = 0xFA; //nsWindow* nsMacMessagePump::gGrabWindow = nsnull; // need this for grabmouse //static NS_DEFINE_IID(kITEXTWIDGETIID, NS_TEXTFIELD_CID); -nsMacMessagePump::nsWindowlessMenuEventHandler nsMacMessagePump::gWindowlessMenuEventHandler = nsnull; +NS_WIDGET nsMacMessagePump::nsWindowlessMenuEventHandler nsMacMessagePump::gWindowlessMenuEventHandler = nsnull; bool IsUserWindow ( WindowPtr ) ; diff --git a/mozilla/widget/src/mac/nsWidgetFactory.cpp b/mozilla/widget/src/mac/nsWidgetFactory.cpp index 4cad9ea6b63..84e1c397cfc 100644 --- a/mozilla/widget/src/mac/nsWidgetFactory.cpp +++ b/mozilla/widget/src/mac/nsWidgetFactory.cpp @@ -106,7 +106,8 @@ private: nsWidgetFactory::nsWidgetFactory(const nsCID &aClass) -{ +{ + NS_INIT_REFCNT(); mClassID = aClass; } @@ -261,12 +262,10 @@ nsresult nsWidgetFactory::LockFactory(PRBool aLock) } // return the proper factory to the caller -#ifdef MAC_STATIC +#if defined(XP_MAC) && defined(MAC_STATIC) extern "C" NS_WIDGET nsresult NSGetFactory_WIDGET_DLL(const nsCID &aClass, nsIFactory **aFactory) -#elif defined(MAC_SHARED) -#pragma export on +#else extern "C" NS_WIDGET nsresult NSGetFactory(const nsCID &aClass, nsIFactory **aFactory) -#pragma export off #endif { if (nsnull == aFactory) { @@ -281,5 +280,3 @@ extern "C" NS_WIDGET nsresult NSGetFactory(const nsCID &aClass, nsIFactory **aFa return (*aFactory)->QueryInterface(kIFactoryIID, (void**)aFactory); } - - diff --git a/mozilla/xpcom/components/nsMacRepository.h b/mozilla/xpcom/components/nsMacRepository.h index 7ead8aa1b1f..689230d582b 100644 --- a/mozilla/xpcom/components/nsMacRepository.h +++ b/mozilla/xpcom/components/nsMacRepository.h @@ -68,6 +68,7 @@ extern "C" PRBool NSCanUnload_PREF_DLL(void); // library list static MacLibrary libraries[] = { +#if 0 WIDGET_DLL, NSGetFactory_WIDGET_DLL, NULL, GFXWIN_DLL, NSGetFactory_GFXWIN_DLL, NULL, VIEW_DLL, NSGetFactory_VIEW_DLL, NULL, @@ -79,7 +80,9 @@ static MacLibrary libraries[] = { LAYOUT_DLL, NSGetFactory_LAYOUT_DLL, NULL, NETLIB_DLL, NSGetFactory_NETLIB_DLL, NULL, //EDITOR_DLL, NSGetFactory_EDITOR_DLL, NULL, // FIX ME - NULL}; +#endif + NULL +}; static void* FindMacSymbol(char* libName, const char *symbolName) { diff --git a/mozilla/xpcom/components/nsRepository.cpp b/mozilla/xpcom/components/nsRepository.cpp index d7370d4a763..206489f966a 100644 --- a/mozilla/xpcom/components/nsRepository.cpp +++ b/mozilla/xpcom/components/nsRepository.cpp @@ -37,12 +37,14 @@ #include "NSReg.h" #endif +#if 0 #ifdef XP_MAC #ifdef MOZ_NGLAYOUT #define IMPL_MAC_REPOSITORY #include "nsMacRepository.h" #endif #endif +#endif nsHashtable *nsRepository::factories = NULL; PRMonitor *nsRepository::monitor = NULL; diff --git a/mozilla/xpcom/macbuild/xpcom.exp b/mozilla/xpcom/macbuild/xpcom.exp index f45c0f14112..dac25b442e1 100644 --- a/mozilla/xpcom/macbuild/xpcom.exp +++ b/mozilla/xpcom/macbuild/xpcom.exp @@ -83,3 +83,9 @@ PL_NewVector # nsServiceManager static method exports. ReleaseService__16nsServiceManagerFRC4nsIDP11nsISupportsP19nsIShutdownListener GetService__16nsServiceManagerFRC4nsIDRC4nsIDPP11nsISupportsP19nsIShutdownListener + +# nsTraceRefcnt +Destroy__13nsTraceRefcntFPvPCci +Create__13nsTraceRefcntFPvPCcPCci +Release__13nsTraceRefcntFPvUlPCci +AddRef__13nsTraceRefcntFPvUlPCci diff --git a/mozilla/xpcom/macbuild/xpcomPPC.mcp b/mozilla/xpcom/macbuild/xpcomPPC.mcp index 744d9e32dcd..75864c19ce8 100644 Binary files a/mozilla/xpcom/macbuild/xpcomPPC.mcp and b/mozilla/xpcom/macbuild/xpcomPPC.mcp differ diff --git a/mozilla/xpcom/public/nsMacRepository.h b/mozilla/xpcom/public/nsMacRepository.h index 7ead8aa1b1f..689230d582b 100644 --- a/mozilla/xpcom/public/nsMacRepository.h +++ b/mozilla/xpcom/public/nsMacRepository.h @@ -68,6 +68,7 @@ extern "C" PRBool NSCanUnload_PREF_DLL(void); // library list static MacLibrary libraries[] = { +#if 0 WIDGET_DLL, NSGetFactory_WIDGET_DLL, NULL, GFXWIN_DLL, NSGetFactory_GFXWIN_DLL, NULL, VIEW_DLL, NSGetFactory_VIEW_DLL, NULL, @@ -79,7 +80,9 @@ static MacLibrary libraries[] = { LAYOUT_DLL, NSGetFactory_LAYOUT_DLL, NULL, NETLIB_DLL, NSGetFactory_NETLIB_DLL, NULL, //EDITOR_DLL, NSGetFactory_EDITOR_DLL, NULL, // FIX ME - NULL}; +#endif + NULL +}; static void* FindMacSymbol(char* libName, const char *symbolName) { diff --git a/mozilla/xpcom/src/nsRepository.cpp b/mozilla/xpcom/src/nsRepository.cpp index d7370d4a763..206489f966a 100644 --- a/mozilla/xpcom/src/nsRepository.cpp +++ b/mozilla/xpcom/src/nsRepository.cpp @@ -37,12 +37,14 @@ #include "NSReg.h" #endif +#if 0 #ifdef XP_MAC #ifdef MOZ_NGLAYOUT #define IMPL_MAC_REPOSITORY #include "nsMacRepository.h" #endif #endif +#endif nsHashtable *nsRepository::factories = NULL; PRMonitor *nsRepository::monitor = NULL; diff --git a/mozilla/xpfe/macbuild/xpfeviewer.mcp b/mozilla/xpfe/macbuild/xpfeviewer.mcp index b0dfcf51e82..bb284a2d752 100644 Binary files a/mozilla/xpfe/macbuild/xpfeviewer.mcp and b/mozilla/xpfe/macbuild/xpfeviewer.mcp differ diff --git a/mozilla/xpfe/xpviewer/src/nsSetupRegistry.cpp b/mozilla/xpfe/xpviewer/src/nsSetupRegistry.cpp index d29656af1d0..a22a6e64467 100644 --- a/mozilla/xpfe/xpviewer/src/nsSetupRegistry.cpp +++ b/mozilla/xpfe/xpviewer/src/nsSetupRegistry.cpp @@ -16,14 +16,8 @@ * Corporation. Portions created by Netscape are Copyright (C) 1998 * Netscape Communications Corporation. All Rights Reserved. */ -#ifdef XP_MAC -#include "nsIPref.h" -#define NS_IMPL_IDS -#else #define NS_IMPL_IDS #include "nsIPref.h" -#endif - #include "nsRepository.h" #include "nsWidgetsCID.h" #include "nsGfxCIID.h"