diff --git a/src/basedef.h b/src/basedef.h index 001a21120..0b6a46260 100644 --- a/src/basedef.h +++ b/src/basedef.h @@ -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__ diff --git a/src/baseobject.c b/src/baseobject.c index 97626eefb..f4a1bcabf 100644 --- a/src/baseobject.c +++ b/src/baseobject.c @@ -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; diff --git a/src/baseobject.h b/src/baseobject.h index 72678f5d8..de7922f12 100644 --- a/src/baseobject.h +++ b/src/baseobject.h @@ -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)