Ignore:
Timestamp:
Jan 10, 2009, 2:22:13 AM (13 years ago)
Author:
charles
Message:

(trunk libT) win32 portability fixes, reported by Alexey

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/list.h

    r7469 r7652  
    6464};
    6565
    66 #define __tr_list_entry(ptr, type, member) ({            \
    67     const struct __tr_list *__mptr = (ptr);              \
    68     (void *)( (char *)__mptr - offsetof(type,member) );  \
    69 })
     66/**
     67 * Given a __tr_list node that's embedded in a struct, returns a pointer to the struct.
     68 * @param ptr     pointer to the embedded __tr_list
     69 * @param type    struct type that has contains the __tr_list
     70 * @param field   the name of the struct's _tr_list field
     71 */
     72#define __tr_list_entry(ptr,type,field) ((type*) (((char*)ptr) - offsetof(type,field)))
    7073
    7174typedef int  ( *__tr_list_cmp_t ) ( const void * a, const void * b );
Note: See TracChangeset for help on using the changeset viewer.