char defaultOutputFile[MAX_LOCATION];
Platform targetPlatform = GetRuntimePlatform();
- int targetBits = (sizeof(uintptr) == 8) ? 64 : 32;
+ int targetBits = GetHostBits();
SetSymbolsDir("");
int argc = 0;*/
Platform targetPlatform = GetRuntimePlatform();
- int targetBits = (sizeof(uintptr) == 8) ? 64 : 32;
+ int targetBits = GetHostBits();
/*
for(c = 0; c<this.argc; c++)
{
static bool i18n;
static Platform targetPlatform;
-static int targetBits = (sizeof(uintptr) == 8) ? 64 : 32;
+static int targetBits;
static bool isConsole;
static bool isDynamicLibrary;
char * output = null;
targetPlatform = GetRuntimePlatform();
+ targetBits = GetHostBits();
/*
for(c = 0; c<this.argc; c++)
Platform targetPlatform;
+public int GetHostBits()
+{
+ // Default to runtime platform in case we fail to determine host
+ int hostBits = (sizeof(uintptr) == 8) ? 64 : 32;
+ String hostType = getenv("HOSTTYPE");
+ char host[256];
+ if(!hostType)
+ {
+ DualPipe f = DualPipeOpen({ output = true }, "uname -m");
+ if(f)
+ {
+ if(f.GetLine(host, sizeof(host)))
+ hostType = host;
+ delete f;
+ }
+ }
+ if(hostType)
+ {
+ if(!strcmp(hostType, "x86_64"))
+ hostBits = 64;
+ else if(!strcmp(hostType, "i386") || !strcmp(hostType, "i686"))
+ hostBits = 32;
+ }
+ return hostBits;
+}
+
public void SetTargetPlatform(Platform platform) { targetPlatform = platform; };
int targetBits;
}
}
+void DeclareFunctionUtil(String s)
+{
+ GlobalFunction function = eSystem_FindFunction(privateModule, s);
+ if(function)
+ {
+ char name[1024];
+ name[0] = 0;
+ if(function.module.importType != staticImport && (!function.dataType || !function.dataType.dllExport))
+ strcpy(name, "__ecereFunction_");
+ FullClassNameCat(name, s, false); // Why is this using FullClassNameCat ?
+ DeclareFunction(function, name);
+ }
+}
+
void ComputeDataTypes()
{
External external;
curExternal = temp;
+ DeclareFunctionUtil("eSystem_New");
+ DeclareFunctionUtil("eSystem_New0");
+ DeclareFunctionUtil("eSystem_Renew");
+ DeclareFunctionUtil("eSystem_Renew0");
+
DeclareStruct("ecere::com::Class", false);
DeclareStruct("ecere::com::Instance", false);
DeclareStruct("ecere::com::Property", false);