media/libnestegg/src/macros.h
author Joey Armstrong <joey@mozilla.com>
Fri, 06 Apr 2012 14:07:46 -0400
changeset 91537 b23771ca17fd1362243886e1beeab45ce5dc87e5
parent 43338 b391708e95527fd56770a343036d46669220df40
child 154860 28f89a6c0b7b99caf15763d0c1d9415b90e8c549
permissions -rw-r--r--
Bug 741839 - Consolidate wildcard calls in client.mk. r=ted

/*
 *	Copyright (c) 2004-2010 Alex Pankratov. All rights reserved.
 *
 *	Hierarchical memory allocator, 1.2.1
 *	http://swapped.cc/halloc
 */

/*
 *	The program is distributed under terms of BSD license. 
 *	You can obtain the copy of the license by visiting:
 *	
 *	http://www.opensource.org/licenses/bsd-license.php
 */

#ifndef _LIBP_MACROS_H_
#define _LIBP_MACROS_H_

#include <stddef.h>  /* offsetof */

/*
 	restore pointer to the structure by a pointer to its field
 */
#define structof(p,t,f) ((t*)(- offsetof(t,f) + (char*)(p)))

/*
 *	redefine for the target compiler
 */
#ifdef _WIN32
#define static_inline static __inline
#else
#define static_inline static __inline__
#endif


#endif