From c9f687e0c16a7f6ea6471f69b6be8cb2f0a3268d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 3 Jan 2014 07:58:01 +0100 Subject: move arch specific macros to separate header file --- arch.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 arch.h (limited to 'arch.h') diff --git a/arch.h b/arch.h new file mode 100644 index 0000000..17301ce --- /dev/null +++ b/arch.h @@ -0,0 +1,30 @@ +/* + * (C) 2013-2014 by Christian Hesse + * + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. + */ + +#ifndef _ARCH_H +#define _ARCH_H + +/* the binary needs to know its own architecture */ +#if defined __x86_64__ +# define ARCH "x86_64" +#elif defined __i386__ +# define ARCH "i686" +#elif defined __ARM_ARCH_7__ +# define ARCH "armv7h" +#elif defined __ARM_ARCH_6__ +# if defined __VFP_FP__ +# define ARCH "armv6h" +# else +# define ARCH "arm" +# endif +#else +# error Unknown architecture! +#endif + +#endif /* _ARCH_H */ + +// vim: set syntax=c: -- cgit v1.2.3-54-g00ecf