ecere/com/instance: Workaround for AVLNode cross-bitness
authorJerome St-Louis <jerome@ecere.com>
Sun, 21 Dec 2014 15:22:51 +0000 (10:22 -0500)
committerJerome St-Louis <jerome@ecere.com>
Sun, 15 Feb 2015 20:33:16 +0000 (15:33 -0500)
- Issues with private members were displacing key to wrong offset

ecere/src/com/instance.ec

index 3ce29c6..000ce63 100644 (file)
@@ -5172,6 +5172,21 @@ public dllexport DataMember eClass_AddDataMember(Class _class, const char * name
          if(alignment)
          {
             bool pointerAlignment = alignment == 0xF000F000;
+            bool force64Bits = (_class.module.application.isGUIApp & 2) ? true : false;
+            bool force32Bits = (_class.module.application.isGUIApp & 4) ? true : false;
+            if((force32Bits || force64Bits) && !strcmp(_class.name, "AVLNode") && !strcmp(name, "__ecerePrivateData0"))
+            {
+               if(force64Bits)
+               {
+                  type = "byte[32]";
+                  size = 32;
+               }
+               if(force32Bits)
+               {
+                  type = "byte[16]";
+                  size = 16;
+               }
+            }
 
             if(pointerAlignment) alignment = sizeof(void *);