compiler/bootstrap: Reverted to using 'uintptr' for bootstrap; Hardcoding FileListing...
[sdk] / compiler / bootstrap / ecere / bootstrap / instance.c
index d641033..7ae764e 100644 (file)
@@ -5,6 +5,7 @@ typedef unsigned long long uint64;
 #define stdcall __attribute__((__stdcall__))
 #else
 #define stdcall
+#define __declspec(x)
 #endif
 #elif defined(__TINYC__)
 #include <stdarg.h>
@@ -17,6 +18,7 @@ typedef unsigned long long uint64;
 #define __declspec(x) __attribute__((x))
 #define stdcall __attribute__((__stdcall__))
 #else
+#define __declspec(x)
 #define stdcall
 #endif
 typedef long long int64;
@@ -30,6 +32,17 @@ typedef unsigned __int64 uint64;
 #else
 #define __ENDIAN_PAD(x) 0
 #endif
+#ifdef __MINGW32__
+#ifdef _WIN64
+typedef unsigned long long int uintptr_t;
+typedef long long int intptr_t;
+#else
+typedef unsigned int uintptr_t;
+typedef int intptr_t;
+#endif
+#else
+#include <stdint.h>
+#endif
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
 
 struct __ecereNameSpace__ecere__sys__BTNode;
@@ -40,9 +53,9 @@ struct __ecereNameSpace__ecere__sys__BinaryTree
 {
 struct __ecereNameSpace__ecere__sys__BTNode * root;
 int count;
-int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, unsigned int a, unsigned int b);
+int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
 void (*  FreeKey)(void *  key);
-};
+} __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__OldList;
 
@@ -53,7 +66,7 @@ void *  last;
 int count;
 unsigned int offset;
 unsigned int circ;
-};
+} __attribute__ ((gcc_struct));
 
 struct __ecereNameSpace__ecere__com__Class
 {
@@ -105,7 +118,7 @@ struct __ecereNameSpace__ecere__com__ClassTemplateArgument * templateArgs;
 struct __ecereNameSpace__ecere__com__Class * templateClass;
 struct __ecereNameSpace__ecere__sys__OldList templatized;
 int numParams;
-};
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
 
@@ -116,7 +129,7 @@ struct __ecereNameSpace__ecere__com__Instance
 int (* *  _vTbl)();
 struct __ecereNameSpace__ecere__com__Class * _class;
 int _refCount;
-};
+} __attribute__ ((gcc_struct));
 
 struct __ecereNameSpace__ecere__com__Property
 {
@@ -140,7 +153,7 @@ unsigned int watcherOffset;
 char * category;
 unsigned int compiled;
 unsigned int selfWatchable, isWatchable;
-};
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Property;
 
@@ -162,7 +175,7 @@ struct __ecereNameSpace__ecere__sys__OldList members;
 struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
 int memberOffset;
 int structAlignment;
-};
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataMember;
 
@@ -179,7 +192,7 @@ void * symbol;
 char * dataTypeString;
 struct __ecereNameSpace__ecere__com__Instance * dataType;
 int memberAccess;
-};
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Method;
 
@@ -191,7 +204,7 @@ unsigned char *  _buffer;
 unsigned int count;
 unsigned int _size;
 unsigned int pos;
-};
+} __attribute__ ((gcc_struct));
 
 struct __ecereNameSpace__ecere__com__DataValue
 {
@@ -208,8 +221,8 @@ float f;
 double d;
 long long i64;
 uint64 ui64;
-};
-};
+} __attribute__ ((gcc_struct));
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DataValue;
 
@@ -221,7 +234,7 @@ struct
 {
 char * dataTypeString;
 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
-};
+} __attribute__ ((gcc_struct));
 struct __ecereNameSpace__ecere__com__DataValue expression;
 struct
 {
@@ -231,14 +244,14 @@ union
 struct __ecereNameSpace__ecere__com__DataMember * member;
 struct __ecereNameSpace__ecere__com__Property * prop;
 struct __ecereNameSpace__ecere__com__Method * method;
-};
-};
-};
-};
+} __attribute__ ((gcc_struct));
+} __attribute__ ((gcc_struct));
+} __attribute__ ((gcc_struct));
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateArgument;
 
-typedef unsigned int size_t;
+typedef uintptr_t size_t;
 
 void exit(int status);
 
@@ -286,6 +299,10 @@ size_t fread(void * ptr, size_t size, size_t nmemb, FILE * stream);
 
 size_t fwrite(const void * ptr, size_t size, size_t nmemb, FILE * stream);
 
+int vsnprintf(char *, size_t, const char *, ...);
+
+int snprintf(char * str, size_t, const char * format, ...);
+
 int fseek(FILE * stream, long offset, int whence);
 
 long ftell(FILE * stream);
@@ -351,9 +368,9 @@ void __ecereNameSpace__ecere__com__MemoryGuard_PopLoc()
 {
 }
 
-extern unsigned int stdcall __ecereDll_Load_ecere(struct __ecereNameSpace__ecere__com__Instance * module);
+extern unsigned int __ecereDll_Load_ecere(struct __ecereNameSpace__ecere__com__Instance * module);
 
-extern void stdcall __ecereDll_Unload_ecere(struct __ecereNameSpace__ecere__com__Instance * module);
+extern unsigned int __ecereDll_Unload_ecere(struct __ecereNameSpace__ecere__com__Instance * module);
 
 struct __ecereNameSpace__ecere__com__BTNamedLink
 {
@@ -361,7 +378,7 @@ char * name;
 struct __ecereNameSpace__ecere__com__BTNamedLink * parent, * left, * right;
 int depth;
 void * data;
-};
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BTNamedLink;
 
@@ -370,7 +387,7 @@ struct __ecereNameSpace__ecere__com__SelfWatcher
 struct __ecereNameSpace__ecere__com__SelfWatcher * prev, * next;
 void (* callback)(struct __ecereNameSpace__ecere__com__Instance *);
 struct __ecereNameSpace__ecere__com__Property * _property;
-};
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SelfWatcher;
 
@@ -381,7 +398,7 @@ struct __ecereNameSpace__ecere__com__SubModule
 struct __ecereNameSpace__ecere__com__SubModule * prev, * next;
 struct __ecereNameSpace__ecere__com__Instance * module;
 int importMode;
-};
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__SubModule;
 
@@ -420,7 +437,7 @@ struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
-};
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__NameSpace;
 
@@ -439,9 +456,10 @@ char *  name;
 void *  library;
 void *  Unload;
 int importType;
+int origImportType;
 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
-};
+} __attribute__ ((gcc_struct));
 
 unsigned int __ecereMethod___ecereNameSpace__ecere__com__Class_OnGetDataFromString(struct __ecereNameSpace__ecere__com__Class * class, struct __ecereNameSpace__ecere__com__Class ** this, char * string)
 {
@@ -497,10 +515,10 @@ union
 {
 char * dataTypeString;
 int memberType;
-};
+} __attribute__ ((gcc_struct));
 struct __ecereNameSpace__ecere__com__ClassTemplateArgument defaultArg;
 void * param;
-};
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassTemplateParameter;
 
@@ -523,7 +541,7 @@ int type;
 int size;
 int pos;
 uint64 mask;
-};
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BitMember;
 
@@ -532,12 +550,12 @@ struct __ecereNameSpace__ecere__com__ClassProperty
 char * name;
 struct __ecereNameSpace__ecere__com__ClassProperty * parent, * left, * right;
 int depth;
-void (* Set)(struct __ecereNameSpace__ecere__com__Class *, int);
-int (* Get)(struct __ecereNameSpace__ecere__com__Class *);
+void (* Set)(struct __ecereNameSpace__ecere__com__Class *, long long);
+long long (* Get)(struct __ecereNameSpace__ecere__com__Class *);
 char * dataTypeString;
 struct __ecereNameSpace__ecere__com__Instance * dataType;
 unsigned int constant;
-};
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ClassProperty;
 
@@ -547,7 +565,7 @@ struct __ecereNameSpace__ecere__com__DefinedExpression * prev, * next;
 char * name;
 char * value;
 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
-};
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DefinedExpression;
 
@@ -561,7 +579,7 @@ struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
 char * dataTypeString;
 struct __ecereNameSpace__ecere__com__Instance * dataType;
 void * symbol;
-};
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__GlobalFunction;
 
@@ -569,7 +587,7 @@ struct __ecereNameSpace__ecere__com__EnumClassData
 {
 struct __ecereNameSpace__ecere__sys__OldList values;
 int largest;
-};
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__EnumClassData;
 
@@ -578,7 +596,7 @@ struct __ecereNameSpace__ecere__com__Watcher
 struct __ecereNameSpace__ecere__com__Watcher * prev, * next;
 void (* callback)(struct __ecereNameSpace__ecere__com__Instance *, struct __ecereNameSpace__ecere__com__Instance *);
 struct __ecereNameSpace__ecere__com__Instance * object;
-};
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Watcher;
 
@@ -591,7 +609,7 @@ struct __ecereNameSpace__ecere__com__MemBlock
 struct __ecereNameSpace__ecere__com__MemBlock * prev, * next;
 struct __ecereNameSpace__ecere__com__MemPart * part;
 unsigned int size;
-};
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__MemBlock;
 
@@ -601,7 +619,7 @@ void * memory;
 int blocksUsed;
 int size;
 struct __ecereNameSpace__ecere__com__BlockPool * pool;
-};
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__MemPart;
 
@@ -620,7 +638,7 @@ int numParts;
 int numBlocks;
 unsigned int totalSize;
 unsigned int usedSpace;
-};
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__BlockPool;
 
