]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Add missing header for gcc3
authorScott McNutt <smcnutt@psyent.com>
Fri, 23 Sep 2011 11:42:14 +0000 (11:42 +0000)
committerWolfgang Denk <wd@denx.de>
Sat, 1 Oct 2011 19:56:20 +0000 (21:56 +0200)
When include/linux/compiler.h is included, the associated gcc3
header is required for older build environments.

Signed-off-by: Scott McNutt <smcnutt@psyent.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
include/linux/compiler-gcc3.h [new file with mode: 0644]

diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h
new file mode 100644 (file)
index 0000000..2befe65
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef __LINUX_COMPILER_H
+#error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead."
+#endif
+
+#if __GNUC_MINOR__ >= 3
+# define __used                        __attribute__((__used__))
+#else
+# define __used                        __attribute__((__unused__))
+#endif
+
+#if __GNUC_MINOR__ >= 4
+#define __must_check           __attribute__((warn_unused_result))
+#endif
+
+/*
+ * A trick to suppress uninitialized variable warning without generating any
+ * code
+ */
+#define uninitialized_var(x) x = x
+
+#define __always_inline                inline __attribute__((always_inline))