mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-17 17:29:02 +02:00
Automated merge with http://hg.dsource.org/projects/ldc
This commit is contained in:
@@ -1060,7 +1060,7 @@ extern (C) void _moduleCtor()
|
||||
_moduleinfo_dtors = new ModuleInfo[_moduleinfo_array.length];
|
||||
debug(PRINTF) printf("_moduleinfo_dtors = x%x\n", cast(void *)_moduleinfo_dtors);
|
||||
_moduleIndependentCtors();
|
||||
_moduleCtor2(_moduleinfo_array, 0);
|
||||
_moduleCtor2(null, _moduleinfo_array, 0);
|
||||
}
|
||||
|
||||
extern (C) void _moduleIndependentCtors()
|
||||
@@ -1076,7 +1076,7 @@ extern (C) void _moduleIndependentCtors()
|
||||
debug(PRINTF) printf("_moduleIndependentCtors() DONE\n");
|
||||
}
|
||||
|
||||
void _moduleCtor2(ModuleInfo[] mi, int skip)
|
||||
void _moduleCtor2(ModuleInfo from, ModuleInfo[] mi, int skip)
|
||||
{
|
||||
debug(PRINTF) printf("_moduleCtor2(): %d modules\n", mi.length);
|
||||
for (uint i = 0; i < mi.length; i++)
|
||||
@@ -1096,11 +1096,12 @@ void _moduleCtor2(ModuleInfo[] mi, int skip)
|
||||
if (m.flags & MIctorstart)
|
||||
{ if (skip || m.flags & MIstandalone)
|
||||
continue;
|
||||
throw new Exception( "Cyclic dependency in module " ~ m.name );
|
||||
assert(from !is null);
|
||||
throw new Exception( "Cyclic dependency in module " ~ from.name ~ " for import " ~ m.name);
|
||||
}
|
||||
|
||||
m.flags |= MIctorstart;
|
||||
_moduleCtor2(m.importedModules, 0);
|
||||
_moduleCtor2(m, m.importedModules, 0);
|
||||
if (m.ctor)
|
||||
(*m.ctor)();
|
||||
m.flags &= ~MIctorstart;
|
||||
@@ -1114,7 +1115,7 @@ void _moduleCtor2(ModuleInfo[] mi, int skip)
|
||||
else
|
||||
{
|
||||
m.flags |= MIctordone;
|
||||
_moduleCtor2(m.importedModules, 1);
|
||||
_moduleCtor2(m, m.importedModules, 1);
|
||||
}
|
||||
}
|
||||
debug(PRINTF) printf("_moduleCtor2() DONE\n");
|
||||
|
||||
Reference in New Issue
Block a user