From nobody Sun Apr 28 04:54:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522751766082847.4519128134524; Tue, 3 Apr 2018 03:36:06 -0700 (PDT) Received: from localhost ([::1]:51157 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3JIG-00006z-GG for importer@patchew.org; Tue, 03 Apr 2018 06:36:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35597) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3JHG-00085r-U6 for qemu-devel@nongnu.org; Tue, 03 Apr 2018 06:34:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3JHD-0002pt-Ru for qemu-devel@nongnu.org; Tue, 03 Apr 2018 06:34:58 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38910 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3JHD-0002pg-Mi for qemu-devel@nongnu.org; Tue, 03 Apr 2018 06:34:55 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2F20C8425F; Tue, 3 Apr 2018 10:34:51 +0000 (UTC) Received: from localhost.localdomain (ovpn-204-54.brq.redhat.com [10.40.204.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id 205A7D7DFB; Tue, 3 Apr 2018 10:34:43 +0000 (UTC) From: Michal Privoznik To: qemu-devel@nongnu.org Date: Tue, 3 Apr 2018 12:34:37 +0200 Message-Id: <3c36db1dc0702763ebb7966cc27428ed67d43804.1522751624.git.mprivozn@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 03 Apr 2018 10:34:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 03 Apr 2018 10:34:51 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mprivozn@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v2] ccid-card: include libcacard.h only X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcandre.lureau@gmail.com, kraxel@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" When trying to build with latest libcacard-2.5.1, I hit the following error: In file included from hw/usb/ccid-card-passthru.c:12:0: /usr/include/cacard/vscard_common.h:26:2: error: #warning "Only can be included directly" [-Werror=3Dcpp] #warning "Only can be included directly" While it was fixed in libcacard upstream (so that individual files can be included directly), it doesn't make much sense. Let's switch to including the main libcacard.h and also require at least libcacard-2.5.1 which introduced it. It's available since late 2015. Signed-off-by: Michal Privoznik Reviewed-by: Marc-Andr=C3=A9 Lureau --- diff to v1: - Introduce configure change to require newer libcacard version configure | 2 +- hw/usb/ccid-card-emulated.c | 5 +---- hw/usb/ccid-card-passthru.c | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 4d0e92c96c..0edec24fff 100755 --- a/configure +++ b/configure @@ -4440,7 +4440,7 @@ fi =20 # check for smartcard support if test "$smartcard" !=3D "no"; then - if $pkg_config libcacard; then + if $pkg_config --atleast-version=3D2.5.1 libcacard; then libcacard_cflags=3D$($pkg_config --cflags libcacard) libcacard_libs=3D$($pkg_config --libs libcacard) smartcard=3D"yes" diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c index ea42e4681d..7b538ae6da 100644 --- a/hw/usb/ccid-card-emulated.c +++ b/hw/usb/ccid-card-emulated.c @@ -27,10 +27,7 @@ */ =20 #include "qemu/osdep.h" -#include -#include -#include -#include +#include =20 #include "qemu/thread.h" #include "qemu/main-loop.h" diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c index b7dd3602dc..982d575edd 100644 --- a/hw/usb/ccid-card-passthru.c +++ b/hw/usb/ccid-card-passthru.c @@ -9,7 +9,7 @@ */ =20 #include "qemu/osdep.h" -#include +#include #include "chardev/char-fe.h" #include "qemu/error-report.h" #include "qemu/sockets.h" --=20 2.16.1