Use %var% instead of @var@ as placeholders for the static build dynamic module lists. This prevents acoutput-fast.pl from complaining about unknown variables.

This commit is contained in:
cls%seawood.org 2001-07-25 07:01:05 +00:00
Родитель 95d6ed2b2c
Коммит 8a0a1ce3d8
6 изменённых файлов: 16 добавлений и 174 удалений

Просмотреть файл

@ -94,15 +94,15 @@ list:
ifdef MOZ_STATIC_COMPONENTS
nsStaticModule.cpp: nsStaticModule.cpp.in Makefile Makefile.in $(DEPTH)/config/autoconf.mk
rm -f $@
cat $< | sed -e "s|@COMPONENT_NS_GET_MODULE@|$(foreach m, $(MOZ_STATIC_COMPONENTS), REGISTER_MODULE_USING($(m)_NSGetModule);)|" | \
sed -e "s|@COMPONENT_LIST@|$(foreach m, $(MOZ_STATIC_COMPONENTS), { $(m)_NSGM_comps, $(m)_NSGM_comp_count }, )|" | \
sed -e "s|@DECLARE_COMPONENT_LIST@|$(foreach m,$(MOZ_STATIC_COMPONENTS), extern \"C\" nsresult $(m)_NSGetModule(nsIComponentManager *servMgr, nsIFile* aPath, nsIModule** return_cobj); extern nsModuleComponentInfo* $(m)_NSGM_comps; extern PRUint32 $(m)_NSGM_comp_count;)|" > $@
cat $< | sed -e "s|%COMPONENT_NS_GET_MODULE%|$(foreach m, $(MOZ_STATIC_COMPONENTS), REGISTER_MODULE_USING($(m)_NSGetModule);)|" | \
sed -e "s|%COMPONENT_LIST%|$(foreach m, $(MOZ_STATIC_COMPONENTS), { $(m)_NSGM_comps, $(m)_NSGM_comp_count }, )|" | \
sed -e "s|%DECLARE_COMPONENT_LIST%|$(foreach m,$(MOZ_STATIC_COMPONENTS), extern \"C\" nsresult $(m)_NSGetModule(nsIComponentManager *servMgr, nsIFile* aPath, nsIModule** return_cobj); extern nsModuleComponentInfo* $(m)_NSGM_comps; extern PRUint32 $(m)_NSGM_comp_count;)|" > $@
endif
nsMetaModule_%.cpp: nsMetaModule_%.cpp.in Makefile Makefile.in $(topsrcdir)/config/config.mk
rm -f $@
cat $< | \
sed -e "s|@COMPONENT_NS_GET_MODULE@|$(foreach m, $($(_META_COMPONENT_NAMES)), REGISTER_MODULE_USING($(m)_NSGetModule);)|" | \
sed -e "s|@COMPONENT_LIST@|$(foreach m, $($(_META_COMPONENT_NAMES)), { $(m)_NSGM_comps, $(m)_NSGM_comp_count }, )|" | \
sed -e "s|@DECLARE_COMPONENT_LIST@|$(foreach m,$($(_META_COMPONENT_NAMES)), extern \"C\" nsresult $(m)_NSGetModule(nsIComponentManager *servMgr, nsIFile* aPath, nsIModule** return_cobj); extern nsModuleComponentInfo* $(m)_NSGM_comps; extern PRUint32 $(m)_NSGM_comp_count;)|" > $@
sed -e "s|%COMPONENT_NS_GET_MODULE%|$(foreach m, $($(_META_COMPONENT_NAMES)), REGISTER_MODULE_USING($(m)_NSGetModule);)|" | \
sed -e "s|%COMPONENT_LIST%|$(foreach m, $($(_META_COMPONENT_NAMES)), { $(m)_NSGM_comps, $(m)_NSGM_comp_count }, )|" | \
sed -e "s|%DECLARE_COMPONENT_LIST%|$(foreach m,$($(_META_COMPONENT_NAMES)), extern \"C\" nsresult $(m)_NSGetModule(nsIComponentManager *servMgr, nsIFile* aPath, nsIModule** return_cobj); extern nsModuleComponentInfo* $(m)_NSGM_comps; extern PRUint32 $(m)_NSGM_comp_count;)|" > $@

Просмотреть файл

