compiler/libec; ecere: Support for checking platform as a compile time constant
[sdk] / compiler / bootstrap / ecc / bootstrap / ecc.c
index 16b585d..040722a 100644 (file)
@@ -1,3 +1,11 @@
+/* Code generated from eC source file: ecc.ec */
+#if defined(_WIN32)
+#define __runtimePlatform 1
+#elif defined(__APPLE__)
+#define __runtimePlatform 3
+#else
+#define __runtimePlatform 2
+#endif
 #if defined(__GNUC__)
 typedef long long int64;
 typedef unsigned long long uint64;
@@ -28,8 +36,9 @@ typedef unsigned __int64 uint64;
 #define __ENDIAN_PAD(x) 0
 #endif
 #include <stdint.h>
+#include <sys/types.h>
 
-#if defined(_W64) || (defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
+#if /*defined(_W64) || */(defined(__WORDSIZE) && __WORDSIZE == 8) || defined(__x86_64__)
 #define _64BIT 1
 #else
 #define _64BIT 0
@@ -39,6 +48,8 @@ typedef unsigned __int64 uint64;
 #define structSize_Instance               (_64BIT ? 24 : 12)
 #define structSize_Module                 (_64BIT ? 560 : 300)
 
+struct __ecereNameSpace__ecere__com__Instance;
+
 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
 
 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
@@ -47,6 +58,8 @@ extern void *  __ecereNameSpace__ecere__com__eSystem_Renew(void *  memory, unsig
 
 extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsigned int size);
 
+extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
+
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__BTNode;
 
 struct __ecereNameSpace__ecere__sys__BTNode;
@@ -76,7 +89,7 @@ extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpac
 
 struct __ecereNameSpace__ecere__com__Method
 {
-char *  name;
+const char *  name;
 struct __ecereNameSpace__ecere__com__Method * parent;
 struct __ecereNameSpace__ecere__com__Method * left;
 struct __ecereNameSpace__ecere__com__Method * right;
@@ -86,7 +99,7 @@ int vid;
 int type;
 struct __ecereNameSpace__ecere__com__Class * _class;
 void *  symbol;
-char *  dataTypeString;
+const char *  dataTypeString;
 struct Type * dataType;
 int memberAccess;
 } __attribute__ ((gcc_struct));
@@ -97,12 +110,12 @@ struct __ecereNameSpace__ecere__com__Property
 {
 struct __ecereNameSpace__ecere__com__Property * prev;
 struct __ecereNameSpace__ecere__com__Property * next;
-char *  name;
+const char *  name;
 unsigned int isProperty;
 int memberAccess;
 int id;
 struct __ecereNameSpace__ecere__com__Class * _class;
-char *  dataTypeString;
+const char *  dataTypeString;
 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
 struct Type * dataType;
 void (*  Set)(void * , int);
@@ -113,7 +126,7 @@ void *  symbol;
 int vid;
 unsigned int conversion;
 unsigned int watcherOffset;
-char *  category;
+const char *  category;
 unsigned int compiled;
 unsigned int selfWatchable;
 unsigned int isWatchable;
@@ -126,7 +139,7 @@ struct CodePosition
 int line;
 int charPos;
 int pos;
-unsigned int included;
+int included;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Location;
@@ -203,7 +216,7 @@ float f;
 double d;
 long long i64;
 uint64 ui64;
-} __attribute__ ((gcc_struct));
+} __attribute__ ((gcc_struct)) __anon1;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Expression;
@@ -269,7 +282,7 @@ char *  name;
 struct __ecereNameSpace__ecere__sys__OldList methods;
 struct __ecereNameSpace__ecere__sys__OldList properties;
 unsigned int itself;
-unsigned int isRemote;
+int isRemote;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_Symbol;
@@ -287,7 +300,7 @@ union
 struct __ecereNameSpace__ecere__com__Method * method;
 struct __ecereNameSpace__ecere__com__Property * _property;
 struct __ecereNameSpace__ecere__com__Class * registered;
-} __attribute__ ((gcc_struct));
+} __attribute__ ((gcc_struct)) __anon1;
 int id;
 int idCode;
 union
@@ -296,20 +309,20 @@ struct
 {
 struct External * pointerExternal;
 struct External * structExternal;
-} __attribute__ ((gcc_struct));
+} __attribute__ ((gcc_struct)) __anon1;
 struct
 {
 struct External * externalGet;
 struct External * externalSet;
 struct External * externalPtr;
 struct External * externalIsSet;
-} __attribute__ ((gcc_struct));
+} __attribute__ ((gcc_struct)) __anon2;
 struct
 {
 struct External * methodExternal;
 struct External * methodCodeExternal;
-} __attribute__ ((gcc_struct));
-} __attribute__ ((gcc_struct));
+} __attribute__ ((gcc_struct)) __anon3;
+} __attribute__ ((gcc_struct)) __anon2;
 unsigned int imported;
 unsigned int declaredStructSym;
 struct __ecereNameSpace__ecere__com__Class * _class;
