unsigned int valid = 0x1;
char defaultOutputFile[797];
int targetPlatform = __ecereNameSpace__ecere__com__GetRuntimePlatform();
-int targetBits = (sizeof(uintptr_t) == 8) ? 64 : 32;
+int targetBits = GetHostBits();
SetSymbolsDir("");
for(c = 1; c < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + 300)))->argc; c++)
char * cppOptions = (((void *)0));
int cppOptionsLen = 0;
int targetPlatform = __ecereNameSpace__ecere__com__GetRuntimePlatform();
-int targetBits = (sizeof(uintptr_t) == 8) ? 64 : 32;
+int targetBits = GetHostBits();
for(c = 1; c < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + 300)))->argc; c++)
{
static int targetPlatform;
-static int targetBits = (sizeof(uintptr_t) == 8) ? 64 : 32;
+static int targetBits;
static unsigned int isConsole;
char * output = (((void *)0));
targetPlatform = __ecereNameSpace__ecere__com__GetRuntimePlatform();
+targetBits = GetHostBits();
for(c = 1; c < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + 300)))->argc; c++)
{
char * arg = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + 300)))->argv[c];
int targetPlatform;
+extern char * getenv(const char * name);
+
+extern struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__DualPipeOpen(unsigned int mode, char * commandLine);
+
+extern int strcmp(const char * , const char * );
+
+unsigned int __ecereMethod___ecereNameSpace__ecere__sys__File_GetLine(struct __ecereNameSpace__ecere__com__Instance * this, char * s, int max);
+
+extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
+
+int GetHostBits()
+{
+int hostBits = (sizeof(uintptr_t) == 8) ? 64 : 32;
+char * hostType = getenv("HOSTTYPE");
+char host[256];
+
+if(!hostType)
+{
+struct __ecereNameSpace__ecere__com__Instance * f = __ecereNameSpace__ecere__sys__DualPipeOpen((((unsigned int)(0x1))), "uname -m");
+
+if(f)
+{
+if(__ecereMethod___ecereNameSpace__ecere__sys__File_GetLine(f, host, sizeof host))
+hostType = host;
+(__ecereNameSpace__ecere__com__eInstance_DecRef(f), f = 0);
+}
+}
+if(hostType)
+{
+if(!strcmp(hostType, "x86_64"))
+hostBits = 64;
+else if(!strcmp(hostType, "i386") || !strcmp(hostType, "i686"))
+hostBits = 32;
+}
+return hostBits;
+}
+
void SetTargetPlatform(int platform)
{
targetPlatform = platform;
__ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetNumWarnings", "int GetNumWarnings(void)", GetNumWarnings, module, 1);
__ecereNameSpace__ecere__com__eSystem_RegisterFunction("Compiler_Warning", "void Compiler_Warning(char * format, ...)", Compiler_Warning, module, 2);
__ecereNameSpace__ecere__com__eSystem_RegisterFunction("yyerror", "int yyerror(char * s)", yyerror, module, 2);
+__ecereNameSpace__ecere__com__eSystem_RegisterFunction("GetHostBits", "int GetHostBits(void)", GetHostBits, module, 1);
__ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetTargetPlatform", "void SetTargetPlatform(ecere::com::Platform platform)", SetTargetPlatform, module, 1);
__ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetTargetBits", "void SetTargetBits(int bits)", SetTargetBits, module, 1);
}
}
}
+void DeclareFunctionUtil(char * s)
+{
+struct __ecereNameSpace__ecere__com__GlobalFunction * function = __ecereNameSpace__ecere__com__eSystem_FindFunction(privateModule, s);
+
+if(function)
+{
+char name[1024];
+
+name[0] = (char)0;
+if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)function->module + 12)))->importType != 1 && (!function->dataType || !function->dataType->dllExport))
+strcpy(name, "__ecereFunction_");
+FullClassNameCat(name, s, 0x0);
+DeclareFunction(function, name);
+}
+}
+
extern struct __ecereNameSpace__ecere__com__Instance * GetPrivateModule(void);
void ComputeDataTypes()
temp->symbol = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->id = -1000, ((struct Symbol *)__ecereTemp1)->idCode = -1000, ((struct Symbol *)__ecereTemp1));
__ecereMethod___ecereNameSpace__ecere__sys__OldList_Insert((&*ast), (((void *)0)), temp);
curExternal = temp;
+DeclareFunctionUtil("eSystem_New");
+DeclareFunctionUtil("eSystem_New0");
+DeclareFunctionUtil("eSystem_Renew");
+DeclareFunctionUtil("eSystem_Renew0");
DeclareStruct("ecere::com::Class", 0x0);
DeclareStruct("ecere::com::Instance", 0x0);
DeclareStruct("ecere::com::Property", 0x0);
__ecereNameSpace__ecere__com__eSystem_RegisterFunction("ReplaceExpContents", "void ReplaceExpContents(Expression checkedExp, Expression newExp)", ReplaceExpContents, module, 1);
__ecereNameSpace__ecere__com__eSystem_RegisterFunction("ApplyAnyObjectLogic", "void ApplyAnyObjectLogic(Expression e)", ApplyAnyObjectLogic, module, 1);
__ecereNameSpace__ecere__com__eSystem_RegisterFunction("ProcessExpressionType", "void ProcessExpressionType(Expression exp)", ProcessExpressionType, module, 1);
+__ecereNameSpace__ecere__com__eSystem_RegisterFunction("DeclareFunctionUtil", "void DeclareFunctionUtil(String s)", DeclareFunctionUtil, module, 1);
__ecereNameSpace__ecere__com__eSystem_RegisterFunction("ComputeDataTypes", "void ComputeDataTypes(void)", ComputeDataTypes, module, 1);
}