Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
1 /*
2 * Copyright (c) 2004-2010 Alex Pankratov. All rights reserved.
3 *
4 * Hierarchical memory allocator, 1.2.1
5 * http://swapped.cc/halloc
6 */
8 /*
9 * The program is distributed under terms of BSD license.
10 * You can obtain the copy of the license by visiting:
11 *
12 * http://www.opensource.org/licenses/bsd-license.php
13 */
15 #ifndef _LIBP_MACROS_H_
16 #define _LIBP_MACROS_H_
18 #include <stddef.h> /* offsetof */
20 /*
21 restore pointer to the structure by a pointer to its field
22 */
23 #define structof(p,t,f) ((t*)(- (ptrdiff_t) offsetof(t,f) + (char*)(p)))
25 /*
26 * redefine for the target compiler
27 */
28 #ifdef _WIN32
29 #define static_inline static __inline
30 #else
31 #define static_inline static __inline__
32 #endif
35 #endif