mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-01 14:31:52 -06:00
compiler: remove GNUC check
QEMU requires Clang or GCC, that define and support __GNUC__ extensions. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20201210134752.780923-12-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
d55e5bd15a
commit
4e063f7b29
1 changed files with 1 additions and 7 deletions
|
@ -64,14 +64,10 @@
|
||||||
(offsetof(container, field) + sizeof_field(container, field))
|
(offsetof(container, field) + sizeof_field(container, field))
|
||||||
|
|
||||||
/* Convert from a base type to a parent type, with compile time checking. */
|
/* Convert from a base type to a parent type, with compile time checking. */
|
||||||
#ifdef __GNUC__
|
|
||||||
#define DO_UPCAST(type, field, dev) ( __extension__ ( { \
|
#define DO_UPCAST(type, field, dev) ( __extension__ ( { \
|
||||||
char __attribute__((unused)) offset_must_be_zero[ \
|
char __attribute__((unused)) offset_must_be_zero[ \
|
||||||
-offsetof(type, field)]; \
|
-offsetof(type, field)]; \
|
||||||
container_of(dev, type, field);}))
|
container_of(dev, type, field);}))
|
||||||
#else
|
|
||||||
#define DO_UPCAST(type, field, dev) container_of(dev, type, field)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define typeof_field(type, field) typeof(((type *)0)->field)
|
#define typeof_field(type, field) typeof(((type *)0)->field)
|
||||||
#define type_check(t1,t2) ((t1*)0 - (t2*)0)
|
#define type_check(t1,t2) ((t1*)0 - (t2*)0)
|
||||||
|
@ -102,7 +98,7 @@
|
||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
/* clang doesn't support gnu_printf, so use printf. */
|
/* clang doesn't support gnu_printf, so use printf. */
|
||||||
# define GCC_FMT_ATTR(n, m) __attribute__((format(printf, n, m)))
|
# define GCC_FMT_ATTR(n, m) __attribute__((format(printf, n, m)))
|
||||||
#elif defined(__GNUC__)
|
#else
|
||||||
/* Use gnu_printf (qemu uses standard format strings). */
|
/* Use gnu_printf (qemu uses standard format strings). */
|
||||||
# define GCC_FMT_ATTR(n, m) __attribute__((format(gnu_printf, n, m)))
|
# define GCC_FMT_ATTR(n, m) __attribute__((format(gnu_printf, n, m)))
|
||||||
# if defined(_WIN32)
|
# if defined(_WIN32)
|
||||||
|
@ -112,8 +108,6 @@
|
||||||
*/
|
*/
|
||||||
# define __printf__ __gnu_printf__
|
# define __printf__ __gnu_printf__
|
||||||
# endif
|
# endif
|
||||||
#else
|
|
||||||
#define GCC_FMT_ATTR(n, m)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __has_warning
|
#ifndef __has_warning
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue