ecere/com: Adjustment to 32 bit cross-compiling fix
authorJerome St-Louis <jerome@ecere.com>
Sun, 17 Mar 2013 07:59:24 +0000 (03:59 -0400)
committerJerome St-Louis <jerome@ecere.com>
Sun, 17 Mar 2013 07:59:24 +0000 (03:59 -0400)
- The problem was still occuring on Windows; the __thisModule check was not appropriate

compiler/bootstrap/ecere/bootstrap/instance.c
ecere/src/com/instance.ec

index fb71295..fae4f38 100644 (file)
@@ -3508,14 +3508,14 @@ if(_class)
 {
 {
 int size = _class->structSize;
+int flags = (unsigned int)((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)_class->module + 12)))->application + 300)))->isGUIApp;
+unsigned int inCompiler = (flags & 8) ? 0x1 : 0x0;
 
-if(_class->module != __thisModule)
+if(inCompiler)
 {
-int flags = (unsigned int)((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)_class->module + structSize_Instance)))->application + structSize_Module)))->isGUIApp;
 unsigned int force32Bits = (flags & 4) ? 0x1 : 0x0;
-unsigned int inCompiler = (flags & 8) ? 0x1 : 0x0;
 
-if(force32Bits && inCompiler)
+if(force32Bits)
 {
 if(!strcmp(_class->name, "Module"))
 size = 560;
index 99cf19e..5fb27e6 100644 (file)
@@ -4349,12 +4349,12 @@ public dllexport void * eInstance_New(Class _class)
 #endif
       {
          int size = _class.structSize;
-         if(_class.module != __thisModule)
+         int flags = _class.module.application.isGUIApp;
+         bool inCompiler = (flags & 8) ? true : false;
+         if(inCompiler)
          {
-            int flags = _class.module.application.isGUIApp;
             bool force32Bits = (flags & 4) ? true : false;
-            bool inCompiler = (flags & 8) ? true : false;
-            if(force32Bits && inCompiler)
+            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"))