compiler/bootstrap: (#980) Updated for 0.44.08
[sdk] / compiler / bootstrap / libec / bootstrap / ecdefs.c
index bd33c40..d80261c 100644 (file)
@@ -129,7 +129,7 @@ unsigned int isWatchable;
 struct CodePosition
 {
 int line, charPos, pos;
-unsigned int included;
+int included;
 } __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_CodePosition;
@@ -803,6 +803,7 @@ unsigned int keepCast : 1;
 unsigned int passAsTemplate : 1;
 unsigned int dllExport : 1;
 unsigned int attrStdcall : 1;
+unsigned int declaredWithStruct : 1;
 } __attribute__ ((gcc_struct));
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass_Type;
@@ -863,6 +864,7 @@ struct __ecereNameSpace__ecere__com__ClassTemplateArgument *  templateArgs;
 struct __ecereNameSpace__ecere__com__Class * templateClass;
 struct __ecereNameSpace__ecere__sys__OldList templatized;
 int numParams;
+unsigned int isInstanceClass;
 } __attribute__ ((gcc_struct));
 
 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char *  name);
@@ -1164,6 +1166,60 @@ void SetOutputLineNumbers(unsigned int value)
 outputLineNumbers = value;
 }
 
+extern void __ecereNameSpace__ecere__sys__ChangeCh(char *  string, char ch1, char ch2);
+
+void FixModuleName(char * moduleName)
+{
+__ecereNameSpace__ecere__sys__ChangeCh(moduleName, '.', '_');
+__ecereNameSpace__ecere__sys__ChangeCh(moduleName, ' ', '_');
+__ecereNameSpace__ecere__sys__ChangeCh(moduleName, '-', '_');
+__ecereNameSpace__ecere__sys__ChangeCh(moduleName, '&', '_');
+}
+
+extern char *  strchr(const char * , int);
+
+char * PassArg(char * output, const char * input)
+{
+#ifdef __WIN32__
+const char * escChars = " !%&'()+,;=[]^`{}~\"";
+const char * escCharsQuoted = "\"";
+#else
+const char * escChars = " !\"$&'()*:;<=>?[\\`{|";
+const char * escCharsQuoted = "\"()$";
+#endif
+unsigned int quoting = 0x0;
+char * o = output, * i = input, * l = input;
+
+#ifdef __WIN32__
+while(*l && !strchr(escChars, *l))
+l++;
+if(*l)
+quoting = 0x1;
+#else
+if(*i == '-')
+{
+l++;
+while(*l && !strchr(escChars, *l))
+l++;
+if(*l)
+quoting = 0x1;
+*o++ = *i++;
+}
+#endif
+if(quoting)
+*o++ = '\"';
+while(*i)
+{
+if(strchr(quoting ? escCharsQuoted : escChars, *i))
+*o++ = '\\';
+*o++ = *i++;
+}
+if(quoting)
+*o++ = '\"';
+*o = '\0';
+return o;
+}
+
 struct GlobalData
 {
 uintptr_t key;
@@ -1684,7 +1740,7 @@ char string[10000];
 if(yylloc.start.included)
 {
 __ecereNameSpace__ecere__sys__GetWorkingDir(string, sizeof string);
-__ecereNameSpace__ecere__sys__PathCat(string, GetIncludeFileFromID((unsigned int)yylloc.start.included));
+__ecereNameSpace__ecere__sys__PathCat(string, GetIncludeFileFromID(yylloc.start.included));
 }
 else
 {
@@ -1724,7 +1780,7 @@ char string[10000];
 if(yylloc.start.included)
 {
 __ecereNameSpace__ecere__sys__GetWorkingDir(string, sizeof string);
-__ecereNameSpace__ecere__sys__PathCat(string, GetIncludeFileFromID((unsigned int)yylloc.start.included));
+__ecereNameSpace__ecere__sys__PathCat(string, GetIncludeFileFromID(yylloc.start.included));
 }
 else
 {
@@ -1895,6 +1951,8 @@ __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetExcludedSymbols", "vo
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetImports", "void SetImports(ecere::sys::OldList * list)", SetImports, module, 1);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetDefines", "void SetDefines(ecere::sys::OldList * list)", SetDefines, module, 1);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("SetOutputLineNumbers", "void SetOutputLineNumbers(bool value)", SetOutputLineNumbers, module, 1);
+__ecereNameSpace__ecere__com__eSystem_RegisterFunction("FixModuleName", "void FixModuleName(char * moduleName)", FixModuleName, module, 1);
+__ecereNameSpace__ecere__com__eSystem_RegisterFunction("PassArg", "char * PassArg(char * output, const char * input)", PassArg, module, 1);
 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(5, "GlobalData", "ecere::sys::BTNode", sizeof(struct GlobalData), 0, 0, 0, module, 1, 1);
 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
 __ecereClass_GlobalData = class;
@@ -1918,7 +1976,7 @@ __ecereNameSpace__ecere__com__eClass_AddMethod(class, "AdjustDelete", "void Adju
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "line", "int", 4, 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "charPos", "int", 4, 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "pos", "int", 4, 4, 1);
-__ecereNameSpace__ecere__com__eClass_AddDataMember(class, "included", "bool", 4, 4, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(class, "included", "int", 4, 4, 1);
 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(1, "Location", 0, sizeof(struct Location), 0, 0, 0, module, 1, 1);
 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
 __ecereClass_Location = class;
@@ -2796,6 +2854,7 @@ __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "keepCast", "bool:1",
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "passAsTemplate", "bool:1", 4, 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "dllExport", "bool:1", 4, 4, 1);
 __ecereNameSpace__ecere__com__eClass_AddDataMember(class, "attrStdcall", "bool:1", 4, 4, 1);
+__ecereNameSpace__ecere__com__eClass_AddDataMember(class, "declaredWithStruct", "bool:1", 4, 4, 1);
 class = __ecereNameSpace__ecere__com__eSystem_RegisterClass(1, "Operand", 0, sizeof(struct Operand), 0, 0, 0, module, 1, 1);
 if(((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application == ((struct __ecereNameSpace__ecere__com__Module *)(((char *)__thisModule + structSize_Instance)))->application && class)
 __ecereClass_Operand = class;