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-861f7616d084master
parent
a06bb014df
commit
99605c5982
|
@ -25,7 +25,6 @@
|
|||
#define __INCLUDED_BASEDEF_H__
|
||||
|
||||
#include "lib/ivis_common/pievector.h"
|
||||
#include "baseobject.h"
|
||||
#include "displaydef.h"
|
||||
#include "statsdef.h"
|
||||
|
||||
|
@ -105,4 +104,7 @@ static inline bool isDead(const BASE_OBJECT* psObj)
|
|||
return (psObj->died > NOT_CURRENT_LIST);
|
||||
}
|
||||
|
||||
// Must be #included __AFTER__ the definition of BASE_OBJECT
|
||||
#include "baseobject.h"
|
||||
|
||||
#endif // __INCLUDED_BASEDEF_H__
|
||||
|
|
|
@ -21,12 +21,11 @@
|
|||
#include "lib/framework/frame.h"
|
||||
#include "lib/framework/debug.h"
|
||||
#include "baseobject.h"
|
||||
#include "basedef.h"
|
||||
#include "droid.h"
|
||||
#include "projectile.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)
|
||||
return;
|
||||
|
|
|
@ -24,12 +24,11 @@
|
|||
#ifndef __INCLUDED_BASEOBJECT_H__
|
||||
#define __INCLUDED_BASEOBJECT_H__
|
||||
|
||||
#include "basedef.h"
|
||||
|
||||
static const unsigned int max_check_object_recursion = 4;
|
||||
|
||||
// Forward declaration to allow pointers to this type
|
||||
struct BASE_OBJECT;
|
||||
|
||||
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);
|
||||
|
||||
/* assert if object is bad */
|
||||
#define CHECK_OBJECT(object) checkObject((object), AT_MACRO, __FUNCTION__, max_check_object_recursion)
|
||||
|
|
Loading…
Reference in New Issue