https://bitbucket.org/hudson/magic-lantern
Raw File
Tip revision: 6842f6f9623369c10c831c9cec2c50bc52dedf00 authored by hudson@kremvax on 24 June 2009, 02:55:55 UTC
Removed tag
Tip revision: 6842f6f
compiler.h
#ifndef _compiler_h_
#define _compiler_h_

/** \file
 * gcc specific hacks and defines.
 *
 * Both host and ARM.
 */

/** Compile time failure if a structure is not sized correctly */
#define SIZE_CHECK_STRUCT( struct_name, size ) \
	static uint8_t __attribute__((unused)) \
	__size_check_##struct_name[ \
		sizeof( struct struct_name ) == size ? 0 : -1 \
	]

/** Force a variable to live in the text segment */
#define TEXT __attribute__((section(".text")))

/** Flag an argument as unused */
#define UNUSED(x) __attribute__((unused)) x


#endif
back to top