From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bL88D-0004yC-4Q for qemu-devel@nongnu.org; Thu, 07 Jul 2016 08:10:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bL888-0005Wi-UE for qemu-devel@nongnu.org; Thu, 07 Jul 2016 08:10:12 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:35257) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bL888-0005WT-Ni for qemu-devel@nongnu.org; Thu, 07 Jul 2016 08:10:08 -0400 Received: by mail-wm0-x244.google.com with SMTP id a66so4983724wme.2 for ; Thu, 07 Jul 2016 05:10:08 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Thu, 7 Jul 2016 14:10:04 +0200 Message-Id: <1467893404-10521-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH] disas: avoid including everything in headers compiled from C++ List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: sbruno@freebsd.org, Peter Maydell , Markus Armbruster disas/arm-a64.cc is careful to include only the bare minimum that it needs---qemu/osdep.h and disas/bfd.h. Unfortunately, disas/bfd.h then includes qemu-common.h, which brings in qemu/option.h and from there we get the kitchen sink. This causes problems because for example QEMU's atomic macros conflict with C++ atomic types. But really all that bfd.h needs is the fprintf_function typedef, so replace the inclusion of qemu-common.h with qemu/fprintf-fn.h. Reported-by: Sean Bruno Tested-by: Sean Bruno Cc: Peter Maydell Cc: Markus Armbruster Signed-off-by: Paolo Bonzini --- include/disas/bfd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/disas/bfd.h b/include/disas/bfd.h index a112e9c..a87b8a1 100644 --- a/include/disas/bfd.h +++ b/include/disas/bfd.h @@ -9,7 +9,7 @@ #ifndef DIS_ASM_H #define DIS_ASM_H -#include "qemu-common.h" +#include "qemu/fprintf-fn.h" typedef void *PTR; typedef uint64_t bfd_vma; -- 2.7.4