@@ -348,7 +361,7 @@ struct __ecereNameSpace__ecere__com__Class
 {
 struct __ecereNameSpace__ecere__com__Class * prev;
 struct __ecereNameSpace__ecere__com__Class * next;
-char *  name;
+const char *  name;
 int offset;
 int structSize;
 int (* *  _vTbl)();
@@ -369,19 +382,19 @@ int startMemberID;
 int type;
 struct __ecereNameSpace__ecere__com__Instance * module;
 struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace;
-char *  dataTypeString;
+const char *  dataTypeString;
 struct Type * dataType;
 int typeSize;
 int defaultAlignment;
 void (*  Initialize)();
 int memberOffset;
 struct __ecereNameSpace__ecere__sys__OldList selfWatchers;
-char *  designerClass;
+const char *  designerClass;
 unsigned int noExpansion;
-char *  defaultProperty;
+const char *  defaultProperty;
 unsigned int comRedefinition;
 int count;
-unsigned int isRemote;
+int isRemote;
 unsigned int internalDecl;
 void *  data;
 unsigned int computeSize;
@@ -390,7 +403,7 @@ int destructionWatchOffset;
 unsigned int fixed;
 struct __ecereNameSpace__ecere__sys__OldList delayedCPValues;
 int inheritanceAccess;
-char *  fullName;
+const char *  fullName;
 void *  symbol;
 struct __ecereNameSpace__ecere__sys__OldList conversions;
 struct __ecereNameSpace__ecere__sys__OldList templateParams;
@@ -398,9 +411,25 @@ struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
 struct __ecereNameSpace__ecere__com__Class * templateClass;
 struct __ecereNameSpace__ecere__sys__OldList templatized;
 int numParams;
+unsigned int isInstanceClass;
+unsigned int byValueSystemClass;
 } __attribute__ ((gcc_struct));
 
-extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
+extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
+
+extern void __ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, long long value);
+
+extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
+
+extern void __ecereNameSpace__ecere__com__eInstance_SetMethod(struct __ecereNameSpace__ecere__com__Instance * instance, const char *  name, void *  function);
+
+extern void __ecereNameSpace__ecere__com__eInstance_IncRef(struct __ecereNameSpace__ecere__com__Instance * instance);
+
+extern void __ecereNameSpace__ecere__com__eInstance_StopWatching(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property, struct __ecereNameSpace__ecere__com__Instance * object);
+
+extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
+
+extern void __ecereNameSpace__ecere__com__eInstance_FireWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
 
@@ -417,12 +446,12 @@ struct __ecereNameSpace__ecere__com__DataMember
 {
 struct __ecereNameSpace__ecere__com__DataMember * prev;
 struct __ecereNameSpace__ecere__com__DataMember * next;
-char *  name;
+const char *  name;
 unsigned int isProperty;
 int memberAccess;
 int id;
 struct __ecereNameSpace__ecere__com__Class * _class;
-char *  dataTypeString;
+const char *  dataTypeString;
 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
 struct Type * dataType;
 int type;
@@ -452,21 +481,21 @@ union
 {
 struct
 {
-char *  dataTypeString;
+const char *  dataTypeString;
 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
-} __attribute__ ((gcc_struct));
+} __attribute__ ((gcc_struct)) __anon1;
 struct __ecereNameSpace__ecere__com__DataValue expression;
 struct
 {
-char *  memberString;
+const char *  memberString;
 union
 {
 struct __ecereNameSpace__ecere__com__DataMember * member;
 struct __ecereNameSpace__ecere__com__Property * prop;
 struct __ecereNameSpace__ecere__com__Method * method;
-} __attribute__ ((gcc_struct));
-} __attribute__ ((gcc_struct));
-} __attribute__ ((gcc_struct));
+} __attribute__ ((gcc_struct)) __anon1;
+} __attribute__ ((gcc_struct)) __anon2;
+} __attribute__ ((gcc_struct)) __anon1;
 } __attribute__ ((gcc_struct));
 
 static struct Context * globalContext;
@@ -475,9 +504,9 @@ static struct __ecereNameSpace__ecere__com__Instance * privateModule;
 
 static struct ModuleImport * mainModule;
 
-struct __ecereNameSpace__ecere__sys__OldList _excludedSymbols = 
+struct __ecereNameSpace__ecere__sys__OldList _excludedSymbols =
 {
-0, 0, 0, (unsigned int)&((struct Symbol *)(void *)0)->left, 0
+0, 0, 0, (unsigned int)(uintptr_t)&((struct Symbol *)(void * )0)->left, 0
 };
 
 static struct __ecereNameSpace__ecere__sys__OldList defines, imports;
@@ -486,7 +515,7 @@ extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpac
 
 struct __ecereNameSpace__ecere__com__NameSpace
 {
-char *  name;
+const char *  name;
 struct __ecereNameSpace__ecere__com__NameSpace *  btParent;
 struct __ecereNameSpace__ecere__com__NameSpace *  left;
 struct __ecereNameSpace__ecere__com__NameSpace *  right;
@@ -500,9 +529,7 @@ struct __ecereNameSpace__ecere__sys__BinaryTree functions;
 
 static struct __ecereNameSpace__ecere__com__NameSpace globalData;
 
-static struct __ecereNameSpace__ecere__sys__OldList _precompDefines;
-
-extern struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__FileOpen(char *  fileName, int mode);
+extern struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__FileOpen(const char *  fileName, int mode);
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_MethodImport;
 
@@ -535,7 +562,7 @@ struct FunctionImport * next;
 char *  name;
 } __attribute__ ((gcc_struct));
 
