[ros-diffs] [hyperion] 41565: Change <wine/list.h> to use the magic attribute salad for inline functions in headers

hyperion at svn.reactos.org hyperion at svn.reactos.org
Mon Jun 22 22:29:49 CEST 2009


Author: hyperion
Date: Tue Jun 23 00:29:48 2009
New Revision: 41565

URL: http://svn.reactos.org/svn/reactos?rev=41565&view=rev
Log:
Change <wine/list.h> to use the magic attribute salad for inline functions in headers

Modified:
    trunk/reactos/include/reactos/wine/list.h

Modified: trunk/reactos/include/reactos/wine/list.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/list.h?rev=41565&r1=41564&r2=41565&view=diff
==============================================================================
--- trunk/reactos/include/reactos/wine/list.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/wine/list.h [iso-8859-1] Tue Jun 23 00:29:48 2009
@@ -20,6 +20,18 @@
 
 #ifndef __WINE_SERVER_LIST_H
 #define __WINE_SERVER_LIST_H
+
+#ifdef __cplusplus
+#define __WINE_SERVER_LIST_INLINE inline
+#else
+#if defined(__GNUC__)
+#define __WINE_SERVER_LIST_INLINE extern __inline__ __attribute__((__always_inline__,__gnu_inline__))
+#elif defined(_MSC_VER)
+#define __WINE_SERVER_LIST_INLINE __inline
+#else
+#define __WINE_SERVER_LIST_INLINE static
+#endif
+#endif
 
 struct list
 {
@@ -63,7 +75,7 @@
  */
 
 /* add an element after the specified one */
-static inline void list_add_after( struct list *elem, struct list *to_add )
+__WINE_SERVER_LIST_INLINE void list_add_after( struct list *elem, struct list *to_add )
 {
     to_add->next = elem->next;
     to_add->prev = elem;
@@ -72,7 +84,7 @@
 }
 
 /* add an element before the specified one */
-static inline void list_add_before( struct list *elem, struct list *to_add )
+__WINE_SERVER_LIST_INLINE void list_add_before( struct list *elem, struct list *to_add )
 {
     to_add->next = elem;
     to_add->prev = elem->prev;
@@ -81,26 +93,26 @@
 }
 
 /* add element at the head of the list */
-static inline void list_add_head( struct list *list, struct list *elem )
+__WINE_SERVER_LIST_INLINE void list_add_head( struct list *list, struct list *elem )
 {
     list_add_after( list, elem );
 }
 
 /* add element at the tail of the list */
-static inline void list_add_tail( struct list *list, struct list *elem )
+__WINE_SERVER_LIST_INLINE void list_add_tail( struct list *list, struct list *elem )
 {
     list_add_before( list, elem );
 }
 
 /* remove an element from its list */
-static inline void list_remove( struct list *elem )
+__WINE_SERVER_LIST_INLINE void list_remove( struct list *elem )
 {
     elem->next->prev = elem->prev;
     elem->prev->next = elem->next;
 }
 
 /* get the next element */
-static inline struct list *list_next( const struct list *list, const struct list *elem )
+__WINE_SERVER_LIST_INLINE struct list *list_next( const struct list *list, const struct list *elem )
 {
     struct list *ret = elem->next;
     if (elem->next == list) ret = NULL;
@@ -108,7 +120,7 @@
 }
 
 /* get the previous element */
-static inline struct list *list_prev( const struct list *list, const struct list *elem )
+__WINE_SERVER_LIST_INLINE struct list *list_prev( const struct list *list, const struct list *elem )
 {
     struct list *ret = elem->prev;
     if (elem->prev == list) ret = NULL;
@@ -116,31 +128,31 @@
 }
 
 /* get the first element */
-static inline struct list *list_head( const struct list *list )
+__WINE_SERVER_LIST_INLINE struct list *list_head( const struct list *list )
 {
     return list_next( list, list );
 }
 
 /* get the last element */
-static inline struct list *list_tail( const struct list *list )
+__WINE_SERVER_LIST_INLINE struct list *list_tail( const struct list *list )
 {
     return list_prev( list, list );
 }
 
 /* check if a list is empty */
-static inline int list_empty( const struct list *list )
+__WINE_SERVER_LIST_INLINE int list_empty( const struct list *list )
 {
     return list->next == list;
 }
 
 /* initialize a list */
-static inline void list_init( struct list *list )
+__WINE_SERVER_LIST_INLINE void list_init( struct list *list )
 {
     list->next = list->prev = list;
 }
 
 /* count the elements of a list */
-static inline unsigned int list_count( const struct list *list )
+__WINE_SERVER_LIST_INLINE unsigned int list_count( const struct list *list )
 {
     unsigned count = 0;
     const struct list *ptr;
@@ -149,7 +161,7 @@
 }
 
 /* move all elements from src to the tail of dst */
-static inline void list_move_tail( struct list *dst, struct list *src )
+__WINE_SERVER_LIST_INLINE void list_move_tail( struct list *dst, struct list *src )
 {
     if (list_empty(src)) return;
 
@@ -161,7 +173,7 @@
 }
 
 /* move all elements from src to the head of dst */
-static inline void list_move_head( struct list *dst, struct list *src )
+__WINE_SERVER_LIST_INLINE void list_move_head( struct list *dst, struct list *src )
 {
     if (list_empty(src)) return;
 



More information about the Ros-diffs mailing list