compiler/libec: Forward declaring empty class:struct
[sdk] / compiler / bootstrap / ecere / bootstrap / Map.c
index 5e6edf7..707764d 100644 (file)
@@ -35,6 +35,18 @@ typedef unsigned __int64 uint64;
 #else
 #define __ENDIAN_PAD(x) 0
 #endif
+#if defined(_WIN32)
+#   if defined(__GNUC__) || defined(__TINYC__)
+#      define ecere_stdcall __attribute__((__stdcall__))
+#      define ecere_gcc_struct __attribute__((gcc_struct))
+#   else
+#      define ecere_stdcall __stdcall
+#      define ecere_gcc_struct
+#   endif
+#else
+#   define ecere_stdcall
+#   define ecere_gcc_struct
+#endif
 #include <stdint.h>
 #include <sys/types.h>
 extern int __ecereVMethodID_class_OnCopy;
@@ -64,7 +76,7 @@ void *  last;
 int count;
 unsigned int offset;
 unsigned int circ;
-} __attribute__ ((gcc_struct));
+} ecere_gcc_struct;
 
 struct __ecereNameSpace__ecere__com__DataValue
 {
@@ -81,8 +93,8 @@ float f;
 double d;
 long long i64;
 uint64 ui64;
-} __attribute__ ((gcc_struct)) __anon1;
-} __attribute__ ((gcc_struct));
+} ecere_gcc_struct __anon1;
+} ecere_gcc_struct;
 
 struct __ecereNameSpace__ecere__com__IteratorPointer;
 
@@ -92,7 +104,7 @@ unsigned char *  _buffer;
 unsigned int count;
 unsigned int _size;
 unsigned int pos;
-} __attribute__ ((gcc_struct));
+} ecere_gcc_struct;
 
 extern void *  __ecereNameSpace__ecere__com__eSystem_New(unsigned int size);
 
@@ -104,42 +116,22 @@ extern void *  __ecereNameSpace__ecere__com__eSystem_Renew0(void *  memory, unsi
 
 extern void __ecereNameSpace__ecere__com__eSystem_Delete(void *  memory);
 
+struct __ecereNameSpace__ecere__com__MapNode;
+
+struct __ecereNameSpace__ecere__com__MapNode;
+
 extern void *  memcpy(void * , const void * , size_t size);
 
 struct __ecereNameSpace__ecere__com__CustomAVLTree
 {
 struct __ecereNameSpace__ecere__com__AVLNode * root;
 int count;
-} __attribute__ ((gcc_struct));
+} ecere_gcc_struct;
 
 struct __ecereNameSpace__ecere__com__ClassTemplateParameter;
 
 int __ecereVMethodID_class_OnFree;
 