@@ -780,7 +798,7 @@ return current;
 static unsigned int __ecereNameSpace__ecere__com__log1_5i(unsigned int number)
 {
 unsigned int pos;
-uint64 current = 4;
+uint64 current = sizeof(void *);
 
 for(pos = 0; pos < 31; pos++)
 {
@@ -796,7 +814,7 @@ return pos;
 static unsigned int __ecereNameSpace__ecere__com__pow1_5(unsigned int number)
 {
 unsigned int pos;
-uint64 current = 4;
+uint64 current = sizeof(void *);
 
 for(pos = 0; pos < number; pos++)
 {
@@ -810,7 +828,7 @@ return (unsigned int)current;
 static unsigned int __ecereNameSpace__ecere__com__pow1_5i(unsigned int number)
 {
 unsigned int pos;
-uint64 current = 4;
+uint64 current = sizeof(void *);
 
 for(pos = 0; pos < 31; pos++)
 {
@@ -851,8 +869,8 @@ for(c = 0; c < 31; c++)
 int expansion;
 
 __ecereNameSpace__ecere__com__pools[c].blockSize = __ecereNameSpace__ecere__com__pow1_5(c);
-if(__ecereNameSpace__ecere__com__pools[c].blockSize % 4)
-__ecereNameSpace__ecere__com__pools[c].blockSize += 4 - (__ecereNameSpace__ecere__com__pools[c].blockSize % 4);
+if(__ecereNameSpace__ecere__com__pools[c].blockSize % sizeof(void *))
+__ecereNameSpace__ecere__com__pools[c].blockSize += sizeof(void *) - (__ecereNameSpace__ecere__com__pools[c].blockSize % sizeof(void *));
 __ecereNameSpace__ecere__com__pools[c].blockSpace = __ecereNameSpace__ecere__com__pools[c].blockSize;
 __ecereNameSpace__ecere__com__pools[c].blockSpace += sizeof(struct __ecereNameSpace__ecere__com__MemBlock);
 expansion = (__ecereNameSpace__ecere__com__pools[c].blockSize < 128) ? 1024 : (131072 / __ecereNameSpace__ecere__com__pools[c].blockSize);
@@ -938,10 +956,10 @@ if(block)
 if(pool)
 {
 unsigned int ns = __ecereNameSpace__ecere__com__pow1_5i(size);
-unsigned int mod = ns % 4;
+unsigned int mod = ns % sizeof(void *);
 
 if(mod)
-ns += 4 - mod;
+ns += sizeof(void *) - mod;
 if(ns == (*pool).blockSize)
 {
 newPointer = pointer;
@@ -987,10 +1005,10 @@ if(block)
 if(pool)
 {
 unsigned int ns = __ecereNameSpace__ecere__com__pow1_5i(size);
-unsigned int mod = ns % 4;
+unsigned int mod = ns % sizeof(void *);
 
 if(mod)
-ns += 4 - mod;
+ns += sizeof(void *) - mod;
 if(ns == (*pool).blockSize)
 {
 int extra = size - block->size;
@@ -1118,7 +1136,7 @@ struct __ecereNameSpace__ecere__sys__OldLink
 struct __ecereNameSpace__ecere__sys__OldLink * prev;
 struct __ecereNameSpace__ecere__sys__OldLink * next;
 void *  data;
-};
+} __attribute__ ((gcc_struct));
 
 extern char *  __ecereNameSpace__ecere__sys__CopyString(char *  string);
 
@@ -1162,7 +1180,16 @@ int offsetClass, totalSizeClass;
 for(baseClass = base; baseClass->base; baseClass = baseClass->base)
 ;
 if(base && !base->internalDecl && (base->type == 5 || base->type == 1 || base->type == 0))
+{
+if(base->type == 1 && type == 0)
+type = 5;
+else
+type = base->type;
+}
+if(base && (_class->type == 0 || _class->type == 5 || _class->type == 1) && (base->type == 3 || base->type == 2 || base->type == 4))
+{
 type = base->type;
+}
 if(type == 4)
 {
 if(base->type != 4)
@@ -1209,20 +1236,26 @@ memset((unsigned char *)_class->data, (unsigned char)0, totalSizeClass - _class-
 }
 _class->offsetClass = offsetClass;
 _class->sizeClass = totalSizeClass;
-if(mod->base && mod->base->base && mod->base->vTblSize > baseClass->vTblSize && (mod != (base->templateClass ? base->templateClass : base) || _class->vTblSize != mod->vTblSize))
 {
 struct __ecereNameSpace__ecere__com__Method * method, * next;
 struct __ecereNameSpace__ecere__com__Class * b;
+unsigned int needUpdate = (mod != (base->templateClass ? base->templateClass : base) || _class->vTblSize != mod->vTblSize);
+int updateStart = -1, updateEnd = -1;
 
+if(mod->base && mod->base->base && mod->base->vTblSize > baseClass->vTblSize && needUpdate)
+{
 _class->vTblSize += mod->base->vTblSize - baseClass->vTblSize;
 _class->_vTbl = __ecereNameSpace__ecere__com__eSystem_Renew(_class->_vTbl, sizeof(void *) * (_class->vTblSize));
 memmove(_class->_vTbl + mod->base->vTblSize, _class->_vTbl + baseClass->vTblSize, (_class->vTblSize - mod->vTblSize) * sizeof(void *));
+updateStart = baseClass->vTblSize;
+updateEnd = updateStart + mod->base->vTblSize - baseClass->vTblSize;
 for(method = (struct __ecereNameSpace__ecere__com__Method *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&_class->methods); method; method = next)
 {
 next = (struct __ecereNameSpace__ecere__com__Method *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)method));
 if(method->type == 1)
 method->vid += mod->base->vTblSize - baseClass->vTblSize;
 }
+}
 for(b = mod->base; b && b != (((void *)0)); b = b->base)
 {
 struct __ecereNameSpace__ecere__com__Method * vMethod;
@@ -1250,7 +1283,7 @@ method->dataTypeString = __ecereNameSpace__ecere__sys__CopyString(vMethod->dataT
 method->_class = vMethod->_class;
 }
 }
-else
+else if((vMethod->vid >= updateStart && vMethod->vid < updateEnd) || _class->_vTbl[vMethod->vid] == b->_vTbl[vMethod->vid])
 _class->_vTbl[vMethod->vid] = _class->base->_vTbl[vMethod->vid];
 }
 }
@@ -1357,7 +1390,7 @@ unsigned int isGUIApp;
 struct __ecereNameSpace__ecere__sys__OldList allModules;
 char *  parsedCommand;
 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
-};
+} __attribute__ ((gcc_struct));
 
 extern char *  strncpy(char * , const char * , int n);
 
@@ -1367,8 +1400,6 @@ static void __ecereNameSpace__ecere__com__FreeTemplatesDerivatives(struct __ecer
 
 extern int printf(char * , ...);
 
-extern char *  __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char *  string, char *  stringAndContext);
-
 static void __ecereNameSpace__ecere__com__NameSpace_Free(struct __ecereNameSpace__ecere__com__NameSpace * parentNameSpace);
 
 static struct __ecereNameSpace__ecere__com__BTNamedLink * __ecereNameSpace__ecere__com__SearchNameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char *  name, void *  listOffset);
@@ -1394,11 +1425,12 @@ struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSyst
 void * __ecereTemp1;
 int start = 0, c;
 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace = (((void *)0));
+unsigned int force64Bits = ((unsigned int)((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 300)))->isGUIApp & 2) ? 0x1 : 0x0;
 
 {
 nameSpace = (declMode == 1) ? &((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace : &((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->privateNameSpace;
 if(declMode == 4)
-nameSpace = &((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 296)))->systemNameSpace;
+nameSpace = &((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 300)))->systemNameSpace;
 {
 for(c = 0; name[c]; c++)
 {
@@ -1522,7 +1554,7 @@ __ecereNameSpace__ecere__com__FreeTemplatesDerivatives(_class);
 if(!_class->internalDecl)
 {
 if(declMode != 4)
-printf(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "error: Redefinition of class %s\n", (((void *)0))), name);
+printf("error: Redefinition of class %s\n", name);
 else
 {
 _class->comRedefinition = 0x1;
@@ -1727,7 +1759,36 @@ id++;
 }
 _class->memberID = _class->startMemberID = (base && (type == 0 || type == 5 || type == 1)) ? base->memberID : 0;
 if(type == 0 || type == 5)
-_class->offset = (base && base->structSize && base->type != 1000) ? base->structSize : ((type == 5) ? 0 : 12);
+_class->offset = (base && base->structSize && base->type != 1000) ? base->structSize : ((type == 5) ? 0 : (force64Bits ? 24 : 12));
+if(force64Bits)
+{
+if(!strcmp(name, "ecere::com::Class"))
+size = 0;
+else if(!strcmp(name, "ecere::com::ClassProperty"))
+size = 0;
+else if(!strcmp(name, "ecere::sys::BufferedFile"))
+size = 0;
+else if(!strcmp(name, "ecere::sys::BTNode"))
+size = 0;
+else if(!strcmp(name, "ecere::sys::StringBTNode"))
+size = 0;
+else if(!strcmp(name, "ecere::sys::OldList"))
+size = 0;
+else if(!strcmp(name, "ecere::sys::Item"))
+size = 0;
+else if(!strcmp(name, "ecere::sys::NamedLink"))
+size = 0;
+else if(!strcmp(name, "ecere::sys::OldLink"))
+size = 0;
+else if(!strcmp(name, "ecere::sys::NamedItem"))
+size = 0;
+else if(!strcmp(name, "ecere::sys::NamedItem64"))
+size = 0;
+else if(!strcmp(name, "ecere::sys::BinaryTree"))
+size = 0;
+else if(!strcmp(name, "ecere::sys::FileListing"))
+size = 3 * 8;
+}
 if(type == 1)
 {
 _class->memberOffset = (base && base->structSize && base->type != 1000) ? base->structSize : 0;
@@ -1816,7 +1877,7 @@ struct __ecereNameSpace__ecere__sys__NamedLink * prev;
 struct __ecereNameSpace__ecere__sys__NamedLink * next;
 char *  name;
 void *  data;
-};
+} __attribute__ ((gcc_struct));
 
 static void __ecereNameSpace__ecere__com__FreeEnumValue(struct __ecereNameSpace__ecere__sys__NamedLink * value)
 {
@@ -2030,12 +2091,12 @@ __ecereMethod___ecereNameSpace__ecere__sys__OldList_Delete(&_class->templatePara
 __ecereNameSpace__ecere__com___free(_class);
 }
 
-struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Find(struct __ecereNameSpace__ecere__sys__BinaryTree * this, unsigned int key);
+struct __ecereNameSpace__ecere__sys__BTNode * __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Find(struct __ecereNameSpace__ecere__sys__BinaryTree * this, uintptr_t key);
 
 static struct __ecereNameSpace__ecere__com__BTNamedLink * __ecereNameSpace__ecere__com__ScanNameSpace(struct __ecereNameSpace__ecere__com__NameSpace * nameSpace, char * name, void * listOffset)
 {
 struct __ecereNameSpace__ecere__sys__BinaryTree * tree = (struct __ecereNameSpace__ecere__sys__BinaryTree *)((unsigned char *)nameSpace + (unsigned int)listOffset);
-struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Find((&*tree), (unsigned int)name);
+struct __ecereNameSpace__ecere__com__BTNamedLink * link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Find((&*tree), (uintptr_t)name);
 struct __ecereNameSpace__ecere__com__NameSpace * child;
 
 if(!link)
@@ -2248,7 +2309,7 @@ if(name && module)
 {
 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
 
-link = __ecereNameSpace__ecere__com__SearchNameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 296)))->systemNameSpace, name, &(*((struct __ecereNameSpace__ecere__com__NameSpace *)0)).classes);
+link = __ecereNameSpace__ecere__com__SearchNameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 300)))->systemNameSpace, name, &(*((struct __ecereNameSpace__ecere__com__NameSpace *)0)).classes);
 if(link)
 return link->data;
 link = __ecereNameSpace__ecere__com__SearchModule(module, name, &(*((struct __ecereNameSpace__ecere__com__NameSpace *)0)).classes, 0x1);
@@ -2265,7 +2326,7 @@ noTemplateName[templateParams - name] = '\0';
 }
 else
 strcpy(noTemplateName, name);
-link = __ecereNameSpace__ecere__com__SearchNameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 296)))->systemNameSpace, noTemplateName, &(*((struct __ecereNameSpace__ecere__com__NameSpace *)0)).classes);
+link = __ecereNameSpace__ecere__com__SearchNameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 300)))->systemNameSpace, noTemplateName, &(*((struct __ecereNameSpace__ecere__com__NameSpace *)0)).classes);
 if(!link)
 link = __ecereNameSpace__ecere__com__SearchModule(module, noTemplateName, &(*((struct __ecereNameSpace__ecere__com__NameSpace *)0)).classes, 0x1);
 if(link)
@@ -2276,7 +2337,7 @@ char className[1024];
 
 strcpy(className, _class->fullName);
 strcat(className, templateParams);
