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;
- if(_class.module != __thisModule)
- {
- int flags = _class.module.application.isGUIApp;
- bool force32Bits = (flags & 4) ? true : false;
- bool inCompiler = (flags & 8) ? true : false;
- if(force32Bits && inCompiler)
- {
- // 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;
- }
+ int flags = _class.module.application.isGUIApp;
+ bool inCompiler = (flags & 8) ? true : false;
+ bool force32Bits = (flags & 4) ? true : false;
+ if(force32Bits && inCompiler)
+ {
+ // 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);
}
module.name = CopyString(name);
module.Unload = Unload;
module.origImportType = normalImport;
+
if(!Load(module))
{
eInstance_Delete((Instance)module);
module.library = null;
module.name = CopyString(name);
module.Unload = Unload;
+
if(!Load(module))
{
eInstance_Delete((Instance)module);
module = null;
}
+
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)
+ Module module = instance._class ? instance._class.module : null;
+ Application application = module ? module.application : null;
+ int flags = application ? application.isGUIApp : 0;
+ bool inCompiler = (flags & 8) ? true : false;
+ bool force32Bits = (flags & 4) ? true : false;
+ if(!force32Bits || !inCompiler)
{
- 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);
+ }
}
}
}
return d;
}
+// NOTE: UTF8GetChar now returns 0 into numBytes for the null-terminating character ('\0')
public unichar UTF8GetChar(char * string, int * numBytes)
{
unichar ch;
byte b = ((byte *)string)[0];
int i;
byte mask = 0x7F;
- int nb = 1;
+ int nb = b ? 1 : 0;
ch = 0;
if(b & 0x80)
{