-int __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(struct __ecereNameSpace__ecere__com__Instance * this, char *  format, ...);
+int __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(struct __ecereNameSpace__ecere__com__Instance * this, const char *  format, ...);
 
 extern void __ecereNameSpace__ecere__com__eInstance_DecRef(struct __ecereNameSpace__ecere__com__Instance * instance);
 
@@ -632,49 +659,49 @@ __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(f, "   .\n");
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_CompilerApp;
 
-extern int __ecereNameSpace__ecere__com__GetRuntimePlatform(void);
-
 extern int GetHostBits(void);
 
-extern void SetSymbolsDir(char *  s);
+extern void SetSymbolsDir(const char *  s);
 
 extern int strcmp(const char * , const char * );
 
-extern int strlen(const char * );
+extern size_t strlen(const char * );
 
 extern char *  strcpy(char * , const char * );
 
+extern char *  PassArg(char *  output, const char *  input);
+
 extern void SetBuildingEcereCom(unsigned int b);
 
 extern void SetBuildingEcereComModule(unsigned int b);
 
-extern char *  __ecereNameSpace__ecere__sys__CopyString(char *  string);
+extern char *  __ecereNameSpace__ecere__sys__CopyString(const char *  string);
+
+extern const char *  GetOutputFile(void);
 
-extern char *  GetOutputFile(void);
+extern void SetOutputFile(const char *  s);
 
-extern void SetOutputFile(char *  s);
+extern const char *  GetSourceFile(void);
 
-extern char *  GetSourceFile(void);
+extern void SetSourceFile(const char *  s);
 
-extern void SetSourceFile(char *  s);
+extern void SetI18nModuleName(const char *  s);
 
 extern void SetMemoryGuard(unsigned int b);
 
-extern void SetDefaultNameSpace(char *  s);
+extern void SetDefaultNameSpace(const char *  s);
 
 extern void SetStrictNameSpaces(unsigned int b);
 
 extern void SetOutputLineNumbers(unsigned int value);
 
-extern char *  __ecereNameSpace__ecere__sys__PathCat(char *  string, char *  addedPath);
+extern char *  __ecereNameSpace__ecere__sys__PathCat(char *  string, const char *  addedPath);
 
-extern char *  __ecereNameSpace__ecere__sys__ChangeExtension(char *  string, char *  ext, char *  output);
+extern char *  __ecereNameSpace__ecere__sys__ChangeExtension(const char *  string, const char *  ext, char *  output);
 
-extern int printf(char * , ...);
+extern int printf(const char * , ...);
 
-extern char *  __ecereNameSpace__ecere__GetTranslatedString(struct __ecereNameSpace__ecere__com__Instance * module, char *  string, char *  stringAndContext);
-
-extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
+extern const char *  __ecereNameSpace__ecere__GetTranslatedString(const char * name, const char *  string, const char *  stringAndContext);
 
 extern void SetGlobalData(struct __ecereNameSpace__ecere__com__NameSpace *  nameSpace);
 
@@ -702,7 +729,7 @@ extern struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__
 
 extern void SetPrivateModule(struct __ecereNameSpace__ecere__com__Instance * module);
 
-extern struct Type * ProcessTypeString(char *  string, unsigned int staticMethod);
+extern struct Type * ProcessTypeString(const char *  string, unsigned int staticMethod);
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_GlobalData;
 
@@ -720,23 +747,23 @@ void *  symbol;
 char *  fullName;
 } __attribute__ ((gcc_struct));
 
-extern int snprintf(char * , int, char * , ...);
+extern int snprintf(char * , size_t, const char * , ...);
 
-extern struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__DualPipeOpen(unsigned int mode, char *  commandLine);
+extern struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__sys__DualPipeOpen(unsigned int mode, const char *  commandLine);
 
 extern void SetFileInput(struct __ecereNameSpace__ecere__com__Instance * file);
 
 extern void SetMainModule(struct ModuleImport * moduleImport);
 
-extern char *  __ecereNameSpace__ecere__sys__GetLastDirectory(char *  string, char *  output);
+extern char *  __ecereNameSpace__ecere__sys__GetLastDirectory(const char *  string, char *  output);
 
 extern unsigned int __ecereNameSpace__ecere__sys__StripExtension(char *  string);
 
 extern void resetScanner(void);
 
-extern char *  GetSymbolsDir(void);
+extern const char *  GetSymbolsDir(void);
 
-extern unsigned int LoadSymbols(char *  fileName, int importType, unsigned int loadDllOnly);
+extern unsigned int LoadSymbols(const char *  fileName, int importType, unsigned int loadDllOnly);
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass_ImportedModule;
 
@@ -758,7 +785,7 @@ extern unsigned int GetEcereImported(void);
 
 extern unsigned int GetBuildingEcereCom(void);
 
-extern struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__com__eModule_LoadStrict(struct __ecereNameSpace__ecere__com__Instance * fromModule, char *  name, int importAccess);
+extern struct __ecereNameSpace__ecere__com__Instance * __ecereNameSpace__ecere__com__eModule_LoadStrict(struct __ecereNameSpace__ecere__com__Instance * fromModule, const char *  name, int importAccess);
 
 extern void ParseEc(void);
 
