Bug 124958 Crash on startup in OpenBSD in static constructor calls

global variables are shared by all shared libraries
patch by wilfried@spamcop.net r=dougt
This commit is contained in:
timeless%mozdev.org 2003-06-13 17:05:56 +00:00
parent c80f2d50a7
commit ac9af605d4

View File

@ -319,11 +319,11 @@ NS_NewGenericModule(const char* moduleName,
#if defined(XPCOM_TRANSLATE_NSGM_ENTRY_POINT)
# define NSMODULEINFO(_name) _name##_gModuleInfo
# define NSGETMODULE_ENTRY_POINT(_info)
# define NSDEPENDENT_LIBS(_name) const char* _name##_gDependlibs[]={DEPENDENT_LIBS "\0"};
# define NSDEPENDENT_LIBS(_name) static const char* _name##_gDependlibs[]={DEPENDENT_LIBS "\0"};
# define NSDEPENDENT_LIBS_NAME(_name) _name##_gDependlibs
#else
# define NSMODULEINFO(_name) gModuleInfo
# define NSDEPENDENT_LIBS(_name) const char* gDependlibs[]={DEPENDENT_LIBS "\0"};
# define NSDEPENDENT_LIBS(_name) static const char* gDependlibs[]={DEPENDENT_LIBS "\0"};
# define NSDEPENDENT_LIBS_NAME(_name) gDependlibs
# define NSGETMODULE_ENTRY_POINT(_info) \
extern "C" NS_EXPORT nsresult \
@ -353,7 +353,7 @@ NSGetModule(nsIComponentManager *servMgr, \
#ifndef DEPENDENT_LIBS
#define NS_IMPL_NSGETMODULE_WITH_CTOR_DTOR(_name, _components, _ctor, _dtor) \
nsModuleInfo NSMODULEINFO(_name) = { \
static nsModuleInfo NSMODULEINFO(_name) = { \
NS_MODULEINFO_VERSION, \
(#_name), \
(_components), \
@ -368,7 +368,7 @@ NSGETMODULE_ENTRY_POINT(NSMODULEINFO(_name))
#define NS_IMPL_NSGETMODULE_WITH_CTOR_DTOR(_name, _components, _ctor, _dtor) \
NSDEPENDENT_LIBS(_name) \
nsModuleInfo NSMODULEINFO(_name) = { \
static nsModuleInfo NSMODULEINFO(_name) = { \
NS_MODULEINFO_VERSION, \
(#_name), \
(_components), \