From 4816045c3fb879bd5d93551ae95161b53880e073 Mon Sep 17 00:00:00 2001 From: "peterv%netscape.com" Date: Sun, 3 Mar 2002 10:57:06 +0000 Subject: [PATCH] Fix for bug 5794 ([MAC]Aliasing NGLayoutConfigInclude.h to MacConfigInclude.h is evil). sr=sfraser, a=dbaron. git-svn-id: svn://10.0.0.236/trunk@115674 18797224-902f-48f8-a5cc-f745e15eee43 --- .../mac/build_scripts/MozillaBuildList.pm | 17 -- mozilla/config/mac/MacConfigInclude.h | 18 +- mozilla/config/mac/NGLayoutConfigInclude.h | 69 ------- mozilla/netwerk/base/tests/urltest.cpp | 3 +- mozilla/xpcom/components/nsMacRepository.h | 183 ------------------ 5 files changed, 10 insertions(+), 280 deletions(-) delete mode 100644 mozilla/config/mac/NGLayoutConfigInclude.h delete mode 100644 mozilla/xpcom/components/nsMacRepository.h diff --git a/mozilla/build/mac/build_scripts/MozillaBuildList.pm b/mozilla/build/mac/build_scripts/MozillaBuildList.pm index 3b3e96f0890..66ed39d0b61 100644 --- a/mozilla/build/mac/build_scripts/MozillaBuildList.pm +++ b/mozilla/build/mac/build_scripts/MozillaBuildList.pm @@ -30,19 +30,6 @@ use Moz::MacCVS; ); -# NGLayoutBuildList builds the nglayout project -# it is configured by setting the following variables in the caller: -# Usage: -# caller variables that affect behaviour: -# DEBUG : 1 if we are building a debug version -# 3-part build process: checkout, dist, and build_projects -# Hack alert: -# NGLayout defines are located in :mozilla:config:mac:NGLayoutConfigInclude.h -# An alias "MacConfigInclude.h" to this file is created inside dist:config -# Note that the name of alias is different than the name of the file. This -# is to trick CW into including NGLayout defines - - #//-------------------------------------------------------------------------------------------------- #// assert that we are in the correct directory for the build #//-------------------------------------------------------------------------------------------------- @@ -517,10 +504,6 @@ sub BuildClientDist() InstallFromManifest(":mozilla:lib:mac:Instrumentation:MANIFEST", "$distdirectory:mac:inst:"); #INCLUDE - - #// To get out defines in all the project, dummy alias NGLayoutConfigInclude.h into MacConfigInclude.h - MakeAlias(":mozilla:config:mac:NGLayoutConfigInclude.h", ":mozilla:dist:config:MacConfigInclude.h"); - InstallFromManifest(":mozilla:include:MANIFEST", "$distdirectory:include:"); #INTL diff --git a/mozilla/config/mac/MacConfigInclude.h b/mozilla/config/mac/MacConfigInclude.h index d0dfc74137e..b771ad30505 100644 --- a/mozilla/config/mac/MacConfigInclude.h +++ b/mozilla/config/mac/MacConfigInclude.h @@ -36,6 +36,8 @@ * * ***** END LICENSE BLOCK ***** */ +#pragma once + /* This is included as a prefix file in all Mac projects. It ensures that the correct #defines are set up for this build. @@ -45,22 +47,18 @@ Order below does matter. */ -#ifndef MacConfigInclude_h_ -#define MacConfigInclude_h_ +/* Read generated build options (written at build time). */ +#ifdef DEBUG +#include "DefinesOptionsDebug.h" +#else +#include "DefinesOptions.h" +#endif /* Read compiler options */ -#ifndef IDE_Options_h_ #include "IDE_Options.h" -#endif /* Read file of defines global to the Mac build */ -#ifndef DefinesMac_h_ #include "DefinesMac.h" -#endif /* Read build-wide defines (e.g. MOZILLA_CLIENT) */ -#ifndef DefinesMozilla_h_ #include "DefinesMozilla.h" -#endif - -#endif /* MacConfigInclude_h_ */ diff --git a/mozilla/config/mac/NGLayoutConfigInclude.h b/mozilla/config/mac/NGLayoutConfigInclude.h deleted file mode 100644 index cd46b030b55..00000000000 --- a/mozilla/config/mac/NGLayoutConfigInclude.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Netscape Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#pragma once - -/* - This is included as a prefix file in all Mac projects. It ensures that - the correct #defines are set up for this build. - - Since this is included from C files, comments should be C-style. - - Order below does matter. -*/ - -/* Read generated build options (written at build time). */ -#ifdef DEBUG -#include "DefinesOptionsDebug.h" -#else -#include "DefinesOptions.h" -#endif - -/* Read compiler options */ -#include "IDE_Options.h" - -/* Read file of defines global to the Mac build */ -#include "DefinesMac.h" - -/* Read build-wide defines (e.g. MOZILLA_CLIENT) */ -#include "DefinesMozilla.h" - -/* ...then undefine the Mozilla specific stuff */ - -/* ...and define the Raptor specific things */ -#define MOZ_NGLAYOUT diff --git a/mozilla/netwerk/base/tests/urltest.cpp b/mozilla/netwerk/base/tests/urltest.cpp index c41aceb2290..96e234aeddd 100644 --- a/mozilla/netwerk/base/tests/urltest.cpp +++ b/mozilla/netwerk/base/tests/urltest.cpp @@ -68,7 +68,8 @@ #define XPCOM_DLL "xpcom32.dll" #else #ifdef XP_MAC -#include "nsMacRepository.h" +#define NETLIB_DLL "NETLIB_DLL" +#define XPCOM_DLL "XPCOM_DLL" #else #define NETLIB_DLL "libnetlib.so" #define XPCOM_DLL "libxpcom.so" diff --git a/mozilla/xpcom/components/nsMacRepository.h b/mozilla/xpcom/components/nsMacRepository.h deleted file mode 100644 index 0347f8deb9f..00000000000 --- a/mozilla/xpcom/components/nsMacRepository.h +++ /dev/null @@ -1,183 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Netscape Public License - * Version 1.1 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifdef XP_MAC -#ifdef MOZ_NGLAYOUT - -#error "nsMacRepository.h became obsolete when the shared lib conversion was completed." - -// The Mac NGLayout is not based on shared libraries yet. -// All the DLLs are built as static libraries and we present them as -// shared libraries by redefining PR_LoadLibrary(), PR_UnloadLibrary() -// and PR_FindSymbol() below. -// -// If you add or remove shared libraries on other platforms, you must -// - Add the library name to the defines below. -// - Rename the "NSGetFactory" and "NSCanUnload" procs for the Mac: -// just append the library name to the function name. -// - Add the library and its procs to the static list below. - - -typedef struct MacLibrary -{ - char * name; - nsFactoryProc factoryProc; - nsCanUnloadProc unloadProc; -} MacLibrary; - -// library names -#define WIDGET_DLL "WIDGET_DLL" -#define GFXWIN_DLL "GFXWIN_DLL" -#define VIEW_DLL "VIEW_DLL" -#define WEB_DLL "WEB_DLL" -#define PLUGIN_DLL "PLUGIN_DLL" -#define PREF_DLL "PREF_DLL" -#define PARSER_DLL "PARSER_DLL" -#define DOM_DLL "DOM_DLL" -#define LAYOUT_DLL "LAYOUT_DLL" -#define NETLIB_DLL "NETLIB_DLL" -#define EDITOR_DLL "EDITOR_DLL" - -#ifdef IMPL_MAC_REPOSITORY - -extern "C" nsresult NSGetFactory_WIDGET_DLL(nsISupports* serviceMgr, - const nsCID &aClass, - const char *aClassName, - const char *aContractID, - nsIFactory **aFactory); -extern "C" nsresult NSGetFactory_GFXWIN_DLL(nsISupports* serviceMgr, - const nsCID &aClass, - const char *aClassName, - const char *aContractID, - nsIFactory **aFactory); -extern "C" nsresult NSGetFactory_VIEW_DLL(nsISupports* serviceMgr, - const nsCID &aClass, - const char *aClassName, - const char *aContractID, - nsIFactory **aFactory); -extern "C" nsresult NSGetFactory_WEB_DLL(nsISupports* serviceMgr, - const nsCID &aClass, - const char *aClassName, - const char *aContractID, - nsIFactory **aFactory); -#if 0 -extern "C" nsresult NSGetFactory_PLUGIN_DLL(nsISupports* serviceMgr, - const nsCID &aClass, - const char *aClassName, - const char *aContractID, - nsIFactory **aFactory); -#endif -extern "C" nsresult NSGetFactory_PREF_DLL(nsISupports* serviceMgr, - const nsCID &aClass, - const char *aClassName, - const char *aContractID, - nsIFactory **aFactory); -extern "C" nsresult NSGetFactory_PARSER_DLL(nsISupports* serviceMgr, - const nsCID &aClass, - const char *aClassName, - const char *aContractID, - nsIFactory **aFactory); -extern "C" nsresult NSGetFactory_DOM_DLL(nsISupports* serviceMgr, - const nsCID &aClass, - const char *aClassName, - const char *aContractID, - nsIFactory **aFactory); -extern "C" nsresult NSGetFactory_LAYOUT_DLL(nsISupports* serviceMgr, - const nsCID &aClass, - const char *aClassName, - const char *aContractID, - nsIFactory **aFactory); -extern "C" nsresult NSGetFactory_NETLIB_DLL(nsISupports* serviceMgr, - const nsCID &aClass, - const char *aClassName, - const char *aContractID, - nsIFactory **aFactory); -extern "C" nsresult NSGetFactory_EDITOR_DLL(nsISupports* serviceMgr, - const nsCID &aClass, - const char *aClassName, - const char *aContractID, - nsIFactory **aFactory); - -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, - WEB_DLL, NSGetFactory_WEB_DLL, NULL, - //PLUGIN_DLL, NSGetFactory_PLUGIN_DLL, NULL, - PREF_DLL, NSGetFactory_PREF_DLL, NSCanUnload_PREF_DLL, - PARSER_DLL, NSGetFactory_PARSER_DLL, NULL, - DOM_DLL, NSGetFactory_DOM_DLL, NULL, - LAYOUT_DLL, NSGetFactory_LAYOUT_DLL, NULL, - NETLIB_DLL, NSGetFactory_NETLIB_DLL, NULL, - //EDITOR_DLL, NSGetFactory_EDITOR_DLL, NULL, // FIX ME -#endif - NULL -}; - -static void* FindMacSymbol(char* libName, const char *symbolName) -{ - MacLibrary * macLib; - - for (macLib = libraries; ; macLib ++) - { - if (macLib->name == NULL) - return NULL; - - if (PL_strcmp(macLib->name, libName) == 0) - break; - } - - if (PL_strcmp(symbolName, "NSGetFactory") == 0) { - return macLib->factoryProc; - } - else if (PL_strcmp(symbolName, "NSCanUnload") == 0) { - return macLib->unloadProc; - } - return NULL; -} - -#define PR_LoadLibrary(libName) (PRLibrary *)libName -#define PR_UnloadLibrary(lib) lib = NULL -#define PR_FindSymbol(lib, symbolName) FindMacSymbol((char*)lib, symbolName) - -#endif // IMPL_MAC_REPOSITORY - -#endif // MOZ_NGLAYOUT -#endif // XP_MAC