-link = __ecereNameSpace__ecere__com__SearchNameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 296)))->systemNameSpace, className, &(*((struct __ecereNameSpace__ecere__com__NameSpace *)0)).classes);
+link = __ecereNameSpace__ecere__com__SearchNameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 300)))->systemNameSpace, className, &(*((struct __ecereNameSpace__ecere__com__NameSpace *)0)).classes);
 if(link)
 return link->data;
 link = __ecereNameSpace__ecere__com__SearchModule(module, className, &(*((struct __ecereNameSpace__ecere__com__NameSpace *)0)).classes, 0x1);
@@ -3234,17 +3295,27 @@ __ecereNameSpace__ecere__com__FixDerivativeProperty(_class, _property);
 return _property;
 }
 
+extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__NamedLink64;
+
+struct __ecereNameSpace__ecere__sys__NamedLink64
+{
+struct __ecereNameSpace__ecere__sys__NamedLink64 * prev;
+struct __ecereNameSpace__ecere__sys__NamedLink64 * next;
+char *  name;
+long long data;
+} __attribute__ ((gcc_struct));
+
 static void __ecereNameSpace__ecere__com__SetDelayedCPValues(struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__ClassProperty * _property)
 {
 struct __ecereNameSpace__ecere__sys__OldLink * deriv;
-struct __ecereNameSpace__ecere__sys__NamedLink * value, * next;
+struct __ecereNameSpace__ecere__sys__NamedLink64 * value, * next;
 
 for(value = _class->delayedCPValues.first; value; value = next)
 {
 next = value->next;
 if(!strcmp(value->name, _property->name))
 {
-_property->Set(_class, (int)value->data);
+_property->Set(_class, value->data);
 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Delete(&_class->delayedCPValues, value);
 }
 }
@@ -3291,20 +3362,20 @@ _property = __ecereNameSpace__ecere__com__eClass_FindClassProperty(enumClass, na
 return _property;
 }
 
-int __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name)
+long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name)
 {
 struct __ecereNameSpace__ecere__com__ClassProperty * _property = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, name);
 
 if(_property && _property->Get && _property->Get != (void *)1)
 {
-int result = _property->Get(_class);
+long long result = _property->Get(_class);
 
 return result;
 }
 return 0;
 }
 
-void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name, int value)
+void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name, long long value)
 {
 void * __ecereTemp1;
 struct __ecereNameSpace__ecere__com__ClassProperty * _property = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, name);
@@ -3312,11 +3383,11 @@ struct __ecereNameSpace__ecere__com__ClassProperty * _property = __ecereNameSpac
 if(_property)
 {
 if(_property->Set)
-_property->Set(_class, value);
+((void (*)(void *, long long))_property->Set)(_class, value);
 }
 else
 {
-__ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&_class->delayedCPValues, (__ecereTemp1 = __ecereNameSpace__ecere__com__eSystem_New0(16), ((struct __ecereNameSpace__ecere__sys__NamedLink *)__ecereTemp1)->name = name, ((struct __ecereNameSpace__ecere__sys__NamedLink *)__ecereTemp1)->data = (void *)value, ((struct __ecereNameSpace__ecere__sys__NamedLink *)__ecereTemp1)));
+__ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&_class->delayedCPValues, (__ecereTemp1 = __ecereNameSpace__ecere__com__eSystem_New0(24), ((struct __ecereNameSpace__ecere__sys__NamedLink64 *)__ecereTemp1)->name = name, ((struct __ecereNameSpace__ecere__sys__NamedLink64 *)__ecereTemp1)->data = value, ((struct __ecereNameSpace__ecere__sys__NamedLink64 *)__ecereTemp1)));
 }
 }
 
@@ -3357,13 +3428,13 @@ break;
 return (((void *)0));
 }
 
-static unsigned int __ecereNameSpace__ecere__com__ConstructInstance(void * instance, struct __ecereNameSpace__ecere__com__Class * _class)
+static unsigned int __ecereNameSpace__ecere__com__ConstructInstance(void * instance, struct __ecereNameSpace__ecere__com__Class * _class, struct __ecereNameSpace__ecere__com__Class * from)
 {
 if(_class->templateClass)
 _class = _class->templateClass;
-if(_class->base)
+if(_class->base && from != _class->base)
 {
-if(!__ecereNameSpace__ecere__com__ConstructInstance(instance, _class->base))
+if(!__ecereNameSpace__ecere__com__ConstructInstance(instance, _class->base, from))
 return 0x0;
 }
 if(_class->Initialize)
@@ -3403,7 +3474,7 @@ if(_class->type == 0)
 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)instance)->_class = _class;
 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)instance)->_vTbl = _class->_vTbl;
 }
-if(!__ecereNameSpace__ecere__com__ConstructInstance(instance, _class))
+if(!__ecereNameSpace__ecere__com__ConstructInstance(instance, _class, (((void *)0))))
 {
 __ecereNameSpace__ecere__com___free(instance);
 instance = (((void *)0));
@@ -3416,11 +3487,13 @@ void __ecereNameSpace__ecere__com__eInstance_Evolve(struct __ecereNameSpace__ece
 {
 if(_class && instancePtr && *instancePtr)
 {
+unsigned int wasApp = 0x0, wasGuiApp = 0x0;
 struct __ecereNameSpace__ecere__com__Instance * instance = (struct __ecereNameSpace__ecere__com__Instance *)__ecereNameSpace__ecere__com__eSystem_Renew(*instancePtr, sizeof(unsigned char) * (_class->structSize));
+struct __ecereNameSpace__ecere__com__Class * fromClass = ((struct __ecereNameSpace__ecere__com__Instance *)(char *)instance)->_class;
 
 *instancePtr = instance;
 memset(((unsigned char *)instance) + ((struct __ecereNameSpace__ecere__com__Instance *)(char *)instance)->_class->structSize, (unsigned char)0, _class->structSize - ((struct __ecereNameSpace__ecere__com__Instance *)(char *)instance)->_class->structSize);
-if(!strcmp(((struct __ecereNameSpace__ecere__com__Instance *)(char *)instance)->_class->name, "Application"))
+if((wasApp = !strcmp(((struct __ecereNameSpace__ecere__com__Instance *)(char *)instance)->_class->name, "Application")) || (wasGuiApp = !strcmp(((struct __ecereNameSpace__ecere__com__Instance *)(char *)instance)->_class->name, "GuiApplication")))
 {
 struct __ecereNameSpace__ecere__com__Instance * module;
 struct __ecereNameSpace__ecere__com__Instance * app = (struct __ecereNameSpace__ecere__com__Instance *)instance;
@@ -3428,7 +3501,7 @@ struct __ecereNameSpace__ecere__com__BTNamedLink * link;
 struct __ecereNameSpace__ecere__com__Class * _class;
 struct __ecereNameSpace__ecere__com__NameSpace * nameSpace;
 
-for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
+for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
 ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application = app;
 for(link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)app + 12)))->privateNameSpace.classes); link; link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)link)))
 {
@@ -3466,11 +3539,11 @@ for(nameSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___
 (*nameSpace).parent = &((struct __ecereNameSpace__ecere__com__Module *)(((char *)app + 12)))->privateNameSpace;
 for(nameSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)app + 12)))->publicNameSpace.nameSpaces); nameSpace; nameSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)nameSpace)))
 (*nameSpace).parent = &((struct __ecereNameSpace__ecere__com__Module *)(((char *)app + 12)))->publicNameSpace;
