mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-16 12:53:14 +01:00
Fix for shared static constructors and destructors
This commit is contained in:
@@ -501,6 +501,20 @@ void DtoDeclareFunction(FuncDeclaration* fdecl)
|
||||
gIR->mainFunc = func;
|
||||
}
|
||||
|
||||
#if DMDV2
|
||||
// shared static ctor
|
||||
if (fdecl->isSharedStaticCtorDeclaration()) {
|
||||
if (mustDefineSymbol(fdecl)) {
|
||||
gIR->sharedCtors.push_back(fdecl);
|
||||
}
|
||||
}
|
||||
// shared static dtor
|
||||
else if (fdecl->isSharedStaticDtorDeclaration()) {
|
||||
if (mustDefineSymbol(fdecl)) {
|
||||
gIR->sharedDtors.push_back(fdecl);
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
// static ctor
|
||||
if (fdecl->isStaticCtorDeclaration()) {
|
||||
if (mustDefineSymbol(fdecl)) {
|
||||
@@ -513,20 +527,7 @@ void DtoDeclareFunction(FuncDeclaration* fdecl)
|
||||
gIR->dtors.push_back(fdecl);
|
||||
}
|
||||
}
|
||||
#if DMDV2
|
||||
// shared static ctor
|
||||
else if (fdecl->isSharedStaticCtorDeclaration()) {
|
||||
if (mustDefineSymbol(fdecl)) {
|
||||
gIR->sharedCtors.push_back(fdecl);
|
||||
}
|
||||
}
|
||||
// static dtor
|
||||
else if (fdecl->isSharedStaticDtorDeclaration()) {
|
||||
if (mustDefineSymbol(fdecl)) {
|
||||
gIR->sharedDtors.push_back(fdecl);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// we never reference parameters of function prototypes
|
||||
std::string str;
|
||||
// if (!declareOnly)
|
||||
|
||||
Reference in New Issue
Block a user