pointer.h

Thu, 06 Feb 2014 14:16:13 +0000

author
tuomov
date
Thu, 06 Feb 2014 14:16:13 +0000
changeset 117
c7ad4b23a277
parent 89
17a16ed84bbf
permissions
-rw-r--r--

locale.h name seems to conflict with system locale.h name on some systems

/*
 * libtu/pointer.h
 *
 * Copyright (c) Tuomo Valkonen 2005. 
 *
 * You may distribute and modify this library under the terms of either
 * the Clarified Artistic License or the GNU LGPL, version 2.1 or later.
 */

#ifndef LIBTU_POINTER_H
#define LIBTU_POINTER_H

#define FIELD_OFFSET(T, F) ((long)((char*)&((T*)0)->F))
#define FIELD_TO_STRUCT(T, F, A) ((T*)(((char*)A)-FIELD_OFFSET(T, F)))

#endif /* LIBTU_POINTER_H */

mercurial