@@ -766,7 +793,7 @@ extern void CheckDataRedefinitions(void);
 
 extern void SetYydebug(unsigned int b);
 
-extern void SetCurrentNameSpace(char *  s);
+extern void SetCurrentNameSpace(const char *  s);
 
 extern void SetDeclMode(int accessMode);
 
@@ -823,7 +850,7 @@ extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpac
 struct __ecereNameSpace__ecere__com__Application
 {
 int argc;
-char * *  argv;
+const char * *  argv;
 int exitCode;
 unsigned int isGUIApp;
 struct __ecereNameSpace__ecere__sys__OldList allModules;
@@ -831,9 +858,9 @@ char *  parsedCommand;
 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
 } __attribute__ ((gcc_struct));
 
-char *  __ecereProp___ecereNameSpace__ecere__com__Platform_Get_char__PTR_(int this);
+const char *  __ecereProp___ecereNameSpace__ecere__com__Platform_Get_char__PTR_(int this);
 
-int __ecereProp___ecereNameSpace__ecere__com__Platform_Set_char__PTR_(char *  value);
+int __ecereProp___ecereNameSpace__ecere__com__Platform_Set_char__PTR_(const char *  value);
 
 extern struct __ecereNameSpace__ecere__com__Property ** __ecereProp___ecereNameSpace__ecere__com__Platform_char__PTR_;
 