@ -53,7 +53,7 @@ struct nsModuleComponentInfoContainer {
PRUint32 count;
};
@DECLARE_COMPONENT_LIST@
%DECLARE_COMPONENT_LIST%
static nsresult
NS_RegisterMetaModules(nsIComponentManager *aCompMgr,
@ -63,7 +63,7 @@ NS_RegisterMetaModules(nsIComponentManager *aCompMgr,
{
nsresult rv = NS_OK;
@COMPONENT_NS_GET_MODULE@
%COMPONENT_NS_GET_MODULE%
{};
@ -129,7 +129,7 @@ static nsModuleComponentInfo components[] =
static nsModuleComponentInfoContainer componentsList[] = {
{ components, sizeof(components)/sizeof(components[0]) },
@COMPONENT_LIST@
%COMPONENT_LIST%
{ nsnull, 0 }
};

Просмотреть файл

@ -53,7 +53,7 @@ struct nsModuleComponentInfoContainer {
PRUint32 count;
};
@DECLARE_COMPONENT_LIST@
%DECLARE_COMPONENT_LIST%
static nsresult
NS_RegisterMetaModules(nsIComponentManager *aCompMgr,
@ -63,7 +63,7 @@ NS_RegisterMetaModules(nsIComponentManager *aCompMgr,
{
nsresult rv = NS_OK;
@COMPONENT_NS_GET_MODULE@
%COMPONENT_NS_GET_MODULE%
{};
@ -128,7 +128,7 @@ static nsModuleComponentInfo components[] =
static nsModuleComponentInfoContainer componentsList[] = {
{ components, sizeof(components)/sizeof(components[0]) },
@COMPONENT_LIST@
%COMPONENT_LIST%
{ nsnull, 0 }
};

Просмотреть файл

@ -1,158 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* 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 Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Christopher Seawood <cls@seawood.org>
* Doug Turner <dougt@netscape.com>
*/
#include "nsError.h"
#include "nsIModule.h"
#include "nsIFile.h"
#include "nsIGenericFactory.h"
#include "prmem.h"
#define REGISTER_MODULE_USING(mod) { \
nsCOMPtr<nsIModule> module; \
mod##(compMgr, aPath, getter_AddRefs(module)); \
module->RegisterSelf(compMgr, aPath, "", ""); \
}
struct nsModuleComponentInfoContainer {
nsModuleComponentInfo *list;
PRUint32 count;
};
@DECLARE_COMPONENT_LIST@
static nsresult
NS_RegisterStaticModules(nsIFile *aPath)
{
nsresult rv = PR_TRUE;
nsIComponentManager *compMgr = nsnull;
rv = NS_GetGlobalComponentManager(&compMgr);
NS_ASSERTION(NS_SUCCEEDED(rv), "Static mods cannot get global component manager.");
@COMPONENT_NS_GET_MODULE@
{};
return rv;
}
void StaticModuleDestructor(nsIModule *self, nsModuleComponentInfo *components)
{
PR_Free(components);
}
#define NS_STATICMODULE_CID \
{ 0x1926250e, 0xef22, 0x4c8d, { 0x94, 0x37, 0x86, 0xa8, 0x07, 0xeb, 0xe4, 0xca } }
#define NS_STATICMODULE_CONTRACTID "@mozilla.org/staticmodule;1"
class nsStaticModuleImpl : public nsISupports
{
public:
nsStaticModuleImpl();
virtual ~nsStaticModuleImpl();
NS_DECL_ISUPPORTS
};
nsStaticModuleImpl::nsStaticModuleImpl()
{
NS_INIT_REFCNT();
}
nsStaticModuleImpl::~nsStaticModuleImpl()
{
}
NS_IMPL_ISUPPORTS1(nsStaticModuleImpl, nsISupports);
NS_GENERIC_FACTORY_CONSTRUCTOR(nsStaticModuleImpl)
static NS_METHOD nsStaticModuleRegistrationProc(nsIComponentManager *aCompMgr,
nsIFile *aPath,
const char *registryLocation,
const char *componentType,
const nsModuleComponentInfo *info)
{
NS_RegisterStaticModules(aPath);
return NS_OK;
}
static NS_METHOD nsStaticModuleUnregistrationProc(nsIComponentManager *aCompMgr,
nsIFile *aPath,
const char *registryLocation,
const nsModuleComponentInfo *info)
{
return NS_OK;
}
static nsModuleComponentInfo components[] =
{
{ "Static Component",
NS_STATICMODULE_CID,
NS_STATICMODULE_CONTRACTID,
nsStaticModuleImplConstructor,
nsStaticModuleRegistrationProc,
nsStaticModuleUnregistrationProc
},
};
static nsModuleComponentInfoContainer componentsList[] = {
{ components, sizeof(components)/sizeof(components[0]) },
@COMPONENT_LIST@
{ nsnull, 0 }
};
extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr,
nsIFile* location,
nsIModule** result)
{
nsModuleComponentInfo *outList = nsnull;
nsModuleComponentInfoContainer *inList = componentsList;
PRUint32 count = 0, i = 0, k=0, msize = sizeof(nsModuleComponentInfo);
while (inList[i].list != nsnull) {
count += inList[i].count;
i++;
}
outList = (nsModuleComponentInfo *) PR_Calloc(count, sizeof(nsModuleComponentInfo));
i = 0; k =0;
while (inList[i].list != nsnull) {
memcpy(&outList[k], inList[i].list, msize * inList[i].count);
k+= inList[i].count;
i++;
}
return NS_NewGenericModule("nsStaticModule", count, outList, nsnull, result);
}

Просмотреть файл

@ -264,7 +264,7 @@ endif
nsStaticComponents.cpp: nsStaticComponents.cpp.in Makefile Makefile.in $(FINAL_LINK_COMP_NAMES)
rm -f $@
cat $< | \
sed -e "s|@DECLARE_COMPONENTS@|$(foreach m,$(_COMPONENT_LIST),DECL_MODULE($(m));)|" | \
sed -e "s|@COMPONENT_LIST@|$(foreach m, $(_COMPONENT_LIST),MODULE($(m)),)|" \
sed -e "s|%DECLARE_COMPONENTS%|$(foreach m,$(_COMPONENT_LIST),DECL_MODULE($(m));)|" | \
sed -e "s|%COMPONENT_LIST%|$(foreach m, $(_COMPONENT_LIST),MODULE($(m)),)|" \
> $@

Просмотреть файл

@ -35,10 +35,10 @@ NSGETMODULE_ENTRY_POINT(name) (nsIComponentManager *aCompMgr, \
nsIFile *aLocation, \
nsIModule **aResult)
@DECLARE_COMPONENTS@
%DECLARE_COMPONENTS%
static nsStaticModuleInfo StaticModuleInfo[] = {
@COMPONENT_LIST@
%COMPONENT_LIST%
};
nsresult PR_CALLBACK