-for(link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->systemNameSpace.classes); link; link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)link)))
+for(link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->systemNameSpace.classes); link; link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)link)))
 {
 struct __ecereNameSpace__ecere__sys__OldLink * t;
 
-((struct __ecereNameSpace__ecere__com__Class *)link->data)->nameSpace = &((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->systemNameSpace;
+((struct __ecereNameSpace__ecere__com__Class *)link->data)->nameSpace = &((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->systemNameSpace;
 for(t = ((struct __ecereNameSpace__ecere__com__Class *)link->data)->templatized.first; t; t = t->next)
 {
 struct __ecereNameSpace__ecere__com__Class * template = t->data;
@@ -3478,14 +3551,14 @@ struct __ecereNameSpace__ecere__com__Class * template = t->data;
 template->nameSpace = ((struct __ecereNameSpace__ecere__com__Class *)link->data)->nameSpace;
 }
 }
-for(link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->systemNameSpace.defines); link; link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)link)))
-((struct __ecereNameSpace__ecere__com__DefinedExpression *)link->data)->nameSpace = &((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->systemNameSpace;
-for(link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->systemNameSpace.functions); link; link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)link)))
-((struct __ecereNameSpace__ecere__com__GlobalFunction *)link->data)->nameSpace = &((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->systemNameSpace;
-for(link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->systemNameSpace.functions); link; link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)link)))
-((struct __ecereNameSpace__ecere__com__GlobalFunction *)link->data)->nameSpace = &((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->systemNameSpace;
-for(nameSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->systemNameSpace.nameSpaces); nameSpace; nameSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)nameSpace)))
-(*nameSpace).parent = &((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->systemNameSpace;
+for(link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->systemNameSpace.defines); link; link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)link)))
+((struct __ecereNameSpace__ecere__com__DefinedExpression *)link->data)->nameSpace = &((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->systemNameSpace;
+for(link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->systemNameSpace.functions); link; link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)link)))
+((struct __ecereNameSpace__ecere__com__GlobalFunction *)link->data)->nameSpace = &((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->systemNameSpace;
+for(link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->systemNameSpace.functions); link; link = (struct __ecereNameSpace__ecere__com__BTNamedLink *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)link)))
+((struct __ecereNameSpace__ecere__com__GlobalFunction *)link->data)->nameSpace = &((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->systemNameSpace;
+for(nameSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BinaryTree_Get_first(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->systemNameSpace.nameSpaces); nameSpace; nameSpace = (struct __ecereNameSpace__ecere__com__NameSpace *)__ecereProp___ecereNameSpace__ecere__sys__BTNode_Get_next(((struct __ecereNameSpace__ecere__sys__BTNode *)nameSpace)))
+(*nameSpace).parent = &((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->systemNameSpace;
 for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)app + 12)))->classes.first; _class; _class = _class->next)
 {
 struct __ecereNameSpace__ecere__sys__OldLink * templateLink;
@@ -3498,6 +3571,21 @@ struct __ecereNameSpace__ecere__com__Class * template = templateLink->data;
 template->module = _class->module;
 }
 }
+for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
+{
+for(_class = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->classes.first; _class; _class = _class->next)
+{
+struct __ecereNameSpace__ecere__sys__OldLink * templateLink;
+
+_class->module = module;
+for(templateLink = _class->templatized.first; templateLink; templateLink = templateLink->next)
+{
+struct __ecereNameSpace__ecere__com__Class * template = templateLink->data;
+
+template->module = _class->module;
+}
+}
+}
 ((struct __ecereNameSpace__ecere__com__Module *)(((char *)app + 12)))->application = app;
 }
 {
@@ -3508,7 +3596,7 @@ for(base = ((struct __ecereNameSpace__ecere__com__Instance *)(char *)instance)->
 }
 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)instance)->_class = _class;
 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)instance)->_vTbl = _class->_vTbl;
-if(!__ecereNameSpace__ecere__com__ConstructInstance(instance, _class))
+if(!__ecereNameSpace__ecere__com__ConstructInstance(instance, _class, fromClass))
 {
 __ecereNameSpace__ecere__com___free(instance);
 *instancePtr = (((void *)0));
@@ -4104,17 +4192,17 @@ static struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__
 {
 void * __ecereTemp1;
 unsigned int (stdcall * Load)(struct __ecereNameSpace__ecere__com__Instance * module) = (((void *)0));
-void (stdcall * Unload)(struct __ecereNameSpace__ecere__com__Instance * module) = (((void *)0));
+unsigned int (stdcall * Unload)(struct __ecereNameSpace__ecere__com__Instance * module) = (((void *)0));
 struct __ecereNameSpace__ecere__com__Instance * module;
 
-for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + 12)))->application + 296)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
+for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + 12)))->application + 300)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
 {
 if(!strcmp(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->name, name))
 break;
 }
 if(ensureCOM && (!strcmp(name, "ecereCOM") || !strcmp(name, "ecere")))
 {
-for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + 12)))->application + 296)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
+for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + 12)))->application + 300)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
 {
 if(!strcmp(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->name, "ecere") || !strcmp(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->name, "ecereCOM"))
 break;
@@ -4140,13 +4228,14 @@ module = (struct __ecereNameSpace__ecere__com__Instance *)__ecereNameSpace__ecer
 ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->library = library;
 ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->name = __ecereNameSpace__ecere__sys__CopyString(name);
 ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->Unload = Unload;
+((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->origImportType = 0;
 if(!Load(module))
 {
 __ecereNameSpace__ecere__com__eInstance_Delete((struct __ecereNameSpace__ecere__com__Instance *)module);
 module = (((void *)0));
 }
 }
-__ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + 12)))->application + 296)))->allModules, module);
+__ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + 12)))->application + 300)))->allModules, module);
 }
 if(ensureCOM && !strcmp(name, "ecere") && module)
 {
@@ -4155,7 +4244,7 @@ if((!Load && !strcmp(((struct __ecereNameSpace__ecere__com__Module *)(((char *)m
 {
 struct __ecereNameSpace__ecere__com__Instance * module;
 
-for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + 12)))->application + 296)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
+for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + 12)))->application + 300)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
 {
 if(!strcmp(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->name, name))
 break;
@@ -4174,7 +4263,7 @@ if(!Load(module))
 __ecereNameSpace__ecere__com__eInstance_Delete((struct __ecereNameSpace__ecere__com__Instance *)module);
 module = (((void *)0));
 }
-__ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + 12)))->application + 296)))->allModules, module);
+__ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + 12)))->application + 300)))->allModules, module);
 }
 if(module)
 {
@@ -4212,7 +4301,7 @@ struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__com__eM
 void * __ecereTemp1;
 struct __ecereNameSpace__ecere__com__Instance * module;
 
-for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + 12)))->application + 296)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
+for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + 12)))->application + 300)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->next)
 {
 if(!strcmp(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->name, name))
 break;
@@ -4224,6 +4313,7 @@ if(Load)
 module = (struct __ecereNameSpace__ecere__com__Instance *)__ecereNameSpace__ecere__com__eInstance_New(__ecereNameSpace__ecere__com__eSystem_FindClass(fromModule, "Module"));
 ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + 12)))->application;
 ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->name = __ecereNameSpace__ecere__sys__CopyString(name);