@@ -845,6 +872,8 @@ unsigned int __ecereMethod___ecereNameSpace__ecere__sys__OldList_AddName(struct
 
 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Eof;
 
+extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__sys__DualPipe;
+
 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Read;
 
 int __ecereVMethodID___ecereNameSpace__ecere__sys__File_Write;
@@ -859,28 +888,26 @@ void __ecereMethod___ecereNameSpace__ecere__sys__OldList_Free(struct __ecereName
 
 void __ecereMethod_CompilerApp_Main(struct __ecereNameSpace__ecere__com__Instance * this)
 {
-void * __ecereTemp1;
 char * cppCommand = (((void *)0));
 char * cppOptions = (((void *)0));
 int cppOptionsLen = 0;
 int c;
-unsigned int valid = 0x1;
+unsigned int valid = 1;
 char defaultOutputFile[797];
-unsigned int buildingBootStrap = 0x0;
-int targetPlatform = __ecereNameSpace__ecere__com__GetRuntimePlatform();
+unsigned int buildingBootStrap = 0;
+int targetPlatform = __runtimePlatform;
 int targetBits = GetHostBits();
 
 SetSymbolsDir("");
 for(c = 1; c < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argc; c++)
 {
-char * arg = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argv[c];
+const char * arg = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argv[c];
 
 if(arg[0] == '-')
 {
 if(!strcmp(arg + 1, "m32") || !strcmp(arg + 1, "m64"))
 {
-int argLen = strlen(arg);
-int newLen = cppOptionsLen + 1 + argLen;
+int newLen = cppOptionsLen + 1 + strlen(arg);
 
 cppOptions = __ecereNameSpace__ecere__com__eSystem_Renew(cppOptions, sizeof(char) * (newLen + 1));
 cppOptions[cppOptionsLen] = ' ';
@@ -888,50 +915,43 @@ strcpy(cppOptions + cppOptionsLen + 1, arg);
 cppOptionsLen = newLen;
 targetBits = !strcmp(arg + 1, "m32") ? 32 : 64;
 }
-else if(arg[1] == 'D')
+else if(!strcmp(arg + 1, "t32") || !strcmp(arg + 1, "t64"))
 {
-int argLen = strlen(arg);
-int newLen = cppOptionsLen + 1 + argLen;
+targetBits = !strcmp(arg + 1, "t32") ? 32 : 64;
+}
+else if(arg[1] == 'D' || arg[1] == 'I')
+{
+char * buf;
+int size = cppOptionsLen + 1 + strlen(arg) * 2 + 1;
 
-cppOptions = __ecereNameSpace__ecere__com__eSystem_Renew(cppOptions, sizeof(char) * (newLen + 1));
-cppOptions[cppOptionsLen] = ' ';
-strcpy(cppOptions + cppOptionsLen + 1, arg);
-cppOptionsLen = newLen;
+cppOptions = __ecereNameSpace__ecere__com__eSystem_Renew(cppOptions, sizeof(char) * (size));
+buf = cppOptions + cppOptionsLen;
+*buf++ = ' ';
+PassArg(buf, arg);
+cppOptionsLen = cppOptionsLen + 1 + strlen(buf);
+if(arg[1] == 'D')
+{
 if(!strcmp(arg, "-DBUILDING_ECERE_COM"))
-SetBuildingEcereCom(0x1);
+SetBuildingEcereCom(1);
 else if(!strcmp(arg, "-DECERE_COM_MODULE"))
-SetBuildingEcereComModule(0x1);
+SetBuildingEcereComModule(1);
 else if(!strcmp(arg, "-DECERE_BOOTSTRAP"))
-buildingBootStrap = 0x1;
+buildingBootStrap = 1;
 }
-else if(arg[1] == 'I')
-{
-int argLen = strlen(arg);
-int newLen = cppOptionsLen + argLen + 3;
-
-cppOptions = __ecereNameSpace__ecere__com__eSystem_Renew(cppOptions, sizeof(char) * (newLen + 1));
-cppOptions[cppOptionsLen] = ' ';
-cppOptions[cppOptionsLen + 1] = '-';
-cppOptions[cppOptionsLen + 2] = 'I';
-cppOptions[cppOptionsLen + 3] = '"';
-strcpy(cppOptions + cppOptionsLen + 4, arg + 2);
-cppOptions[newLen - 1] = '\"';
-cppOptions[newLen] = '\0';
-cppOptionsLen = newLen;
 }
 else if(!strcmp(arg + 1, "t"))
 {
 if(++c < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argc)
 targetPlatform = __ecereProp___ecereNameSpace__ecere__com__Platform_Set_char__PTR_(((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argv[c]);
 else
-valid = 0x0;
+valid = 0;
 }
 else if(!strcmp(arg + 1, "cpp"))
 {
 if(++c < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argc)
 cppCommand = __ecereNameSpace__ecere__sys__CopyString(((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argv[c]);
 else
-valid = 0x0;
+valid = 0;
 }
 else if(!strcmp(arg + 1, "o"))
 {
@@ -941,7 +961,7 @@ SetOutputFile(((struct __ecereNameSpace__ecere__com__Application *)(((char *)thi
 c++;
 }
 else
-valid = 0x0;
+valid = 0;
 }
 else if(!strcmp(arg + 1, "c"))
 {
@@ -951,29 +971,37 @@ SetSourceFile(((struct __ecereNameSpace__ecere__com__Application *)(((char *)thi
 c++;
 }
 else
-valid = 0x0;
+valid = 0;
 }
 else if(!strcmp(arg + 1, "isystem") || !strcmp(arg + 1, "isysroot"))
 {
 if(c + 1 < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argc)
 {
-int argLen = strlen(arg);
-int arg1Len = strlen(((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argv[c + 1]);
-int newLen = cppOptionsLen + argLen + arg1Len + 4;
-
-cppOptions = __ecereNameSpace__ecere__com__eSystem_Renew(cppOptions, sizeof(char) * (newLen + 1));
-cppOptions[cppOptionsLen] = ' ';
-strcpy(cppOptions + cppOptionsLen + 1, arg);
-cppOptions[cppOptionsLen + argLen + 1] = ' ';
-cppOptions[cppOptionsLen + argLen + 2] = '"';
-arg = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argv[++c];
-strcpy(cppOptions + cppOptionsLen + argLen + 3, arg);
-cppOptions[newLen - 1] = '\"';
-cppOptions[newLen] = '\0';
-cppOptionsLen = newLen;
+char * buf;
+const char * arg1 = ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argv[++c];
+int size = cppOptionsLen + 1 + strlen(arg) * 2 + strlen(arg1) * 2 + 1;
+
+cppOptions = __ecereNameSpace__ecere__com__eSystem_Renew(cppOptions, sizeof(char) * (size));
+buf = cppOptions + cppOptionsLen;
+*buf++ = ' ';
+buf = PassArg(buf, arg);
+*buf++ = ' ';
+buf = PassArg(buf, arg1);
+cppOptionsLen = buf - cppOptions;
 }
 else
-valid = 0x0;
+valid = 0;
+}
+else if(!strcmp(arg + 1, "fno-diagnostics-show-caret"))
+{
+char * buf;
+int size = cppOptionsLen + 1 + strlen(arg) * 2 + 1;
+
+cppOptions = __ecereNameSpace__ecere__com__eSystem_Renew(cppOptions, sizeof(char) * (size));
+buf = cppOptions + cppOptionsLen;
+*buf++ = ' ';
+PassArg(buf, arg);
+cppOptionsLen = cppOptionsLen + 1 + strlen(buf);
 }
 else if(!strcmp(arg + 1, "symbols"))
 {
@@ -983,11 +1011,21 @@ SetSymbolsDir(((struct __ecereNameSpace__ecere__com__Application *)(((char *)thi
 c++;
 }
 else
-valid = 0x0;
+valid = 0;
+}
+else if(!strcmp(arg + 1, "module"))
+{
+if(c + 1 < ((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argc)
+{
+SetI18nModuleName(((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->argv[c + 1]);
+c++;
+}
+else
+valid = 0;
 }
 else if(!strcmp(arg + 1, "memguard"))
 {
-SetMemoryGuard(0x1);
+SetMemoryGuard(1);
 }
 else if(!strcmp(arg + 1, "defaultns"))
 {
@@ -997,26 +1035,26 @@ SetDefaultNameSpace(((struct __ecereNameSpace__ecere__com__Application *)(((char
 c++;
 }
 else
-valid = 0x0;
+valid = 0;
 }
 else if(!strcmp(arg + 1, "strictns"))
 {
-SetStrictNameSpaces(0x1);
+SetStrictNameSpaces(1);
 }
 else if(!strcmp(arg + 1, "nolinenumbers"))
 {
-SetOutputLineNumbers(0x0);
+SetOutputLineNumbers(0);
 }
 }
 else
-valid = 0x0;
+valid = 0;
 }
 if(valid)
 {
 if(!cppCommand)
 cppCommand = __ecereNameSpace__ecere__sys__CopyString("gcc");
 if(!GetSourceFile())
-valid = 0x0;
+valid = 0;
 else if(!GetOutputFile())
 {
 strcpy(defaultOutputFile, "");
@@ -1026,11 +1064,13 @@ SetOutputFile(defaultOutputFile);
 }
 }
 if(!valid)
-printf(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "Syntax:\n   ecc [-t <target platform>] [-cpp <c preprocessor>] [-o <output>] [-symbols <outputdir>] [-I<includedir>]* [-isystem <sysincludedir>]* [-D<definition>]* -c <input>\n", (((void *)0))));
+{
+printf(__ecereNameSpace__ecere__GetTranslatedString("ecc", "Syntax:\n   ecc [-t <target platform>] [-cpp <c preprocessor>] [-o <output>] [-module <module>] [-symbols <outputdir>] [-I<includedir>]* [-isystem <sysincludedir>]* [-D<definition>]* -c <input>\n", (((void *)0))));
+}
 else
 {
 struct __ecereNameSpace__ecere__com__Instance * cppOutput;
-char command[3075LL];
+char command[3075];
 
 SetGlobalData(&globalData);
 SetExcludedSymbols(&_excludedSymbols);
@@ -1039,21 +1079,59 @@ SetCurrentContext(globalContext);
 SetTopContext(globalContext);
 SetDefines(&defines);
 SetImports(&imports);
-SetInCompiler(0x1);
+SetInCompiler(1);
 SetTargetPlatform(targetPlatform);
 SetTargetBits(targetBits);
-SetEchoOn(0x0);
-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)));
+SetEchoOn(0);
+privateModule = (struct __ecereNameSpace__ecere__com__Instance *)__ecereNameSpace__ecere__com____ecere_COM_Initialize((unsigned int)(1 | (targetBits == sizeof(uintptr_t) * 8 ? (unsigned int)0 : targetBits == 64 ? 2 : targetBits == 32 ? 4 : (unsigned int)0) | 8), 1, (((void *)0)));
 SetPrivateModule(privateModule);
-__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString("uint"), ((struct Symbol *)__ecereTemp1)->type = ProcessTypeString("unsigned int", 0x0), ((struct Symbol *)__ecereTemp1)));
-__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString("uint64"), ((struct Symbol *)__ecereTemp1)->type = ProcessTypeString("unsigned int64", 0x0), ((struct Symbol *)__ecereTemp1)));
-__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString("uint32"), ((struct Symbol *)__ecereTemp1)->type = ProcessTypeString("unsigned int", 0x0), ((struct Symbol *)__ecereTemp1)));
-__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString("uint16"), ((struct Symbol *)__ecereTemp1)->type = ProcessTypeString("unsigned short", 0x0), ((struct Symbol *)__ecereTemp1)));
-__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString("byte"), ((struct Symbol *)__ecereTemp1)->type = ProcessTypeString("unsigned char", 0x0), ((struct Symbol *)__ecereTemp1)));
+__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)__extension__ ({
+struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
+
+__ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("uint"), __ecereInstance1->type = ProcessTypeString("unsigned int", 0), __ecereInstance1;
+}));
+__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)__extension__ ({
+struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
+
+__ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("uint64"), __ecereInstance1->type = ProcessTypeString("unsigned int64", 0), __ecereInstance1;
+}));
+__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)__extension__ ({
+struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
+
+__ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("uint32"), __ecereInstance1->type = ProcessTypeString("unsigned int", 0), __ecereInstance1;
+}));
+__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)__extension__ ({
+struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
+
+__ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("uint16"), __ecereInstance1->type = ProcessTypeString("unsigned short", 0), __ecereInstance1;
+}));
+__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)__extension__ ({
+struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
+
+__ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("byte"), __ecereInstance1->type = ProcessTypeString("unsigned char", 0), __ecereInstance1;
+}));
 if(buildingBootStrap)
 {
-__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString("intptr_t"), ((struct Symbol *)__ecereTemp1)->type = ProcessTypeString("intptr", 0x0), ((struct Symbol *)__ecereTemp1)));
-__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)(__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol), ((struct Symbol *)__ecereTemp1)->string = __ecereNameSpace__ecere__sys__CopyString("uintptr_t"), ((struct Symbol *)__ecereTemp1)->type = ProcessTypeString("uintptr", 0x0), ((struct Symbol *)__ecereTemp1)));
+__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)__extension__ ({
+struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
+
+__ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("intptr_t"), __ecereInstance1->type = ProcessTypeString("intptr", 0), __ecereInstance1;
+}));
+__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)__extension__ ({
+struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
+
+__ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("uintptr_t"), __ecereInstance1->type = ProcessTypeString("uintptr", 0), __ecereInstance1;
+}));
+__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)__extension__ ({
+struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
+
+__ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("ssize_t"), __ecereInstance1->type = ProcessTypeString("intsize", 0), __ecereInstance1;
+}));
+__ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalContext->types, (struct __ecereNameSpace__ecere__sys__BTNode *)__extension__ ({
+struct Symbol * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Symbol);
+
+__ecereInstance1->string = __ecereNameSpace__ecere__sys__CopyString("size_t"), __ecereInstance1->type = ProcessTypeString("uintsize", 0), __ecereInstance1;
+}));
 }
 {
 struct GlobalData * data = (data = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_GlobalData), data->fullName = __ecereNameSpace__ecere__sys__CopyString("__thisModule"), data->dataTypeString = __ecereNameSpace__ecere__sys__CopyString("Module"), data->module = privateModule, data);
