From b17d2d4059bb77ebaf9fe4187bae88cb8adc8464 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 22 Jan 2019 19:02:46 -0500 Subject: [PATCH] qemu/compiler: Add fallback macro for __has_builtin Prevents compilation errors on non-clang compilers. --- qemu/include/qemu/compiler.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qemu/include/qemu/compiler.h b/qemu/include/qemu/compiler.h index 3a938f3f..d3ab33c8 100644 --- a/qemu/include/qemu/compiler.h +++ b/qemu/include/qemu/compiler.h @@ -14,6 +14,10 @@ #define __has_attribute(x) 0 /* compatibility with older GCC */ #endif +#ifndef __has_builtin // Optional of course. +#define __has_builtin(x) 0 // Compatibility with non-clang compilers. +#endif + /* * If __attribute__((error)) is present, use it to produce an error at * compile time. Otherwise, one must wait for the linker to diagnose