Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BED1C4338F for ; Fri, 6 Aug 2021 03:01:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 78D9861154 for ; Fri, 6 Aug 2021 03:01:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 78D9861154 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:51596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBq75-0002XR-AR for qemu-devel@archiver.kernel.org; Thu, 05 Aug 2021 23:01:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39400) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBq63-0001Gl-0X for qemu-devel@nongnu.org; Thu, 05 Aug 2021 23:00:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:52612) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBq61-0000sc-GC for qemu-devel@nongnu.org; Thu, 05 Aug 2021 23:00:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628218828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=KU412xskKpo2yK0ge/2dmfNOITyUMjm2OVBFCuYVuxg=; b=YRF/MBvIadgVoR188U6DEqBXXFjVm0t4L9wSKlYL/8eegEILkBhHz/LF1askSc98VjLkzx 0UqBJqleUVLDLliVIWM/5Eqq4e7J5fV+Zf0d7ReToHCtEqe/xji86xz87btGS8Z1v3KJ3r WtRf4Wt99sbill94GuNmZOE3kA7Ta9o= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-310-RXcOf1I0PfqKycSWtyXcEA-1; Thu, 05 Aug 2021 23:00:26 -0400 X-MC-Unique: RXcOf1I0PfqKycSWtyXcEA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CE74C87180F; Fri, 6 Aug 2021 03:00:25 +0000 (UTC) Received: from localhost (unknown [10.22.11.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6FE6A5DF21; Fri, 6 Aug 2021 03:00:25 +0000 (UTC) Date: Thu, 5 Aug 2021 23:00:24 -0400 From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: Win32 and ACCEL macro/function Message-ID: <20210806030024.om77dfa4frxtpw7i@habkost.net> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Received-SPF: pass client-ip=170.10.133.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.699, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Weil , "Daniel P. Berrange" , Paolo Bonzini Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Hello, I'm looking for help dealing with a naming conflict when building QEMU for Windows hosts. The summary is: I'm trying to replace the ACCEL() macro in include/qemu/accel.h with an inline function, but the ACCEL name conflicts with a symbol provided by winuser.h: In file included from /builds/ehabkost/qemu/include/exec/memory.h:28, from /builds/ehabkost/qemu/hw/ppc/mac.h:30, from ../hw/pci-host/uninorth.c:27: /builds/ehabkost/qemu/include/qemu/accel.h:63:45: error: 'ACCEL' redeclared as different kind of symbol 63 | OBJECT_DECLARE_TYPE(AccelState, AccelClass, ACCEL) | ^~~~~ /builds/ehabkost/qemu/include/qom/object.h:178:5: note: in definition of macro 'DECLARE_INSTANCE_CHECKER' 178 | OBJ_NAME(const void *obj) \ | ^~~~~~~~ /builds/ehabkost/qemu/include/qom/object.h:240:5: note: in expansion of macro 'DECLARE_OBJ_CHECKERS' 240 | DECLARE_OBJ_CHECKERS(InstanceType, ClassType, \ | ^~~~~~~~~~~~~~~~~~~~ /builds/ehabkost/qemu/include/qemu/accel.h:63:1: note: in expansion of macro 'OBJECT_DECLARE_TYPE' 63 | OBJECT_DECLARE_TYPE(AccelState, AccelClass, ACCEL) | ^~~~~~~~~~~~~~~~~~~ In file included from /usr/x86_64-w64-mingw32/sys-root/mingw/include/windows.h:72, from /usr/x86_64-w64-mingw32/sys-root/mingw/include/winsock2.h:23, from /builds/ehabkost/qemu/include/sysemu/os-win32.h:29, from /builds/ehabkost/qemu/include/qemu/osdep.h:135, from ../hw/pci-host/uninorth.c:25: /usr/x86_64-w64-mingw32/sys-root/mingw/include/winuser.h:1757:5: note: previous declaration of 'ACCEL' was here 1757 | } ACCEL,*LPACCEL; | ^~~~~ [338/4278] Compiling C object libqemuutil.a.p/meson-generated_.._trace_trace-scsi.c.obj ninja: build stopped: subcommand failed. make: *** [Makefile:156: run-ninja] Error 1 (Full log at https://gitlab.com/ehabkost/qemu/-/jobs/1481978645) Does anybody more experienced with Win32 have a suggestion on how to deal with this? Do we really need to include winsock2.h / windows.h / winuser.h from qemu/osdep.h? -- Eduardo