@@ -1061,12 +1139,13 @@ struct GlobalData * data = (data = __ecereNameSpace__ecere__com__eInstance_New(_
 data->key = (uintptr_t)data->fullName;
 __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_Add(&globalData.functions, (struct __ecereNameSpace__ecere__sys__BTNode *)data);
 }
-snprintf(command, sizeof command, "%s%s -x c -E %s\"%s\"", cppCommand, cppOptions ? cppOptions : "", buildingBootStrap ? "" : "-include stdint.h ", GetSourceFile());
-command[sizeof command - 1] = (char)0;
-if((cppOutput = __ecereNameSpace__ecere__sys__DualPipeOpen((((unsigned int)(0x1))), command)))
+snprintf(command, sizeof (command), "%s%s -x c -E %s\"%s\"", cppCommand, cppOptions ? cppOptions : "", buildingBootStrap ? "" : "-include stdint.h -include sys/types.h ", GetSourceFile());
+command[sizeof (command) - 1] = (char)0;
+if((cppOutput = __ecereNameSpace__ecere__sys__DualPipeOpen((((unsigned int)(1))), command)))
 {
 char impFile[797];
 struct ImportedModule * module;
+char sourceFileName[274];
 char mainModuleName[274];
 int exitCode;
 struct __ecereNameSpace__ecere__sys__OldList * ast;
@@ -1075,31 +1154,52 @@ struct __ecereNameSpace__ecere__com__Instance * fileInput = __ecereNameSpace__ec
 SetFileInput(fileInput);
 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&imports, (mainModule = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ModuleImport)));
 SetMainModule(mainModule);
