[asterisk-commits] russell: branch group/asterisk-cpp r168377 - /team/group/asterisk-cpp/include...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 9 22:59:29 CST 2009


Author: russell
Date: Fri Jan  9 22:59:28 2009
New Revision: 168377

URL: http://svn.digium.com/view/asterisk?view=rev&rev=168377
Log:
Fix the list def, and add AST_LIST_FIRST()

Modified:
    team/group/asterisk-cpp/include/asterisk/linkedlists_compat.hpp

Modified: team/group/asterisk-cpp/include/asterisk/linkedlists_compat.hpp
URL: http://svn.digium.com/view/asterisk/team/group/asterisk-cpp/include/asterisk/linkedlists_compat.hpp?view=diff&rev=168377&r1=168376&r2=168377
==============================================================================
--- team/group/asterisk-cpp/include/asterisk/linkedlists_compat.hpp (original)
+++ team/group/asterisk-cpp/include/asterisk/linkedlists_compat.hpp Fri Jan  9 22:59:28 2009
@@ -42,7 +42,7 @@
 	} \
 	\
 	ast_rwlock_t rwlock; \
-	std::list<type> _list; \
+	std::list<type *> _list; \
 } name
 
 #define AST_LIST_HEAD_STATIC(name, type) \
@@ -52,12 +52,12 @@
 	} \
 	\
 	ast_mutex_t lock; \
-	std::list<type> _list; \
+	std::list<type *> _list; \
 } name
 
 #define AST_LIST_HEAD_NOLOCK(name, type) \
 struct name { \
-	std::list<type> stuff; \
+	std::list<type *> stuff; \
 }
 
 #define AST_RWLIST_WRLOCK(list) \
@@ -75,18 +75,19 @@
 #define AST_LIST_UNLOCK(list) \
 	ast_mutex_unlock(&(list)->lock)
 
+#define AST_LIST_FIRST(list) (list)->_list.front()
+#define AST_RWLIST_FIRST(list) AST_LIST_FIRST(list)
+
 /* XXX */
 #define AST_RWLIST_TRAVERSE_SAFE_BEGIN(a, b, c) while (0)
 #define AST_RWLIST_TRAVERSE_SAFE_END
 #define AST_RWLIST_TRAVERSE(a, b, c) while (0)
 #define AST_RWLIST_REMOVE_CURRENT(a)
 #define AST_RWLIST_INSERT_TAIL(a, b, c)
-#define AST_RWLIST_FIRST(a) NULL
 #define AST_LIST_TRAVERSE_SAFE_BEGIN(a, b, c) while (0)
 #define AST_LIST_TRAVERSE_SAFE_END
 #define AST_LIST_TRAVERSE(a, b, c) while (0)
 #define AST_LIST_REMOVE_CURRENT(a)
 #define AST_LIST_INSERT_TAIL(a, b, c)
-#define AST_LIST_FIRST(a) NULL
 
 #endif /* __AST_LINKEDLISTS_COMPAT_HPP__ */




More information about the asterisk-commits mailing list