+((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->origImportType = 1;
 ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->Unload = (void *)Unload;
 if(!Load(module))
 {
@@ -4231,7 +4321,7 @@ __ecereNameSpace__ecere__com__eInstance_Delete((struct __ecereNameSpace__ecere__
 module = (((void *)0));
 }
 }
-__ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + 12)))->application + 296)))->allModules, module);
+__ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + 12)))->application + 300)))->allModules, module);
 }
 if(module)
 {
@@ -4319,10 +4409,10 @@ __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Delete(&parentNameSpace->
 
 static void __ecereNameSpace__ecere__com__Application_Destructor(struct __ecereNameSpace__ecere__com__Instance * app)
 {
-if(((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->parsedCommand)
+if(((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->parsedCommand)
 {
-(__ecereNameSpace__ecere__com__eSystem_Delete(((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->argv), ((struct __ecereNameSpace__ecere__com__Application * )(((char * )app + 296)))->argv = 0);
-(__ecereNameSpace__ecere__com__eSystem_Delete(((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->parsedCommand), ((struct __ecereNameSpace__ecere__com__Application * )(((char * )app + 296)))->parsedCommand = 0);
+(__ecereNameSpace__ecere__com__eSystem_Delete(((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->argv), ((struct __ecereNameSpace__ecere__com__Application * )(((char * )app + 300)))->argv = 0);
+(__ecereNameSpace__ecere__com__eSystem_Delete(((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->parsedCommand), ((struct __ecereNameSpace__ecere__com__Application * )(((char * )app + 300)))->parsedCommand = 0);
 }
 }
 
@@ -4347,7 +4437,7 @@ struct __ecereNameSpace__ecere__com__GlobalFunction * function;
 struct __ecereNameSpace__ecere__com__Instance * m;
 struct __ecereNameSpace__ecere__com__SubModule * handle;
 
-for(m = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 296)))->allModules.first; m; m = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)m + 12)))->next)
+for(m = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 300)))->allModules.first; m; m = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)m + 12)))->next)
 {
 struct __ecereNameSpace__ecere__com__SubModule * next;
 
@@ -4360,7 +4450,7 @@ __ecereMethod___ecereNameSpace__ecere__sys__OldList_Delete(&((struct __ecereName
 }
 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->Unload)
 {
-if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->importType == 1)
+if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->origImportType == 1)
 {
 unsigned int (* Unload)(struct __ecereNameSpace__ecere__com__Instance * module) = (void *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->Unload;
 
@@ -4463,9 +4553,9 @@ __ecereMethod___ecereNameSpace__ecere__sys__OldList_Delete(&((struct __ecereName
 __ecereNameSpace__ecere__com__NameSpace_Free(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->privateNameSpace);
 __ecereNameSpace__ecere__com__NameSpace_Free(&((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace);
 if(module != ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application)
-__ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 296)))->allModules, module);
+__ecereMethod___ecereNameSpace__ecere__sys__OldList_Remove(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 300)))->allModules, module);
 else
-__ecereNameSpace__ecere__com__NameSpace_Free(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 296)))->systemNameSpace);
+__ecereNameSpace__ecere__com__NameSpace_Free(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 300)))->systemNameSpace);
 Instance_Module_Free(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->library);
 }
 
@@ -4504,7 +4594,7 @@ int start = 0, c;
 
 nameSpace = (declMode == 1) ? &((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace : &((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->privateNameSpace;
 if(declMode == 4)
-nameSpace = &((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 296)))->systemNameSpace;
+nameSpace = &((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 300)))->systemNameSpace;
 if(declMode != 3)
 {
 for(c = 0; name[c]; c++)
@@ -4558,7 +4648,7 @@ int start = 0, c;
 
 nameSpace = (declMode == 1) ? &((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->publicNameSpace : &((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->privateNameSpace;
 if(declMode == 4)
-nameSpace = &((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 296)))->systemNameSpace;
+nameSpace = &((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 300)))->systemNameSpace;
 if(declMode != 3)
 {
 for(c = 0; name[c]; c++)
@@ -4610,7 +4700,7 @@ if(name && module)
 {
 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
 
-link = __ecereNameSpace__ecere__com__SearchNameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 296)))->systemNameSpace, name, &(*((struct __ecereNameSpace__ecere__com__NameSpace *)0)).defines);
+link = __ecereNameSpace__ecere__com__SearchNameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 300)))->systemNameSpace, name, &(*((struct __ecereNameSpace__ecere__com__NameSpace *)0)).defines);
 if(link)
 return link->data;
 link = __ecereNameSpace__ecere__com__SearchModule(module, name, &(*((struct __ecereNameSpace__ecere__com__NameSpace *)0)).defines, 0x1);
@@ -4626,7 +4716,7 @@ if(name && module)
 {
 struct __ecereNameSpace__ecere__com__BTNamedLink * link;
 
-link = __ecereNameSpace__ecere__com__SearchNameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 296)))->systemNameSpace, name, &(*((struct __ecereNameSpace__ecere__com__NameSpace *)0)).functions);
+link = __ecereNameSpace__ecere__com__SearchNameSpace(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 300)))->systemNameSpace, name, &(*((struct __ecereNameSpace__ecere__com__NameSpace *)0)).functions);
 if(link)
 return link->data;
 link = __ecereNameSpace__ecere__com__SearchModule(module, name, &(*((struct __ecereNameSpace__ecere__com__NameSpace *)0)).functions, 0x1);
@@ -4922,6 +5012,8 @@ extern int isprint(int c);
 
 static void __ecereNameSpace__ecere__com__LoadCOM(struct __ecereNameSpace__ecere__com__Instance * module)
 {
+unsigned int force64Bits = ((unsigned int)((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + 12)))->application + 300)))->isGUIApp & 2) ? 0x1 : 0x0;
+int pointerSize = force64Bits ? 8 : sizeof(void *);
 struct __ecereNameSpace__ecere__com__Class * applicationClass;
 struct __ecereNameSpace__ecere__com__Class * enumClass, * structClass, * boolClass;
 struct __ecereNameSpace__ecere__com__Class * moduleClass;
@@ -4941,12 +5033,12 @@ instanceClass->memberOffset = 0;
 instanceClass->offset = 0;
 instanceClass->memberID = -3;
 instanceClass->startMemberID = -3;
