提交 04130cc9 编写于 作者: D Daniel Tang 提交者: Michal Marek

Fix a build warning in scripts/mod/file2alias.c

On some systems, __used is already defined in sys/cdefs.h and causes
a build warning:

scripts/mod/file2alias.c:85:1: warning: "__used" redefined
In file included from /usr/include/stdio.h:64,
                 from scripts/mod/modpost.h:1,
		                  from scripts/mod/file2alias.c:13:
				  /usr/include/sys/cdefs.h:146:1: warning: this is the location of the previous definition

This adds an extra check before defining the __used macro to see if
the macro was already defined elsewhere.
Signed-off-by: NDaniel Tang <dt.tangr@gmail.com>
Signed-off-by: NMichal Marek <mmarek@suse.cz>
上级 bd701343
......@@ -79,10 +79,12 @@ struct devtable **__start___devtable, **__stop___devtable;
extern struct devtable *__start___devtable[], *__stop___devtable[];
#endif /* __MACH__ */
#if __GNUC__ == 3 && __GNUC_MINOR__ < 3
# define __used __attribute__((__unused__))
#else
# define __used __attribute__((__used__))
#if !defined(__used)
# if __GNUC__ == 3 && __GNUC_MINOR__ < 3
# define __used __attribute__((__unused__))
# else
# define __used __attribute__((__used__))
# endif
#endif
/* Define a variable f that holds the value of field f of struct devid
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册