From 59e71ee80c65426b2f569cc4c60936053cc9caa5 Mon Sep 17 00:00:00 2001 From: Boris Gjenero Date: Fri, 9 Dec 2011 15:33:59 +0000 Subject: Introduce USED_ATTR wrapper for __attribute__((used)). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31188 a1c6a512-1295-4272-9138-f99709370657 --- firmware/include/gcc_extensions.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'firmware/include/gcc_extensions.h') diff --git a/firmware/include/gcc_extensions.h b/firmware/include/gcc_extensions.h index 7109edaaf6..2735d6e7b6 100644 --- a/firmware/include/gcc_extensions.h +++ b/firmware/include/gcc_extensions.h @@ -57,4 +57,13 @@ #define FORCE_INLINE inline #endif + +/* Version information from http://ohse.de/uwe/articles/gcc-attributes.html */ +#if defined(__GNUC__) && (__GNUC__ >= 4 || \ + (__GNUC__ >= 3 && __GNUC_MINOR__ >= 1)) +#define USED_ATTR __attribute__((used)) +#else +#define USED_ATTR +#endif + #endif /* _GCC_EXTENSIONS_H_ */ -- cgit v1.2.3