Don't use a forward declaration to declare pointers to BASE_OBJECT as that somehow goes wrong (I'm guessing related to WZ_DECL_MAY_ALIAS), instead #include basedef.h in baseobject.h

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5882 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2008-08-28 19:26:06 +00:00
parent a06bb014df
commit 99605c5982
3 changed files with 7 additions and 7 deletions

View File

@ -25,7 +25,6 @@
#define __INCLUDED_BASEDEF_H__ #define __INCLUDED_BASEDEF_H__
#include "lib/ivis_common/pievector.h" #include "lib/ivis_common/pievector.h"
#include "baseobject.h"
#include "displaydef.h" #include "displaydef.h"
#include "statsdef.h" #include "statsdef.h"
@ -105,4 +104,7 @@ static inline bool isDead(const BASE_OBJECT* psObj)
return (psObj->died > NOT_CURRENT_LIST); return (psObj->died > NOT_CURRENT_LIST);
} }
// Must be #included __AFTER__ the definition of BASE_OBJECT
#include "baseobject.h"
#endif // __INCLUDED_BASEDEF_H__ #endif // __INCLUDED_BASEDEF_H__

View File

@ -21,12 +21,11 @@
#include "lib/framework/frame.h" #include "lib/framework/frame.h"
#include "lib/framework/debug.h" #include "lib/framework/debug.h"
#include "baseobject.h" #include "baseobject.h"
#include "basedef.h"
#include "droid.h" #include "droid.h"
#include "projectile.h" #include "projectile.h"
#include "structure.h" #include "structure.h"
void checkObject(const struct BASE_OBJECT* psObject, const char * const location_description, const char * function, const int recurse) void checkObject(const BASE_OBJECT* psObject, const char * const location_description, const char * function, const int recurse)
{ {
if (recurse < 0) if (recurse < 0)
return; return;

View File

@ -24,12 +24,11 @@
#ifndef __INCLUDED_BASEOBJECT_H__ #ifndef __INCLUDED_BASEOBJECT_H__
#define __INCLUDED_BASEOBJECT_H__ #define __INCLUDED_BASEOBJECT_H__
#include "basedef.h"
static const unsigned int max_check_object_recursion = 4; static const unsigned int max_check_object_recursion = 4;
// Forward declaration to allow pointers to this type void checkObject(const BASE_OBJECT* psObject, const char * const location_description, const char * function, const int recurse);
struct BASE_OBJECT;
void checkObject(const struct BASE_OBJECT* psObject, const char * const location_description, const char * function, const int recurse);
/* assert if object is bad */ /* assert if object is bad */
#define CHECK_OBJECT(object) checkObject((object), AT_MACRO, __FUNCTION__, max_check_object_recursion) #define CHECK_OBJECT(object) checkObject((object), AT_MACRO, __FUNCTION__, max_check_object_recursion)