]> git.decadent.org.uk Git - ion3.git/blob - libtu/pointer.h
[svn-inject] Installing original source of ion3
[ion3.git] / libtu / pointer.h
1 /*
2  * libtu/pointer.h
3  *
4  * Copyright (c) Tuomo Valkonen 2005. 
5  *
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.
8  */
9
10 #ifndef LIBTU_POINTER_H
11 #define LIBTU_POINTER_H
12
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)))
15
16 #endif /* LIBTU_POINTER_H */