#endif
}
+static int insideCrossBuild32;
+
static void FixDerivativesBase(Class base, Class mod)
{
OldLink derivative;
if(strstr(name, "ecere::sys::EARHeader") ||
strstr(name, "AnchorValue") ||
!strcmp(name, "ecere::com::CustomAVLTree") ||
+ !strcmp(name, "ecere::com::Array") ||
+ !strcmp(name, "ecere::gui::Window") ||
!strcmp(name, "ecere::sys::Mutex")); // Never recompute these, they're always problematic (errors, crashes)
else
{
#endif
{
int size = _class.structSize;
- Module module = _class.module;
- Application application = module ? module.application : null;
- int flags = application ? application.isGUIApp : 0;
- bool inCompiler = (flags & 8) ? true : false;
- if(inCompiler)
- {
- bool force32Bits = (flags & 4) ? true : false;
- if(force32Bits)
- {
- // Allocate 64 bit sizes for these when cross-compiling for 32 bit to allow loaded libraries to work properly
- if(!strcmp(_class.name, "Module"))
- size = 560;
- else if(_class.templateClass && !strcmp(_class.templateClass.name, "Map"))
- size = 40;
- }
+ if(insideCrossBuild32)
+ {
+ // Allocate 64 bit sizes for these when cross-compiling for 32 bit to allow loaded libraries to work properly
+ if(!strcmp(_class.name, "Module"))
+ size = 560;
+ else if(_class.templateClass && !strcmp(_class.templateClass.name, "Map"))
+ size = 40;
+ else
+ size *= 3;
}
instance = _calloc(1, size);
}
bool (stdcall * Load)(Module module) = null;
bool (stdcall * Unload)(Module module) = null;
Module module;
+ int flags = fromModule.application.isGUIApp;
+ bool inCompiler = (flags & 8) ? true : false;
+ bool force32Bits = (flags & 4) ? true : false;
+ bool setInsideCrossBuild32 = force32Bits && inCompiler;
for(module = fromModule.application.allModules.first; module; module = module.next)
{
}
if(Load)
{
+ if(setInsideCrossBuild32)
+ insideCrossBuild32++;
+
module = (Module)eInstance_New(eSystem_FindClass(fromModule, "Module"));
module.application = fromModule.application;
module.library = library;
module.name = CopyString(name);
module.Unload = Unload;
module.origImportType = normalImport;
+
if(!Load(module))
{
eInstance_Delete((Instance)module);
module = null;
}
+
+ if(setInsideCrossBuild32)
+ insideCrossBuild32--;
}
fromModule.application.allModules.Add(module);
}
Load = COM_LOAD_FUNCTION;
Unload = COM_UNLOAD_FUNCTION;
+ if(setInsideCrossBuild32)
+ insideCrossBuild32++;
+
module = (Module)eInstance_New(eSystem_FindClass(fromModule, "Module"));
module.application = fromModule.application;
module.library = null;
module.name = CopyString(name);
module.Unload = Unload;
+
if(!Load(module))
{
eInstance_Delete((Instance)module);
module = null;
}
+
+ if(setInsideCrossBuild32)
+ insideCrossBuild32--;
fromModule.application.allModules.Add(module);
}
if(module)
{
if(instance && _property && _property.isWatchable)
{
- OldList * watchers = (OldList *)((byte *)instance + _property.watcherOffset);
- Watcher watcher, next;
-
- for(watcher = watchers->first; watcher; watcher = next)
+ if(!insideCrossBuild32)
{
- next = watcher.next;
- watcher.callback(watcher.object, instance);
+ OldList * watchers = (OldList *)((byte *)instance + _property.watcherOffset);
+ Watcher watcher, next;
+
+ for(watcher = watchers->first; watcher; watcher = next)
+ {
+ next = watcher.next;
+ watcher.callback(watcher.object, instance);
+ }
}
}
}