Commit 9b4e92a6 authored by Amine Khaldi's avatar Amine Khaldi Committed by Alexandre Julliard

include: Define LIST_ENTRY using the standard offsetof.

parent d6617e1e
......@@ -21,6 +21,8 @@
#ifndef __WINE_SERVER_LIST_H
#define __WINE_SERVER_LIST_H
#include <stddef.h>
struct list
{
struct list *next;
......@@ -227,6 +229,6 @@ static inline void list_move_head( struct list *dst, struct list *src )
/* get pointer to object containing list element */
#undef LIST_ENTRY
#define LIST_ENTRY(elem, type, field) \
((type *)((char *)(elem) - (size_t)(&((type *)0)->field)))
((type *)((char *)(elem) - offsetof(type, field)))
#endif /* __WINE_SERVER_LIST_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment