wip II
[sdk] / compiler / bootstrap / libec / bootstrap / copy.c
index 948a110..580a6f9 100644 (file)
@@ -1,6 +1,10 @@
+/* Code generated from eC source file: copy.ec */
 #if defined(__GNUC__)
 typedef long long int64;
 typedef unsigned long long uint64;
+#ifndef _WIN32
+#define __declspec(x)
+#endif
 #elif defined(__TINYC__)
 #include <stdarg.h>
 #define __builtin_va_list va_list
@@ -25,6 +29,7 @@ typedef unsigned __int64 uint64;
 #define __ENDIAN_PAD(x) 0
 #endif
 #include <stdint.h>
+#include <sys/types.h>
 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
 
 extern void *  __ecereNameSpace__ecere__com__eSystem_New0(unsigned int size);
@@ -91,9 +96,9 @@ struct __ecereNameSpace__ecere__com__Class * _class;
 char *  dataTypeString;
 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
 struct Type * dataType;
-void (*  Set)();
-int (*  Get)();
-unsigned int (*  IsSet)();
+void (*  Set)(void * , int);
+int (*  Get)(void * );
+unsigned int (*  IsSet)(void * );
 void *  data;
 void *  symbol;
 int vid;
@@ -112,7 +117,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;
@@ -432,7 +437,7 @@ struct TypeName * typeName;
 } __attribute__ ((gcc_struct));
 unsigned int debugValue;
 struct __ecereNameSpace__ecere__com__DataValue val;
-unsigned int address;
+uint64 address;
 unsigned int hasAddress;
 struct Type * expType;
 struct Type * destType;
@@ -483,6 +488,7 @@ struct __ecereNameSpace__ecere__sys__OldList *  baseSpecs;
 struct __ecereNameSpace__ecere__sys__OldList *  definitions;
 unsigned int addNameSpace;
 struct Context * ctx;
+struct ExtDecl * extDeclStruct;
 } __attribute__ ((gcc_struct));
 struct Expression * expression;
 struct Specifier * _class;
@@ -617,25 +623,28 @@ struct Symbol * enumClass;
 struct Type * type;
 struct TemplateParameter * templateParameter;
 } __attribute__ ((gcc_struct));
-unsigned int isSigned;
 int kind;
-unsigned int constant;
 unsigned int size;
 char *  name;
 char *  typeName;
-unsigned int count;
-unsigned int truth;
 int classObjectType;
-unsigned int byReference;
-unsigned int extraParam;
 int alignment;
-unsigned int directClassAccess;
-unsigned int computing;
-unsigned int dllExport;
 unsigned int offset;
-unsigned int keepCast;
-unsigned int passAsTemplate;
 int bitFieldCount;
+int count;
+unsigned int isSigned : 1;
+unsigned int constant : 1;
+unsigned int truth : 1;
+unsigned int byReference : 1;
+unsigned int extraParam : 1;
+unsigned int directClassAccess : 1;
+unsigned int computing : 1;
+unsigned int keepCast : 1;
+unsigned int passAsTemplate : 1;
+unsigned int dllExport : 1;
+unsigned int attrStdcall : 1;
+unsigned int declaredWithStruct : 1;
+unsigned int typedByReference : 1;
 } __attribute__ ((gcc_struct));
 
 extern struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Class;
@@ -694,8 +703,12 @@ 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 struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__Instance;
 
 struct __ecereNameSpace__ecere__com__Instance
@@ -1063,6 +1076,8 @@ struct Declaration * CopyDeclaration(struct Declaration * decl);
 
 extern struct Statement * MkExpressionStmt(struct __ecereNameSpace__ecere__sys__OldList * expressions);
 
+extern struct Statement * MkBadDeclStmt(struct Declaration * decl);
+
 extern void *  __ecereNameSpace__ecere__com__eInstance_New(struct __ecereNameSpace__ecere__com__Class * _class);
 
 static struct Statement * CopyStatement(struct Statement * stmt)
@@ -1080,6 +1095,9 @@ break;
 case 3:
 result = MkExpressionStmt(CopyList(stmt->expressions, CopyExpression));
 break;
+case 14:
+result = MkBadDeclStmt(CopyDeclaration(stmt->decl));
+break;
 }
 }
 if(result)
@@ -1166,18 +1184,16 @@ extern struct Specifier * MkEnum(struct Identifier * id, struct __ecereNameSpace
 
 extern struct Specifier * MkStructOrUnion(int type, struct Identifier * id, struct __ecereNameSpace__ecere__sys__OldList * definitions);
 
+struct ExtDecl * CopyExtDecl(struct ExtDecl * extDecl);
+
 extern char *  __ecereNameSpace__ecere__sys__CopyString(char *  string);
 
 extern struct Specifier * MkSpecifierSubClass(struct Specifier * _class);
 
 extern struct Specifier * MkSpecifierExtended(struct ExtDecl * extDecl);
 
-struct ExtDecl * CopyExtDecl(struct ExtDecl * extDecl);
-
 struct Specifier * CopySpecifier(struct Specifier * spec)
 {
-void * __ecereTemp1;
-
 if(spec)
 switch(spec->type)
 {
@@ -1202,6 +1218,7 @@ case 4:
 struct Identifier * id = CopyIdentifier(spec->id);
 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
 struct ClassDef * def;
+struct Specifier * s;
 
 if(spec->definitions)
 {
@@ -1212,7 +1229,9 @@ for(def = (*spec->list).first; def; def = def->next)
 ListAdd(list, CopyClassDef(def));
 }
 }
-return MkStructOrUnion(spec->type, id, list);
+s = MkStructOrUnion(spec->type, id, list);
+s->extDeclStruct = CopyExtDecl(spec->extDeclStruct);
+return s;
 }
 case 1:
 {
@@ -1223,7 +1242,11 @@ return copy;
 case 7:
 return MkSpecifierSubClass(CopySpecifier(spec->_class));
 case 8:
-return (__ecereTemp1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Specifier), ((struct Specifier *)__ecereTemp1)->loc = spec->loc, ((struct Specifier *)__ecereTemp1)->type = 8, ((struct Specifier *)__ecereTemp1)->templateParameter = spec->templateParameter, ((struct Specifier *)__ecereTemp1));
+return __extension__ ({
+struct Specifier * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Specifier);
+
+__ecereInstance1->loc = spec->loc, __ecereInstance1->type = 8, __ecereInstance1->templateParameter = spec->templateParameter, __ecereInstance1;
+});
 case 5:
 return MkSpecifierExtended(CopyExtDecl(spec->extDecl));
 }
@@ -1450,7 +1473,7 @@ __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyAttrib", "Attrib Cop
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyDeclarator", "Declarator CopyDeclarator(Declarator declarator)", CopyDeclarator, module, 2);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyInitDeclarator", "InitDeclarator CopyInitDeclarator(InitDeclarator initDecl)", CopyInitDeclarator, module, 2);
 __ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyDeclaration", "Declaration CopyDeclaration(Declaration decl)", CopyDeclaration, module, 2);
-__ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyList", "ecere::sys::OldList * CopyList(ecere::sys::OldList * source, void *( *)(void *))", CopyList, module, 2);
+__ecereNameSpace__ecere__com__eSystem_RegisterFunction("CopyList", "ecere::sys::OldList * CopyList(ecere::sys::OldList * source, void * (* CopyFunction)(void *))", CopyList, module, 2);
 }
 
 void __ecereUnregisterModule_copy(struct __ecereNameSpace__ecere__com__Instance * module)