-__ecereNameSpace__ecere__com__eClass_AddDataMember(instanceClass, "_vTbl", "int (**)()", sizeof(int (**)()), 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(instanceClass, "_class", "ecere::com::Class", sizeof(struct __ecereNameSpace__ecere__com__Class *), 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(instanceClass, "_refCount", "int", sizeof(int (**)()), 4, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(instanceClass, "_vTbl", "int (**)()", pointerSize, pointerSize, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(instanceClass, "_class", "ecere::com::Class", pointerSize, pointerSize, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(instanceClass, "_refCount", "int", sizeof(int), sizeof(int), 1);
 }
 __ecereNameSpace__ecere__com__InitializeDataTypes1(module);
-enumClass = __ecereNameSpace__ecere__com__eSystem_RegisterClass(0, "enum", (((void *)0)), 0, sizeof(struct __ecereNameSpace__ecere__com__EnumClassData), (((void *)0)), (((void *)0)), module, 4, 1);
+enumClass = __ecereNameSpace__ecere__com__eSystem_RegisterClass(0, "enum", (((void *)0)), 0, force64Bits ? 32 : sizeof(struct __ecereNameSpace__ecere__com__EnumClassData), (((void *)0)), (((void *)0)), module, 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddClassProperty(enumClass, "enumSize", "int", (((void *)0)), __ecereNameSpace__ecere__com__GetEnumSize)->constant = 0x1;
 enumClass->type = 1000;
 (__ecereNameSpace__ecere__com__eSystem_Delete(enumClass->dataTypeString), enumClass->dataTypeString = 0);
@@ -4961,35 +5053,36 @@ __ecereNameSpace__ecere__com__InitializeDataTypes(module);
 boolClass = __ecereNameSpace__ecere__com__eSystem_RegisterClass(4, "bool", "uint", 0, 0, (((void *)0)), (((void *)0)), module, 4, 1);
 __ecereNameSpace__ecere__com__eEnum_AddFixedValue(boolClass, "true", (unsigned int)0x1);
 __ecereNameSpace__ecere__com__eEnum_AddFixedValue(boolClass, "false", (unsigned int)0x0);
-moduleClass = __ecereNameSpace__ecere__com__eSystem_RegisterClass(0, "ecere::com::Module", (((void *)0)), sizeof(struct __ecereNameSpace__ecere__com__Module), 0, (void *)__ecereNameSpace__ecere__com__Module_Constructor, (void *)__ecereNameSpace__ecere__com__Module_Destructor, module, 4, 1);
+moduleClass = __ecereNameSpace__ecere__com__eSystem_RegisterClass(0, "ecere::com::Module", (((void *)0)), force64Bits ? 8 + 8 + 32 + 32 + 32 + 32 + 8 + 8 + 8 + 8 + 8 + 8 + (32 + 8 + 8 + 4 * 32) + (32 + 8 + 8 + 4 * 32) : sizeof(struct __ecereNameSpace__ecere__com__Module), 0, (void *)__ecereNameSpace__ecere__com__Module_Constructor, (void *)__ecereNameSpace__ecere__com__Module_Destructor, module, 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddVirtualMethod(moduleClass, "OnLoad", "bool()", (((void *)0)), 1);
 __ecereNameSpace__ecere__com__eClass_AddVirtualMethod(moduleClass, "OnUnload", "void()", (((void *)0)), 1);
 __ecereNameSpace__ecere__com__eClass_AddMethod(moduleClass, "Load", "Module(char * name, AccessMode importAccess)", __ecereNameSpace__ecere__com__eModule_Load, 1);
 __ecereNameSpace__ecere__com__eClass_AddMethod(moduleClass, "Unload", "void(Module module)", __ecereNameSpace__ecere__com__eModule_Unload, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "application", "Application", sizeof(struct __ecereNameSpace__ecere__com__Instance *), 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "classes", "OldList", sizeof(struct __ecereNameSpace__ecere__sys__OldList), 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "defines", "OldList", sizeof(struct __ecereNameSpace__ecere__sys__OldList), 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "functions", "OldList", sizeof(struct __ecereNameSpace__ecere__sys__OldList), 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "modules", "OldList", sizeof(struct __ecereNameSpace__ecere__sys__OldList), 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "prev", "Module", sizeof(struct __ecereNameSpace__ecere__com__Instance *), 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "next", "Module", sizeof(struct __ecereNameSpace__ecere__com__Instance *), 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "name", "char *", sizeof(char *), 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "library", "void *", sizeof(void *), 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "Unload", "void *", sizeof(void *), 4, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "application", "Application", pointerSize, pointerSize, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "classes", "OldList", force64Bits ? 32 : sizeof(struct __ecereNameSpace__ecere__sys__OldList), pointerSize, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "defines", "OldList", force64Bits ? 32 : sizeof(struct __ecereNameSpace__ecere__sys__OldList), pointerSize, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "functions", "OldList", force64Bits ? 32 : sizeof(struct __ecereNameSpace__ecere__sys__OldList), pointerSize, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "modules", "OldList", force64Bits ? 32 : sizeof(struct __ecereNameSpace__ecere__sys__OldList), pointerSize, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "prev", "Module", pointerSize, pointerSize, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "next", "Module", pointerSize, pointerSize, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "name", "char *", pointerSize, pointerSize, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "library", "void *", pointerSize, pointerSize, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "Unload", "void *", pointerSize, pointerSize, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "importType", "ImportType", sizeof(int), 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "privateNameSpace", "NameSpace", sizeof(struct __ecereNameSpace__ecere__com__NameSpace), 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "publicNameSpace", "NameSpace", sizeof(struct __ecereNameSpace__ecere__com__NameSpace), 4, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "origImportType", "ImportType", sizeof(int), 4, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "privateNameSpace", "NameSpace", force64Bits ? (32 + 8 + 8 + 4 * 32) : sizeof(struct __ecereNameSpace__ecere__com__NameSpace), pointerSize, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(moduleClass, "publicNameSpace", "NameSpace", force64Bits ? (32 + 8 + 8 + 4 * 32) : sizeof(struct __ecereNameSpace__ecere__com__NameSpace), pointerSize, 1);
 moduleClass->fixed = 0x1;
 moduleClass->count++;
-applicationClass = __ecereNameSpace__ecere__com__eSystem_RegisterClass(0, "ecere::com::Application", "Module", sizeof(struct __ecereNameSpace__ecere__com__Application), 0, (((void *)0)), (void *)__ecereNameSpace__ecere__com__Application_Destructor, module, 4, 1);
+applicationClass = __ecereNameSpace__ecere__com__eSystem_RegisterClass(0, "ecere::com::Application", "Module", force64Bits ? (8 + 8 + 8 + 8 + 32 + 8 + 176) : sizeof(struct __ecereNameSpace__ecere__com__Application), 0, (((void *)0)), (void *)__ecereNameSpace__ecere__com__Application_Destructor, module, 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddVirtualMethod(applicationClass, "Main", "void()", (((void *)0)), 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(applicationClass, "argc", "int", sizeof(int), 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(applicationClass, "argv", "char **", sizeof(char **), 4, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(applicationClass, "argv", "char **", pointerSize, pointerSize, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(applicationClass, "exitCode", "int", sizeof(int), 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(applicationClass, "isGUIApp", "bool", sizeof(unsigned int), 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(applicationClass, "allModules", "OldList", sizeof(struct __ecereNameSpace__ecere__sys__OldList), 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(applicationClass, "parsedCommand", "char *", sizeof(char *), 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(applicationClass, "systemNameSpace", "NameSpace", sizeof(struct __ecereNameSpace__ecere__com__NameSpace), 4, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(applicationClass, "allModules", "OldList", force64Bits ? 32 : sizeof(struct __ecereNameSpace__ecere__sys__OldList), pointerSize, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(applicationClass, "parsedCommand", "char *", pointerSize, pointerSize, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(applicationClass, "systemNameSpace", "NameSpace", force64Bits ? (32 + 8 + 8 + 4 * 32) : sizeof(struct __ecereNameSpace__ecere__com__NameSpace), pointerSize, 1);
 applicationClass->fixed = 0x1;
 applicationClass->count++;
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("sin", "double sin(Angle number)", sin, module, 4);
@@ -5042,8 +5135,10 @@ __ecereNameSpace__ecere__com__eSystem_RegisterFunction("strncpy", "char * strncp
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("memcpy", "void * memcpy(void *, const void *, uint size)", memcpy, module, 4);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("memmove", "void * memmove(void *, const void *, uint size)", memmove, module, 4);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("sprintf", "int sprintf(char *, char *, ...)", sprintf, module, 4);
+__ecereNameSpace__ecere__com__eSystem_RegisterFunction("snprintf", "int sprintf(char *, int, char *, ...)", snprintf, module, 4);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("printf", "int printf(char *, ...)", printf, module, 4);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("vsprintf", "int vsprintf(char*, const char*, __builtin_va_list)", vsprintf, module, 4);
+__ecereNameSpace__ecere__com__eSystem_RegisterFunction("vsnprintf", "int vsnprintf(char*, int, const char*, __builtin_va_list)", vsnprintf, module, 4);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("puts", "int puts(char *)", puts, module, 4);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("fputs", "int fputs(char *, void * stream)", fputs, module, 4);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("isalnum", "int isalnum(int c)", isalnum, module, 4);
@@ -5059,16 +5154,16 @@ struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__com____
 {
 struct __ecereNameSpace__ecere__com__Instance * app;
 
-app = __ecereNameSpace__ecere__com___calloc(1, 424);
+app = __ecereNameSpace__ecere__com___calloc(1, 428);
 __ecereNameSpace__ecere__com__Module_Constructor(app);
-((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->systemNameSpace.classes.CompareKey = (void *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_CompareString;
-((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->systemNameSpace.defines.CompareKey = (void *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_CompareString;
-((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->systemNameSpace.functions.CompareKey = (void *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_CompareString;
-((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->systemNameSpace.nameSpaces.CompareKey = (void *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_CompareString;
-Instance_COM_Initialize(argc, argv, &((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->parsedCommand, &((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->argc, &((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->argv);
+((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->systemNameSpace.classes.CompareKey = (void *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_CompareString;
+((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->systemNameSpace.defines.CompareKey = (void *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_CompareString;
+((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->systemNameSpace.functions.CompareKey = (void *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_CompareString;
+((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->systemNameSpace.nameSpaces.CompareKey = (void *)__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_CompareString;
+Instance_COM_Initialize(argc, argv, &((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->parsedCommand, &((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->argc, &((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->argv);
 ((struct __ecereNameSpace__ecere__com__Module *)(((char *)app + 12)))->application = app;
-((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->allModules.offset = 12 + (unsigned int)&(*((struct __ecereNameSpace__ecere__com__Module *)0)).prev;
-((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 296)))->isGUIApp = guiApp;
+((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->allModules.offset = 12 + (unsigned int)&(*((struct __ecereNameSpace__ecere__com__Module *)0)).prev;
+((struct __ecereNameSpace__ecere__com__Application *)(((char *)app + 300)))->isGUIApp = guiApp;
 __ecereNameSpace__ecere__com__LoadCOM(app);
 ((struct __ecereNameSpace__ecere__com__Instance *)(char *)app)->_class = __ecereNameSpace__ecere__com__eSystem_FindClass(app, "Application");
 return app;
@@ -5087,7 +5182,7 @@ for(param = _class->templateParams.first; param; param = param->next)
 if(!strcmp(param->name, name))
 return param;
 }
-param = (__ecereTemp1 = __ecereNameSpace__ecere__com__eSystem_New0(36), ((struct __ecereNameSpace__ecere__com__ClassTemplateParameter *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(name), ((struct __ecereNameSpace__ecere__com__ClassTemplateParameter *)__ecereTemp1)->type = type, ((struct __ecereNameSpace__ecere__com__ClassTemplateParameter *)__ecereTemp1)->dataTypeString = (type == 1) ? info : __ecereNameSpace__ecere__sys__CopyString(info), ((struct __ecereNameSpace__ecere__com__ClassTemplateParameter *)__ecereTemp1));
+param = (__ecereTemp1 = __ecereNameSpace__ecere__com__eSystem_New0(40), ((struct __ecereNameSpace__ecere__com__ClassTemplateParameter *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(name), ((struct __ecereNameSpace__ecere__com__ClassTemplateParameter *)__ecereTemp1)->type = type, ((struct __ecereNameSpace__ecere__com__ClassTemplateParameter *)__ecereTemp1)->dataTypeString = (type == 1) ? info : __ecereNameSpace__ecere__sys__CopyString(info), ((struct __ecereNameSpace__ecere__com__ClassTemplateParameter *)__ecereTemp1));
 if(defaultArg != (((void *)0)))
 {
 param->defaultArg = *defaultArg;
@@ -5277,7 +5372,7 @@ struct __ecereNameSpace__ecere__com__ObjectInfo * oClass;
 struct __ecereNameSpace__ecere__sys__OldList instances;
 struct __ecereNameSpace__ecere__com__Instance * classDefinition;
 unsigned int modified;
-};
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__ObjectInfo;
 
@@ -5292,7 +5387,7 @@ struct __ecereNameSpace__ecere__com__DesignerBase
 struct __ecereNameSpace__ecere__com__Instance * classDesigner;
 char * objectClass;
 unsigned int isDragging;
-};
+} __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__DesignerBase;
 
@@ -5860,6 +5955,8 @@ __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "selfWatchable", "bool
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "isWatchable", "bool", 4, 4, 1);
 if(class)
 class->fixed = (unsigned int)1;
+if(class)
+class->noExpansion = (unsigned int)1;
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::com::MemoryGuard_PushLoc", "void ecere::com::MemoryGuard_PushLoc(char * loc)", __ecereNameSpace__ecere__com__MemoryGuard_PushLoc, module, 4);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::com::MemoryGuard_PopLoc", "void ecere::com::MemoryGuard_PopLoc(void)", __ecereNameSpace__ecere__com__MemoryGuard_PopLoc, module, 4);
 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "ecere::com::BTNamedLink", 0, sizeof(struct __ecereNameSpace__ecere__com__BTNamedLink), 0, 0, 0, module, 4, 1);
@@ -6147,8 +6244,8 @@ __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "parent", "ecere::com:
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "left", "ecere::com::ClassProperty", 4, 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "right", "ecere::com::ClassProperty", 4, 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "depth", "int", 4, 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(class, "Set", "void( *)(ecere::com::Class, int)", 4, 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(class, "Get", "int( *)(ecere::com::Class)", 4, 4, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(class, "Set", "void( *)(ecere::com::Class, int64)", 4, 4, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(class, "Get", "int64( *)(ecere::com::Class)", 4, 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "dataTypeString", "char *", 4, 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "dataType", "Type", 4, 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "constant", "bool", 4, 4, 1);
@@ -6227,8 +6324,8 @@ __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::com::eClass_AddVi
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::com::eClass_AddProperty", "ecere::com::Property ecere::com::eClass_AddProperty(ecere::com::Class _class, char * name, char * dataType, void * setStmt, void * getStmt, ecere::com::AccessMode declMode)", __ecereNameSpace__ecere__com__eClass_AddProperty, module, 4);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::com::eClass_AddClassProperty", "ecere::com::ClassProperty ecere::com::eClass_AddClassProperty(ecere::com::Class _class, char * name, char * dataType, void * setStmt, void * getStmt)", __ecereNameSpace__ecere__com__eClass_AddClassProperty, module, 4);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::com::eClass_FindClassProperty", "ecere::com::ClassProperty ecere::com::eClass_FindClassProperty(ecere::com::Class _class, char * name)", __ecereNameSpace__ecere__com__eClass_FindClassProperty, module, 4);
-__ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::com::eClass_GetProperty", "int ecere::com::eClass_GetProperty(ecere::com::Class _class, char * name)", __ecereNameSpace__ecere__com__eClass_GetProperty, module, 4);
-__ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::com::eClass_SetProperty", "void ecere::com::eClass_SetProperty(ecere::com::Class _class, char * name, int value)", __ecereNameSpace__ecere__com__eClass_SetProperty, module, 4);
+__ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::com::eClass_GetProperty", "int64 ecere::com::eClass_GetProperty(ecere::com::Class _class, char * name)", __ecereNameSpace__ecere__com__eClass_GetProperty, module, 4);
+__ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::com::eClass_SetProperty", "void ecere::com::eClass_SetProperty(ecere::com::Class _class, char * name, int64 value)", __ecereNameSpace__ecere__com__eClass_SetProperty, module, 4);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::com::eClass_FindMethod", "ecere::com::Method ecere::com::eClass_FindMethod(ecere::com::Class _class, char * name, ecere::com::Module module)", __ecereNameSpace__ecere__com__eClass_FindMethod, module, 4);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::com::eInstance_New", "void * ecere::com::eInstance_New(ecere::com::Class _class)", __ecereNameSpace__ecere__com__eInstance_New, module, 4);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("ecere::com::eInstance_Evolve", "void ecere::com::eInstance_Evolve(ecere::com::Instance * instancePtr, ecere::com::Class _class)", __ecereNameSpace__ecere__com__eInstance_Evolve, module, 4);