diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2006-02-15 23:00:07 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2006-02-15 23:00:07 +0000 |
commit | 6f8cdb5c03473be8ebced54acf4303ed782cd010 (patch) | |
tree | 4e58b3d22cb9f68099d45ec69a30dd212a857c71 /include | |
parent | a0d438fb6c361fee8463fb8426889bf0493eb001 (diff) |
Define the initial values separate from the STATIC definitions
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@10255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/linkedlists.h | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/include/asterisk/linkedlists.h b/include/asterisk/linkedlists.h index 4f60366d5..6cd1f50fe 100644 --- a/include/asterisk/linkedlists.h +++ b/include/asterisk/linkedlists.h @@ -101,6 +101,23 @@ struct name { \ } /*! + \brief Defines initial values for a declaration of AST_LIST_HEAD +*/ +#define AST_LIST_HEAD_INIT_VALUE { \ + .first = NULL, \ + .last = NULL, \ + .lock = AST_MUTEX_INIT_VALUE, \ + } + +/*! + \brief Defines initial values for a declaration of AST_LIST_HEAD_NOLOCK +*/ +#define AST_LIST_HEAD_NOLOCK_INIT_VALUE { \ + .first = NULL, \ + .last = NULL, \ + } + +/*! \brief Defines a structure to be used to hold a list of specified type, statically initialized. \param name This will be the name of the defined structure. \param type This is the type of each list entry. @@ -122,11 +139,7 @@ struct name { \ struct type *first; \ struct type *last; \ ast_mutex_t lock; \ -} name = { \ - .first = NULL, \ - .last = NULL, \ - .lock = AST_MUTEX_INIT_VALUE, \ -}; +} name = AST_LIST_HEAD_INIT_VALUE; /*! \brief Defines a structure to be used to hold a list of specified type, statically initialized. @@ -137,10 +150,7 @@ struct name { \ struct name { \ struct type *first; \ struct type *last; \ -} name = { \ - .first = NULL, \ - .last = NULL, \ -}; +} name = AST_LIST_HEAD_NOLOCK_INIT_VALUE; /*! \brief Initializes a list head structure with a specified first entry. |