-struct __ecereNameSpace__ecere__com__Property;
-
-extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
-
-static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__MapNode_key, * __ecerePropM___ecereNameSpace__ecere__com__MapNode_key;
-
-static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__MapNode_value, * __ecerePropM___ecereNameSpace__ecere__com__MapNode_value;
-
-static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__MapNode_prev, * __ecerePropM___ecereNameSpace__ecere__com__MapNode_prev;
-
-static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__MapNode_next, * __ecerePropM___ecereNameSpace__ecere__com__MapNode_next;
-
-static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__MapNode_minimum, * __ecerePropM___ecereNameSpace__ecere__com__MapNode_minimum;
-
-static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__MapNode_maximum, * __ecerePropM___ecereNameSpace__ecere__com__MapNode_maximum;
-
-static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__MapIterator_map, * __ecerePropM___ecereNameSpace__ecere__com__MapIterator_map;
-
-static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__MapIterator_key, * __ecerePropM___ecereNameSpace__ecere__com__MapIterator_key;
-
-static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__MapIterator_value, * __ecerePropM___ecereNameSpace__ecere__com__MapIterator_value;
-
-static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__Map_mapSrc, * __ecerePropM___ecereNameSpace__ecere__com__Map_mapSrc;
-
 struct __ecereNameSpace__ecere__com__MapNode
 {
 struct __ecereNameSpace__ecere__com__MapNode * parent;
@@ -148,9 +140,7 @@ struct __ecereNameSpace__ecere__com__MapNode * right;
 int depth;
 uint64 key;
 uint64 value;
-} __attribute__ ((gcc_struct));
-
-struct __ecereNameSpace__ecere__com__Class;
+} ecere_gcc_struct;
 
 uint64 __ecereProp___ecereNameSpace__ecere__com__MapNode_Get_value(struct __ecereNameSpace__ecere__com__MapNode * this)
 {
@@ -170,12 +160,38 @@ uint64 __ecereProp___ecereNameSpace__ecere__com__MapNode_Get_value(struct __ecer
 
 void __ecereProp___ecereNameSpace__ecere__com__MapNode_Set_value(struct __ecereNameSpace__ecere__com__MapNode * this, uint64 value);
 
+struct __ecereNameSpace__ecere__com__Property;
+
+extern void __ecereNameSpace__ecere__com__eInstance_Watch(void *  instance, struct __ecereNameSpace__ecere__com__Property * _property, void *  object, void (*  callback)(void * , void * ));
+
+static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__MapNode_key, * __ecerePropM___ecereNameSpace__ecere__com__MapNode_key;
+
+static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__MapNode_value, * __ecerePropM___ecereNameSpace__ecere__com__MapNode_value;
+
+static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__MapNode_prev, * __ecerePropM___ecereNameSpace__ecere__com__MapNode_prev;
+
+static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__MapNode_next, * __ecerePropM___ecereNameSpace__ecere__com__MapNode_next;
+
+static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__MapNode_minimum, * __ecerePropM___ecereNameSpace__ecere__com__MapNode_minimum;
+
+static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__MapNode_maximum, * __ecerePropM___ecereNameSpace__ecere__com__MapNode_maximum;
+
+static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__MapIterator_map, * __ecerePropM___ecereNameSpace__ecere__com__MapIterator_map;
+
+static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__MapIterator_key, * __ecerePropM___ecereNameSpace__ecere__com__MapIterator_key;
+
+static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__MapIterator_value, * __ecerePropM___ecereNameSpace__ecere__com__MapIterator_value;
+
+static __attribute__((unused)) struct __ecereNameSpace__ecere__com__Property * __ecereProp___ecereNameSpace__ecere__com__Map_mapSrc, * __ecerePropM___ecereNameSpace__ecere__com__Map_mapSrc;
+
+struct __ecereNameSpace__ecere__com__Class;
+
 struct __ecereNameSpace__ecere__com__Instance
 {
 void * *  _vTbl;
 struct __ecereNameSpace__ecere__com__Class * _class;
 int _refCount;
-} __attribute__ ((gcc_struct));
+} ecere_gcc_struct;
 
 extern long long __ecereNameSpace__ecere__com__eClass_GetProperty(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name);
 
@@ -193,7 +209,7 @@ struct __ecereNameSpace__ecere__com__MapIterator
 {
 struct __ecereNameSpace__ecere__com__Instance * container;
 struct __ecereNameSpace__ecere__com__IteratorPointer * pointer;
-} __attribute__ ((gcc_struct));
+} ecere_gcc_struct;
 
 struct __ecereNameSpace__ecere__com__Property
 {
@@ -219,7 +235,7 @@ const char *  category;
 unsigned int compiled;
 unsigned int selfWatchable;
 unsigned int isWatchable;
-} __attribute__ ((gcc_struct));
+} ecere_gcc_struct;
 
 extern void __ecereNameSpace__ecere__com__eInstance_FireSelfWatchers(struct __ecereNameSpace__ecere__com__Instance * instance, struct __ecereNameSpace__ecere__com__Property * _property);
 
@@ -235,7 +251,7 @@ struct __ecereNameSpace__ecere__com__Iterator
 {
 struct __ecereNameSpace__ecere__com__Instance * container;
 struct __ecereNameSpace__ecere__com__IteratorPointer * pointer;
-} __attribute__ ((gcc_struct));
+} ecere_gcc_struct;
 
 void __ecereProp___ecereNameSpace__ecere__com__Map_Set_mapSrc(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Instance * value);
 
@@ -284,7 +300,7 @@ struct __ecereNameSpace__ecere__com__AVLNode * left;
 struct __ecereNameSpace__ecere__com__AVLNode * right;
 int depth;
 uint64 key;