-__ecereNameSpace__ecere__sys__GetLastDirectory(GetSourceFile(), mainModuleName);
+__ecereNameSpace__ecere__sys__GetLastDirectory(GetSourceFile(), sourceFileName);
+strcpy(mainModuleName, sourceFileName);
 __ecereNameSpace__ecere__sys__StripExtension(mainModuleName);
-module = (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ImportedModule), ((struct ImportedModule *)__ecereTemp1)->name = __ecereNameSpace__ecere__sys__CopyString(mainModuleName), ((struct ImportedModule *)__ecereTemp1)->type = 0, ((struct ImportedModule *)__ecereTemp1));
+module = __extension__ ({
+struct ImportedModule * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_ImportedModule);
+
+__ecereInstance1->name = __ecereNameSpace__ecere__sys__CopyString(mainModuleName), __ecereInstance1->type = 0, __ecereInstance1;
+});
 __ecereMethod___ecereNameSpace__ecere__sys__OldList_AddName(&defines, module);
 resetScanner();
-while(!((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *))cppOutput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Eof])(cppOutput))
+while(!((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *))__extension__ ({
+struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = cppOutput;
+
+__internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__DualPipe->_vTbl;
+})[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Eof])(cppOutput))
 {
 char junk[4096];
-int count = ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))cppOutput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(cppOutput, junk, 1, 4096);
+int count = ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))__extension__ ({
+struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = cppOutput;
+
+__internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__DualPipe->_vTbl;
+})[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Read])(cppOutput, junk, 1, 4096);
 
-((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void *  buffer, unsigned int size, unsigned int count))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, junk, 1, count);
+((int (*)(struct __ecereNameSpace__ecere__com__Instance *, const void *  buffer, unsigned int size, unsigned int count))__extension__ ({
+struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
+
+__internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
+})[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Write])(fileInput, junk, 1, count);
 }
 exitCode = __ecereMethod___ecereNameSpace__ecere__sys__DualPipe_GetExitCode(cppOutput);
 (__ecereNameSpace__ecere__com__eInstance_DecRef(cppOutput), cppOutput = 0);
