4 * Copyright (c) Tuomo Valkonen 2005.
6 * You may distribute and modify this library under the terms of either
7 * the Clarified Artistic License or the GNU LGPL, version 2.1 or later.
10 #ifndef LIBTU_POINTER_H
11 #define LIBTU_POINTER_H
13 #define FIELD_OFFSET(T, F) ((long)((char*)&((T*)0)->F))
14 #define FIELD_TO_STRUCT(T, F, A) ((T*)(((char*)A)-FIELD_OFFSET(T, F)))
16 #endif /* LIBTU_POINTER_H */