diff --git a/include/asterisk.h b/include/asterisk.h index d4b2f03917..da70e8a8c4 100644 --- a/include/asterisk.h +++ b/include/asterisk.h @@ -68,12 +68,6 @@ void ast_event_init(void); /*!< Provided by event.c */ int ast_device_state_engine_init(void); /*!< Provided by devicestate.c */ int astobj2_init(void); /*! Provided by astobj2.c */ -/* Many headers need 'ast_channel' to be defined */ -struct ast_channel; - -/* Many headers need 'ast_module' to be defined */ -struct ast_module; - /*! * \brief Reload asterisk modules. * \param name the name of the module to reload diff --git a/include/asterisk/abstract_jb.h b/include/asterisk/abstract_jb.h index 1bd9dc84dd..4a41c8c2ca 100644 --- a/include/asterisk/abstract_jb.h +++ b/include/asterisk/abstract_jb.h @@ -36,7 +36,6 @@ extern "C" { #endif -struct ast_channel; struct ast_frame; /* Configuration flags */ diff --git a/include/asterisk/compat.h b/include/asterisk/compat.h index d918cd7075..19ae6e9b14 100644 --- a/include/asterisk/compat.h +++ b/include/asterisk/compat.h @@ -176,4 +176,14 @@ typedef unsigned int u_int32_t; typedef unsigned long long uint64_t; #endif +/*! \brief + * Definition of various structures that many asterisk files need, + * but only because they need to know that the type exists. + * + * We can move them to a different global header if necessary. + */ +struct ast_channel; +struct ast_frame; +struct ast_module; + #endif diff --git a/include/asterisk/lock.h b/include/asterisk/lock.h index 16ce5bb675..055ec84c82 100644 --- a/include/asterisk/lock.h +++ b/include/asterisk/lock.h @@ -1185,8 +1185,6 @@ AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p), #define ast_channel_trylock(x) ast_mutex_trylock(&x->lock_dont_use) #else -struct ast_channel; - /*! \brief Lock AST channel (and print debugging output) \note You need to enable DEBUG_CHANNEL_LOCKS for this function */ int ast_channel_lock(struct ast_channel *chan); diff --git a/utils/extconf.c b/utils/extconf.c index 0e40718334..caed904780 100644 --- a/utils/extconf.c +++ b/utils/extconf.c @@ -1835,8 +1835,6 @@ AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p), #define ast_channel_trylock(x) ast_mutex_trylock(&x->lock) #else -struct ast_channel; - /*! \brief Lock AST channel (and print debugging output) \note You need to enable DEBUG_CHANNEL_LOCKS for this function */ int ast_channel_lock(struct ast_channel *chan);