{
}
+static int __ecereNameSpace__ecere__com__insideCrossBuild32;
+
static void __ecereNameSpace__ecere__com__ComputeClassParameters(struct __ecereNameSpace__ecere__com__Class * templatedClass, char * templateParams, struct __ecereNameSpace__ecere__com__Instance * findModule);
extern char * strchr(const char * , int);
_class->offset = (base && base->structSize && base->type != 1000) ? base->structSize : ((type == 5) ? 0 : (force64Bits ? 24 : (force32Bits && inCompiler) ? 12 : structSize_Instance));
if(crossBits)
{
-if(strstr(name, "ecere::sys::EARHeader") || strstr(name, "AnchorValue") || !strcmp(name, "ecere::com::CustomAVLTree") || !strcmp(name, "ecere::sys::Mutex"))
+if(strstr(name, "ecere::sys::EARHeader") || strstr(name, "AnchorValue") || !strcmp(name, "ecere::com::CustomAVLTree") || !strcmp(name, "ecere::gui::Window") || !strcmp(name, "ecere::sys::Mutex"))
;
else
{
{
{
int size = _class->structSize;
-struct __ecereNameSpace__ecere__com__Instance * module = _class->module;
-struct __ecereNameSpace__ecere__com__Instance * application = module ? ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application : (((void *)0));
-int flags = application ? (unsigned int)((struct __ecereNameSpace__ecere__com__Application *)(((char *)application + structSize_Module)))->isGUIApp : 0;
-unsigned int inCompiler = (flags & 8) ? 0x1 : 0x0;
-
-if(inCompiler)
-{
-unsigned int force32Bits = (flags & 4) ? 0x1 : 0x0;
-if(force32Bits)
+if(__ecereNameSpace__ecere__com__insideCrossBuild32)
{
if(!strcmp(_class->name, "Module"))
size = 560;
else if(_class->templateClass && !strcmp(_class->templateClass->name, "Map"))
size = 40;
-}
+else
+size *= 3;
}
instance = __ecereNameSpace__ecere__com___calloc(1, size);
}
unsigned int (stdcall * Load)(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;
+int flags = (unsigned int)((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + structSize_Instance)))->application + structSize_Module)))->isGUIApp;
+unsigned int inCompiler = (flags & 8) ? 0x1 : 0x0;
+unsigned int force32Bits = (flags & 4) ? 0x1 : 0x0;
+unsigned int setInsideCrossBuild32 = force32Bits && inCompiler;
for(module = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + structSize_Instance)))->application + structSize_Module)))->allModules.first; module; module = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->next)
{
}
if(Load)
{
+if(setInsideCrossBuild32)
+__ecereNameSpace__ecere__com__insideCrossBuild32++;
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 + structSize_Instance)))->application = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + structSize_Instance)))->application;
((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->library = library;
__ecereNameSpace__ecere__com__eInstance_Delete((struct __ecereNameSpace__ecere__com__Instance *)module);
module = (((void *)0));
}
+if(setInsideCrossBuild32)
+__ecereNameSpace__ecere__com__insideCrossBuild32--;
}
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + structSize_Instance)))->application + structSize_Module)))->allModules, module);
}
{
Load = __ecereDll_Load_ecere;
Unload = __ecereDll_Unload_ecere;
+if(setInsideCrossBuild32)
+__ecereNameSpace__ecere__com__insideCrossBuild32++;
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 + structSize_Instance)))->application = ((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + structSize_Instance)))->application;
((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->library = (((void *)0));
__ecereNameSpace__ecere__com__eInstance_Delete((struct __ecereNameSpace__ecere__com__Instance *)module);
module = (((void *)0));
}
+if(setInsideCrossBuild32)
+__ecereNameSpace__ecere__com__insideCrossBuild32--;
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)fromModule + structSize_Instance)))->application + structSize_Module)))->allModules, module);
}
if(module)
{
if(instance && _property && _property->isWatchable)
{
+if(!__ecereNameSpace__ecere__com__insideCrossBuild32)
+{
struct __ecereNameSpace__ecere__sys__OldList * watchers = (struct __ecereNameSpace__ecere__sys__OldList *)((unsigned char *)instance + _property->watcherOffset);
struct __ecereNameSpace__ecere__com__Watcher * watcher, * next;
}
}
}
+}
void __ecereNameSpace__ecere__com__eProperty_Watchable(struct __ecereNameSpace__ecere__com__Property * _property)
{
extern void SetTargetBits(int bits);
+extern void SetInSymbolGen(unsigned int b);
+
extern struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__com____ecere_COM_Initialize(unsigned int guiApp, int argc, char * argv[]);
extern void SetPrivateModule(struct __ecereNameSpace__ecere__com__Instance * module);
SetCurrentContext(theGlobalContext);
SetTargetPlatform(targetPlatform);
SetTargetBits(targetBits);
+SetInSymbolGen(0x1);
privateModule = (struct __ecereNameSpace__ecere__com__Instance *)__ecereNameSpace__ecere__com____ecere_COM_Initialize(0x1 | (targetBits == sizeof(uintptr_t) * 8 ? (unsigned int)0 : targetBits == 64 ? (unsigned int)2 : targetBits == 32 ? (unsigned int)4 : (unsigned int)0) | (unsigned int)8, 1, (((void *)0)));
SetPrivateModule(privateModule);
mainModule = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ModuleImport);
inPreCompiler = b;
}
+unsigned int inSymbolGen = 0x0;
+
+void SetInSymbolGen(unsigned int b)
+{
+inSymbolGen = b;
+}
+
struct __ecereNameSpace__ecere__sys__OldList * precompDefines;
void SetPrecompDefines(struct __ecereNameSpace__ecere__sys__OldList * list)
strcpy(file, name);
__ecereNameSpace__ecere__sys__StripExtension(file);
-if(!inCompiler)
+if(!inCompiler && !inPreCompiler && !inSymbolGen)
{
struct __ecereNameSpace__ecere__com__MapIterator it = (it.container = (void *)0, it.pointer = (void *)0, __ecereProp___ecereNameSpace__ecere__com__MapIterator_Set_map(&it, loadedModules), it);
__ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetEcereImported", "void SetEcereImported(bool b)", SetEcereImported, module, 1);
__ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetEcereImported", "bool GetEcereImported(void)", GetEcereImported, module, 1);
__ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetInPreCompiler", "void SetInPreCompiler(bool b)", SetInPreCompiler, module, 1);
+__ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetInSymbolGen", "void SetInSymbolGen(bool b)", SetInSymbolGen, module, 1);
__ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetPrecompDefines", "void SetPrecompDefines(ecere::sys::OldList * list)", SetPrecompDefines, module, 1);
__ecereNameSpace__ecere__com__eSystem_RegisterFunction("DummyMethod", "bool DummyMethod(void)", DummyMethod, module, 1);
__ecereNameSpace__ecere__com__eSystem_RegisterFunction("LoadSymbols", "bool LoadSymbols(char * fileName, ecere::com::ImportType importType, bool loadDllOnly)", LoadSymbols, module, 1);
SetCurrentContext(theGlobalContext);
SetTargetPlatform(targetPlatform);
SetTargetBits(targetBits);
+ SetInSymbolGen(true);
privateModule = (Module)__ecere_COM_Initialize(true | (targetBits == sizeof(uintptr)*8 ? 0 : targetBits == 64 ? 2 : targetBits==32 ? 4 : 0) | 8, 1, null);
SetPrivateModule(privateModule);
msgid "Couldn't find member %s to override\n"
msgstr "Couldn't find member %s to override\n"
-#: ./src/loadSymbols.ec:716
+#: ./src/loadSymbols.ec:718
msgid "Couldn't open %s\n"
msgstr "Couldn't open %s\n"
msgid "Recursion in defined expression %s\n"
msgstr "Recursion in defined expression %s\n"
-#: ./src/loadSymbols.ec:1000
+#: ./src/loadSymbols.ec:1002
msgid "Redefinition of %s (defining as %s, already defined as %s)\n"
msgstr "Redefinition of %s (defining as %s, already defined as %s)\n"
public void SetEcereImported(bool b) { ecereImported = b; } public bool GetEcereImported() { return ecereImported; }
bool inPreCompiler = false;
public void SetInPreCompiler(bool b) {inPreCompiler = b; }
+bool inSymbolGen = false;
+public void SetInSymbolGen(bool b) {inSymbolGen = b; }
OldList * precompDefines;
public void SetPrecompDefines(OldList * list) { precompDefines = list; }
// Load an extra instance of any shared module to ensure freeing up a
// module loaded in another file will not invalidate our objects.
- if(!inCompiler)
+ if(!inCompiler && !inPreCompiler && !inSymbolGen)
{
MapIterator<String, List<Module> > it { map = loadedModules };
if(!it.Index(file, false))
{
"Folder" : "x86",
"Files" : [
- "ffi.c",
- "ffitarget.h",
"win32.S"
]
},
"raw_api.c",
"types.c",
"closures.c",
- "i686-pc-mingw32/include/ffi.h"
+ "i686-pc-mingw32/include/ffi.h",
+ "src/x86/ffi.c",
+ "src/x86/ffitarget.h"
]
}
],
#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);
+ }
}
}
}