-((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))fileInput->_vTbl[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
+((unsigned int (*)(struct __ecereNameSpace__ecere__com__Instance *, int pos, int mode))__extension__ ({
+struct __ecereNameSpace__ecere__com__Instance * __internal_ClassInst = fileInput;
+
+__internal_ClassInst ? __internal_ClassInst->_vTbl : __ecereClass___ecereNameSpace__ecere__sys__TempFile->_vTbl;
+})[__ecereVMethodID___ecereNameSpace__ecere__sys__File_Seek])(fileInput, 0, 0);
 {
 char symFile[274];
 char symLocation[797];
 struct ImportedModule * module, * next;
 
-__ecereNameSpace__ecere__sys__GetLastDirectory(GetSourceFile(), symFile);
+strcpy(symFile, sourceFileName);
 __ecereNameSpace__ecere__sys__ChangeExtension(symFile, "sym", symFile);
 strcpy(symLocation, GetSymbolsDir());
 __ecereNameSpace__ecere__sys__PathCat(symLocation, symFile);
-LoadSymbols(symLocation, 3, 0x0);
+LoadSymbols(symLocation, 3, 0);
 for(module = defines.first; module; module = next)
 {
 next = module->next;
@@ -1114,7 +1214,7 @@ __ecereNameSpace__ecere__com__eModule_LoadStrict(privateModule, "ecereCOM", 1);
 }
 ParseEc();
 CheckDataRedefinitions();
-SetYydebug(0x0);
+SetYydebug(0);
 SetCurrentNameSpace((((void *)0)));
 SetDefaultNameSpace((((void *)0)));
 SetDeclMode(2);
@@ -1134,13 +1234,8 @@ ProcessInstantiations();
 ProcessMemberAccess();
 ProcessInstanceDeclarations();
 strcpy(impFile, GetSymbolsDir());
-{
-char fileName[274];
-
-__ecereNameSpace__ecere__sys__GetLastDirectory(GetSourceFile(), fileName);
-__ecereNameSpace__ecere__sys__PathCat(impFile, fileName);
+__ecereNameSpace__ecere__sys__PathCat(impFile, sourceFileName);
 __ecereNameSpace__ecere__sys__ChangeExtension(impFile, "imp", impFile);
-}
 if(imports.first)
 OutputImports(impFile);
 if(!((struct __ecereNameSpace__ecere__com__Application *)(((char *)this + structSize_Module)))->exitCode)
@@ -1149,6 +1244,14 @@ struct __ecereNameSpace__ecere__com__Instance * output = __ecereNameSpace__ecere
 
 if(output)
 {
+__ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "/* Code generated from eC source file: %s */\n", sourceFileName);
+__ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#if defined(_WIN32)\n");
+__ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#define __runtimePlatform 1\n");
+__ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#elif defined(__APPLE__)\n");
+__ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#define __runtimePlatform 3\n");
+__ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#else\n");
+__ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#define __runtimePlatform 2\n");
+__ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#endif\n");
 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#if defined(__GNUC__)\n");
 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "typedef long long int64;\n");
 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "typedef unsigned long long uint64;\n");
@@ -1181,6 +1284,7 @@ __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#endif\n");
 if(buildingBootStrap)
 {
 __ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#include <stdint.h>\n");
+__ecereMethod___ecereNameSpace__ecere__sys__File_Printf(output, "#include <sys/types.h>\n");
 }
 if(ast)
 OutputTree(ast, output);
@@ -1210,7 +1314,7 @@ SetSymbolsDir((((void *)0)));
 OutputIntlStrings();
 }
 
-extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, char *  name, char *  baseName, int size, int sizeClass, unsigned int (* )(void * ), void (* )(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
+extern struct __ecereNameSpace__ecere__com__Class * __ecereNameSpace__ecere__com__eSystem_RegisterClass(int type, const char *  name, const char *  baseName, int size, int sizeClass, unsigned int (*  Constructor)(void * ), void (*  Destructor)(void * ), struct __ecereNameSpace__ecere__com__Instance * module, int declMode, int inheritanceAccess);
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Module;
 
@@ -1223,7 +1327,7 @@ struct __ecereNameSpace__ecere__sys__OldList functions;
 struct __ecereNameSpace__ecere__sys__OldList modules;
 struct __ecereNameSpace__ecere__com__Instance * prev;
 struct __ecereNameSpace__ecere__com__Instance * next;
-char *  name;
+const char *  name;
 void *  library;
 void *  Unload;
 int importType;
@@ -1232,11 +1336,13 @@ struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
 } __attribute__ ((gcc_struct));
 
-extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_AddMethod(struct __ecereNameSpace__ecere__com__Class * _class, char *  name, char *  type, void *  function, int declMode);
+extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
+
+extern struct __ecereNameSpace__ecere__com__Method * __ecereNameSpace__ecere__com__eClass_AddMethod(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, const char *  type, void *  function, int declMode);
 
 void __ecereRegisterModule_ecc(struct __ecereNameSpace__ecere__com__Instance * module)
 {
-struct __ecereNameSpace__ecere__com__Class * class;
+struct __ecereNameSpace__ecere__com__Class __attribute__((unused)) * class;
 
 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(0, "CompilerApp", "ecere::com::Application", 0, 0, 0, 0, module, 2, 1);
 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
@@ -1249,7 +1355,7 @@ void __ecereUnregisterModule_ecc(struct __ecereNameSpace__ecere__com__Instance *
 
 }
 
-int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_CompareString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, char *  a, char *  b);
+int __ecereMethod___ecereNameSpace__ecere__sys__BinaryTree_CompareString(struct __ecereNameSpace__ecere__sys__BinaryTree * this, const char *  a, const char *  b);
 
 void __ecereCreateModuleInstances_ecc()
 {
@@ -1259,6 +1365,6 @@ globalContext = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Context
 
 void __ecereDestroyModuleInstances_ecc()
 {
-((globalContext ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor(globalContext) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(globalContext)) : 0), globalContext = 0);
+((globalContext ? (__ecereClass_Context->Destructor ? __ecereClass_Context->Destructor((void *)globalContext) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(globalContext)) : 0), globalContext = 0);
 }