-} __attribute__ ((gcc_struct));
+} ecere_gcc_struct;
 
 const uint64 __ecereProp___ecereNameSpace__ecere__com__MapNode_Get_key(struct __ecereNameSpace__ecere__com__MapNode * this)
 {
@@ -334,7 +350,7 @@ struct __ecereNameSpace__ecere__sys__BTNode * root;
 int count;
 int (*  CompareKey)(struct __ecereNameSpace__ecere__sys__BinaryTree * tree, uintptr_t a, uintptr_t b);
 void (*  FreeKey)(void *  key);
-} __attribute__ ((gcc_struct));
+} ecere_gcc_struct;
 
 struct __ecereNameSpace__ecere__com__DataMember;
 
@@ -358,7 +374,7 @@ struct __ecereNameSpace__ecere__sys__BinaryTree membersAlpha;
 int memberOffset;
 short structAlignment;
 short pointerAlignment;
-} __attribute__ ((gcc_struct));
+} ecere_gcc_struct;
 
 extern struct __ecereNameSpace__ecere__com__DataMember * __ecereNameSpace__ecere__com__eClass_AddDataMember(struct __ecereNameSpace__ecere__com__Class * _class, const char *  name, const char *  type, unsigned int size, unsigned int alignment, int declMode);
 
@@ -372,7 +388,7 @@ struct
 {
 const char *  dataTypeString;
 struct __ecereNameSpace__ecere__com__Class * dataTypeClass;
-} __attribute__ ((gcc_struct)) __anon1;
+} ecere_gcc_struct __anon1;
 struct __ecereNameSpace__ecere__com__DataValue expression;
 struct
 {
@@ -382,10 +398,10 @@ union
 struct __ecereNameSpace__ecere__com__DataMember * member;
 struct __ecereNameSpace__ecere__com__Property * prop;
 struct __ecereNameSpace__ecere__com__Method * method;
-} __attribute__ ((gcc_struct)) __anon1;
-} __attribute__ ((gcc_struct)) __anon2;
-} __attribute__ ((gcc_struct)) __anon1;
-} __attribute__ ((gcc_struct));
+} ecere_gcc_struct __anon1;
+} ecere_gcc_struct __anon2;
+} ecere_gcc_struct __anon1;
+} ecere_gcc_struct;
 
 struct __ecereNameSpace__ecere__com__Method
 {
@@ -402,7 +418,7 @@ void *  symbol;
 const char *  dataTypeString;
 struct __ecereNameSpace__ecere__com__Instance * dataType;
 int memberAccess;
-} __attribute__ ((gcc_struct));
+} ecere_gcc_struct;
 
 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);
 
@@ -435,7 +451,7 @@ struct __ecereNameSpace__ecere__sys__BinaryTree nameSpaces;
 struct __ecereNameSpace__ecere__sys__BinaryTree classes;
 struct __ecereNameSpace__ecere__sys__BinaryTree defines;
 struct __ecereNameSpace__ecere__sys__BinaryTree functions;
-} __attribute__ ((gcc_struct));
+} ecere_gcc_struct;
 
 struct __ecereNameSpace__ecere__com__Class
 {
@@ -494,7 +510,7 @@ struct __ecereNameSpace__ecere__sys__OldList templatized;
 int numParams;
 unsigned int isInstanceClass;
 unsigned int byValueSystemClass;
-} __attribute__ ((gcc_struct));
+} ecere_gcc_struct;
 
 struct __ecereNameSpace__ecere__com__Application
 {
@@ -505,7 +521,7 @@ unsigned int isGUIApp;
 struct __ecereNameSpace__ecere__sys__OldList allModules;
 char *  parsedCommand;
 struct __ecereNameSpace__ecere__com__NameSpace systemNameSpace;
-} __attribute__ ((gcc_struct));
+} ecere_gcc_struct;
 
 static struct __ecereNameSpace__ecere__com__Class * __ecereClass___ecereNameSpace__ecere__com__MapNode;
 
@@ -549,7 +565,7 @@ int importType;
 int origImportType;
 struct __ecereNameSpace__ecere__com__NameSpace privateNameSpace;
 struct __ecereNameSpace__ecere__com__NameSpace publicNameSpace;
-} __attribute__ ((gcc_struct));
+} ecere_gcc_struct;
 
 uint64 __ecereProp___ecereNameSpace__ecere__com__MapIterator_Get_value(struct __ecereNameSpace__ecere__com__MapIterator * this)
 {