From nobody Sun May 19 15:05:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1601574808; cv=none; d=zohomail.com; s=zohoarc; b=BQCMLe/BR6w5gxYAmfYukM+Z1tf3vftHfg2awqNDxgBUeIJkQOcnbTuDT/RH3obkbfP4NVY9I/0saC9MVi4l9h+0RHNmqQ08jF5FiFhT+wXGw/nGPMrp+WMmPnwyLXoCzYi9iGb7yK8v5JTzo6UgYxTi0+jl0IityG5UCP1bVdE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601574808; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=J7MK5+58+DPxK9PNp9tYy0RkeJRycPQrGBrc0kvVojg=; b=V9wF62chq+CQcrrUEBLtlDUojjbkeATIcz/m5SUEwbYYjA1NKIIGFhfJVksW0qBb2F3xnDclogwJWIZTRQsTLRlXKZ2gYiVXFkyUTukio158MRi2DaoB53lGEkyheKfyvO7Apmytj41ULDrl9VeEWgMYtde5HqKuH2Ckyj7qKH4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1601574808762627.8672621895751; Thu, 1 Oct 2020 10:53:28 -0700 (PDT) Received: from localhost ([::1]:42074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kO2lj-0002mW-FB for importer@patchew.org; Thu, 01 Oct 2020 13:53:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kO2Rs-0004gZ-St; Thu, 01 Oct 2020 13:32:56 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:52432) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kO2Rp-0005DQ-Tu; Thu, 01 Oct 2020 13:32:56 -0400 Received: by mail-pj1-x1033.google.com with SMTP id gm14so2370180pjb.2; Thu, 01 Oct 2020 10:32:53 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id b20sm7253767pfb.198.2020.10.01.10.32.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 10:32:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J7MK5+58+DPxK9PNp9tYy0RkeJRycPQrGBrc0kvVojg=; b=fxe4bb5YjHFKKJ7x/InHZ1iK/oy3hh3OFWkC1xAqETQan91alPoue0mx8EWFnLOQLZ YTxSGGF9w7SYSMqjWEIuf/Ih6BpN8TTp3sWsR/j5AEZZY1zBBFi/ghGr5dM8v8ehLFuz RLBL2DN8hr6JOldrTy4I97nGfX+uJdue1DD9+HIuV/3FW6z0nllRFxtM570FmqKnl/lK AzSayWOMY5uhLKdSak7j0x+A80g57x2CDP4BgAJRgbj30QTGM/hZhWPJFEu7gWt1Z8jG +/421+ynJshUuto1NGiOsWmnKrYfBBqJTNYcEqCxYCqg3jDG0XxnLhUwjjbfJvrq7NmU op9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J7MK5+58+DPxK9PNp9tYy0RkeJRycPQrGBrc0kvVojg=; b=lGqlabiQTw+JNwL2MtbkBlFhUskJ+N2X/y/OXEDYBoESE0QuYyvN8ZJaMmyBXNbMya EiuuqBOanNgmAlJhNwrSk1U+YxSOpk3opBHt7x4a6EyortYvZFvj/qA4Z5ldn51tDytB phPaSDIE4a8CVMczuyKRN7QtHR4pYG+7SQMSV05AFqdEoXvZYvaGii/XcnrCPptfQBdE BIfF8D5mNSF5GAoP1eFYeR2Ybpg9spUTtb1qp/eJV1evFB7NPZmdlRwU/z+K5H+OSpDQ F3wwjFfEI+TmQa5Q2MK7WfUjny6VqY0Uo2EcuBiEmpmGwyBA84SkZsvT/erfrhAdHJzC ninQ== X-Gm-Message-State: AOAM533CIBJbp3CE2racZkBTjlYgUdHoj69cdceIjAckED3+aGop+b7g 5LZMHCrWgQnQ+wzk5Ztft4kKe2YAliBK+w== X-Google-Smtp-Source: ABdhPJz7C3BcCjBGoZv4rE2wg2LXDyfb4LRJ3nuhXWpuUiv7f0w8buV1Hp6UsU7OqQ6cH6QOmo5a3g== X-Received: by 2002:a17:90a:8c83:: with SMTP id b3mr1002224pjo.206.1601573571423; Thu, 01 Oct 2020 10:32:51 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v6 1/4] configure: fixes indent of $meson setup Date: Fri, 2 Oct 2020 01:32:27 +0800 Message-Id: <20201001173230.829-2-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201001173230.829-1-luoyonggang@gmail.com> References: <20201001173230.829-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=luoyonggang@gmail.com; helo=mail-pj1-x1033.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: QEMU Trivial , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Laurent Vivier , Yonggang Luo , Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" convert these line from tab to space Signed-off-by: Yonggang Luo Reviewed-by: Daniel P. Berrang=C3=A9 --- configure | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure b/configure index ca9b458ea0..8f7bdbfdd3 100755 --- a/configure +++ b/configure @@ -7843,10 +7843,10 @@ NINJA=3D${ninja:-$PWD/ninjatool} $meson setup \ -Dstrip=3D$(if test "$strip_opt" =3D yes; then echo true; else ech= o false; fi) \ -Db_pie=3D$(if test "$pie" =3D yes; then echo true; else echo fals= e; fi) \ -Db_coverage=3D$(if test "$gcov" =3D yes; then echo true; else ech= o false; fi) \ - -Dmalloc=3D$malloc -Dmalloc_trim=3D$malloc_trim \ - -Dcocoa=3D$cocoa -Dmpath=3D$mpath -Dsdl=3D$sdl -Dsdl_image=3D$sdl_image \ - -Dvnc=3D$vnc -Dvnc_sasl=3D$vnc_sasl -Dvnc_jpeg=3D$vnc_jpeg -Dvnc_png=3D$v= nc_png \ - -Dgettext=3D$gettext -Dxkbcommon=3D$xkbcommon -Du2f=3D$u2f\ + -Dmalloc=3D$malloc -Dmalloc_trim=3D$malloc_trim \ + -Dcocoa=3D$cocoa -Dmpath=3D$mpath -Dsdl=3D$sdl -Dsdl_image=3D$sdl_= image \ + -Dvnc=3D$vnc -Dvnc_sasl=3D$vnc_sasl -Dvnc_jpeg=3D$vnc_jpeg -Dvnc_p= ng=3D$vnc_png \ + -Dgettext=3D$gettext -Dxkbcommon=3D$xkbcommon -Du2f=3D$u2f \ $cross_arg \ "$PWD" "$source_path" =20 --=20 2.28.0.windows.1 From nobody Sun May 19 15:05:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1601574960; cv=none; d=zohomail.com; s=zohoarc; b=EyWmncMxrogpzHJet+Zne55Z9JhsT5VdDHcuND1CPOUO8JVLHlJ27LFft/2c0NnrAyiFvpPDGs3O+I9N25ZW6YKa966JQariHXbd+lDkKO8Qkg/gNq9hJMYmyCIW3UGIzJIE7K9YpwB8URwfC38pbEAn/G9JmL2cZdK2ZjhuO1k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601574960; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=38P1i5JkQS7ofb/RLUKRo29Ks91Vqq7zgVYwAGpHkHw=; b=gRb5ok6Penxl8XOxJVaQJxb69ewoedbzDEGfhs68Nw+n5Q2HqSmI4U/42CojZJS1M9vDRb8JyQgEfvzpksY25TKF16ipK8q7QYzZBj4sAOwyEd1b71p/HudD7xSMw3vMQFK7Bfo35JqXEFbACYn4yVpv1a6+uNcQu2P0/8y+pDE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160157496014026.661548003764437; Thu, 1 Oct 2020 10:56:00 -0700 (PDT) Received: from localhost ([::1]:50472 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kO2oA-0006P6-IG for importer@patchew.org; Thu, 01 Oct 2020 13:55:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kO2Rv-0004ic-3q; Thu, 01 Oct 2020 13:32:59 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:46366) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kO2Rs-0005Df-N7; Thu, 01 Oct 2020 13:32:58 -0400 Received: by mail-pf1-x441.google.com with SMTP id b124so5190339pfg.13; Thu, 01 Oct 2020 10:32:55 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id b20sm7253767pfb.198.2020.10.01.10.32.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 10:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=38P1i5JkQS7ofb/RLUKRo29Ks91Vqq7zgVYwAGpHkHw=; b=lMQzmh67JMvOY+1NHCOZ+gV9iKaz83cqeGY4LxAfoaX6VrBTyYeCQqURxtaCNMJ30S XDVK5nyLE9huVIUmYVMgWtLQC6BCqbInNTzcLcyY4uBd38Ft7HXCswWKzO4riPKTzAHc iDRQeKvaC/Df50aMUMg9XkWALGL3+c+T8t9EbHTr3qxgh2n5dJEeUH7+CZj5qMDN9CmR HEFXY3qjFQ5vGSdP6+nFk19UKG5XuxQiMS0txhgpmrJFRMrOSITgwVQGujdZqMZZbJ40 cSXX7Y20VY3DSl07tgXITeS68WIugnb+O0E9LNw7HTjRS93pISn7rY/SIQe+yr/9FQMb xjLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=38P1i5JkQS7ofb/RLUKRo29Ks91Vqq7zgVYwAGpHkHw=; b=Ed7X6oMuFjfsWwc6Ks3bLBBJoDP/FI5tcT0nH0GNW5/Uzy/bgnZnOlfnrOxk29mGN0 lZkHq7AVaATpSQxTAmxh5a4AIoMxJZkCHgFZO1UPfIvrDe3UojmPujxWiAhRdEcCvS1C 4Sl459Dz6/Ng0IuJg0mlaijj3CF1WmYwe8TFXb28yPcu/XtPDKVE7lk8q+/fAUBIKkgX M+Uqq+aEkJFE/CydZ2mUi8oK3snDSHA2Hb/XXq5GIMaTwQSZVC4p7tA/9XJeMCO/U+za /zU05hkenHV406m1ORqBu8Be5g1O3gHK+9S/ucIRfVnM//YpkE4venVDdcLJRjQa1AdM Jvhg== X-Gm-Message-State: AOAM533h/eKo91YXlBMfzV5G0lhYLbPdk6p2oO2yvEUU6auJcPPJYsv+ pJ3LqighISnUAvq3ZrtB0KUjurOZnOnJBw== X-Google-Smtp-Source: ABdhPJyih6h3zqzIPgZyn4H2VOmauvHJ/HkC+Kp4cwoXY9Moba4Ikmr9XpSmSYYhU6ZJJBaioC2xCQ== X-Received: by 2002:a63:1863:: with SMTP id 35mr6999333pgy.413.1601573574454; Thu, 01 Oct 2020 10:32:54 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v6 2/4] curses: Fixes compiler error that complain don't have langinfo.h on msys2/mingw Date: Fri, 2 Oct 2020 01:32:28 +0800 Message-Id: <20201001173230.829-3-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201001173230.829-1-luoyonggang@gmail.com> References: <20201001173230.829-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::441; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x441.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: QEMU Trivial , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Laurent Vivier , Yonggang Luo , Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" msys2/mingw lacks the POSIX-required langinfo.h. gcc test.c -DNCURSES_WIDECHAR -I/mingw64/include/ncursesw -pipe -lncursesw = -lgnurx -ltre -lintl -liconv test.c:4:10: fatal error: langinfo.h: No such file or directory 4 | #include | ^~~~~~~~~~~~ compilation terminated. So we using g_get_codeset instead of nl_langinfo(CODESET) Signed-off-by: Yonggang Luo Reviewed-by: Gerd Hoffmann --- ui/curses.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/curses.c b/ui/curses.c index a59b23a9cf..12bc682cf9 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -30,7 +30,6 @@ #endif #include #include -#include #include =20 #include "qapi/error.h" @@ -526,6 +525,7 @@ static void font_setup(void) iconv_t nativecharset_to_ucs2; iconv_t font_conv; int i; + g_autofree gchar *local_codeset =3D g_get_codeset(); =20 /* * Control characters are normally non-printable, but VGA does have @@ -566,14 +566,14 @@ static void font_setup(void) 0x25bc }; =20 - ucs2_to_nativecharset =3D iconv_open(nl_langinfo(CODESET), "UCS-2"); + ucs2_to_nativecharset =3D iconv_open(local_codeset, "UCS-2"); if (ucs2_to_nativecharset =3D=3D (iconv_t) -1) { fprintf(stderr, "Could not convert font glyphs from UCS-2: '%s'\n", strerror(errno)); exit(1); } =20 - nativecharset_to_ucs2 =3D iconv_open("UCS-2", nl_langinfo(CODESET)); + nativecharset_to_ucs2 =3D iconv_open("UCS-2", local_codeset); if (nativecharset_to_ucs2 =3D=3D (iconv_t) -1) { iconv_close(ucs2_to_nativecharset); fprintf(stderr, "Could not convert font glyphs to UCS-2: '%s'\n", @@ -581,7 +581,7 @@ static void font_setup(void) exit(1); } =20 - font_conv =3D iconv_open(nl_langinfo(CODESET), font_charset); + font_conv =3D iconv_open(local_codeset, font_charset); if (font_conv =3D=3D (iconv_t) -1) { iconv_close(ucs2_to_nativecharset); iconv_close(nativecharset_to_ucs2); @@ -602,7 +602,7 @@ static void font_setup(void) /* DEL */ convert_ucs(0x7F, 0x2302, ucs2_to_nativecharset); =20 - if (strcmp(nl_langinfo(CODESET), "UTF-8")) { + if (strcmp(local_codeset, "UTF-8")) { /* Non-Unicode capable, use termcap equivalents for those availabl= e */ for (i =3D 0; i <=3D 0xFF; i++) { wchar_t wch[CCHARW_MAX]; --=20 2.28.0.windows.1 From nobody Sun May 19 15:05:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1601576380; cv=none; d=zohomail.com; s=zohoarc; b=R1eVmhT4gr24/Yld9YTqnUeJq29bUyM3KWY1ER+3NVwfEE1Sgr9cu5Clld6sYJkd68fiss0u2lxfkzuoLXKEbtafrL6VmP6dY1Pg1PuLBo7AIFzwBAFGGXi3P7XbZqmTkbqVRGmaraAhY7M4O1Ju/2hBtl3epEa2yJqOZNemLSU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601576380; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fONA64XSdMINk4Pb3HJvl02BkTmqUfaoSQk6W/tx2aE=; b=JDaKSKM5XZwDVGmlO/+bujb62Jw4RTsYoURALm0fSDm1/mGk+ikVlqH3n0L5prkY5HEUrq79fyqmoF69kFBfKt6KP9w3UhVf2qF/b9fW9vBmPqZ8qExUdDLW29zOwFGyypnqlLSaDu7xMZojFkH34zxqPGkn6MULVrlHJn6BDXU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160157638099316.63370752298181; Thu, 1 Oct 2020 11:19:40 -0700 (PDT) Received: from localhost ([::1]:43662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kO3B5-0003Br-Ny for importer@patchew.org; Thu, 01 Oct 2020 14:19:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kO2Rx-0004kG-In; Thu, 01 Oct 2020 13:33:06 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:46971) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kO2Rv-0005Dw-MY; Thu, 01 Oct 2020 13:33:01 -0400 Received: by mail-pg1-x542.google.com with SMTP id 34so4537030pgo.13; Thu, 01 Oct 2020 10:32:58 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id b20sm7253767pfb.198.2020.10.01.10.32.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 10:32:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fONA64XSdMINk4Pb3HJvl02BkTmqUfaoSQk6W/tx2aE=; b=IT48uJ8Oogwk5GsnihTnyaZSDwD7aCafCsUZ2WW7LQjdjuVGlT8KUCWS47J743hNlS lzpnc70rFrht6tvw8vQsDJxMipRqJPGDTySNWZGjq1AC8OGWZABOQNB5c0vKr5z9dT6i lLtSCGxRKto77JhwQlwclOuM0decnuU9eUXqRS+WcOKFCCc4Q0cBepTcuGiRP/JCfIrj MHfaoIElsqUNp6uOSxtJFnx/dGAsHQ9+h0VI4+cDYQGGzuhL86z1Fq52dW+htA88PBVC Edxy4BOOraBE6zflo8u3SRATJkMTjxiJ1lOJ6kOmZcR9PTMRKW+K3PFP9ChJm9S+Hok3 2Qaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fONA64XSdMINk4Pb3HJvl02BkTmqUfaoSQk6W/tx2aE=; b=o12+pvVAKh/WjGIVB38X5QQkpE0X9Q29ULQo0eMdRs8jZWc3fV0bUqTrA7F1PY/gNf smSKqwgCvjUB5JQy1JcsasINcnxKWAfPlhknJbbiseELoM1YI3iUJxVUXUGlznj4SMfR jZTTRQGmmQHFzcW0j2KbRj27jHy2D02JT9IMEr9vNe+488pM6vOksn26pIlrP6TTe940 zeWV+vJq2jlXqS5CN3MWPPQN1cmDqG9AHnH2iF8h6lnIPMnNAiZTbjpTmpzqy+YjHDtS rT+JcPwPwHiOCkYU16BcjvVrkwPipANva2MgnYfKR0BGeZA6InUqG9QyvU/OhDwmcL+5 B+Jw== X-Gm-Message-State: AOAM533UnIh2SGCtcviegNWUKx+ixeYu/rqvAEMdvMU+HsorPREHiqHD ZswgZ+qyzhX5Ldnk1kHZTMhZm+1sbEDgrQ== X-Google-Smtp-Source: ABdhPJyxsndO8jkD959aWajrjHZpovJmNt/OSxg3ig4uAiCw75y1ISv3Ijas1T0GPjXShSOfPhTgsQ== X-Received: by 2002:a05:6a00:2db:b029:142:2501:34ed with SMTP id b27-20020a056a0002dbb0290142250134edmr7799155pft.70.1601573577627; Thu, 01 Oct 2020 10:32:57 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v6 3/4] curses: Fixes curses compiling errors. Date: Fri, 2 Oct 2020 01:32:29 +0800 Message-Id: <20201001173230.829-4-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201001173230.829-1-luoyonggang@gmail.com> References: <20201001173230.829-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::542; envelope-from=luoyonggang@gmail.com; helo=mail-pg1-x542.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , QEMU Trivial , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Laurent Vivier , Yonggang Luo , Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This is the compiling error: ../ui/curses.c: In function 'curses_refresh': ../ui/curses.c:256:5: error: 'next_maybe_keycode' may be used uninitialized= in this function [-Werror=3Dmaybe-uninitialized] 256 | curses2foo(_curses2keycode, _curseskey2keycode, chr, maybe_keyc= ode) | ^~~~~~~~~~ ../ui/curses.c:302:32: note: 'next_maybe_keycode' was declared here 302 | enum maybe_keycode next_maybe_keycode; | ^~~~~~~~~~~~~~~~~~ ../ui/curses.c:256:5: error: 'maybe_keycode' may be used uninitialized in t= his function [-Werror=3Dmaybe-uninitialized] 256 | curses2foo(_curses2keycode, _curseskey2keycode, chr, maybe_keyc= ode) | ^~~~~~~~~~ ../ui/curses.c:265:24: note: 'maybe_keycode' was declared here 265 | enum maybe_keycode maybe_keycode; | ^~~~~~~~~~~~~ cc1.exe: all warnings being treated as errors gcc version 10.2.0 (Rev1, Built by MSYS2 project) Signed-off-by: Yonggang Luo Reviewed-by: Gerd Hoffmann Reviewed-by: Daniel P. Berrang=C3=A9 --- ui/curses.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/curses.c b/ui/curses.c index 12bc682cf9..e4f9588c3e 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -262,7 +262,7 @@ static int curses2foo(const int _curses2foo[], const in= t _curseskey2foo[], static void curses_refresh(DisplayChangeListener *dcl) { int chr, keysym, keycode, keycode_alt; - enum maybe_keycode maybe_keycode; + enum maybe_keycode maybe_keycode =3D CURSES_KEYCODE; =20 curses_winch_check(); =20 @@ -299,7 +299,7 @@ static void curses_refresh(DisplayChangeListener *dcl) =20 /* alt or esc key */ if (keycode =3D=3D 1) { - enum maybe_keycode next_maybe_keycode; + enum maybe_keycode next_maybe_keycode =3D CURSES_KEYCODE; int nextchr =3D console_getch(&next_maybe_keycode); =20 if (nextchr !=3D -1) { --=20 2.28.0.windows.1 From nobody Sun May 19 15:05:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1601576590; cv=none; d=zohomail.com; s=zohoarc; b=VheVZ+i9oHAkoPi+XU0M6QEesqV2+rzqUdduJQfm7a1BDOH0yRTwazA+CEK1RmCCa7kZ1RQJxA68tpXsDBtsfVXq632+7m7BKK2ac+ItV6QDnPupWhDr22H0C8vD1IDjMzFZpbUdcJ1fWsuK/7dyvj2GucBOaZ2bezckhV6R/y8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601576590; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RL47DD7jczS4ueH47GPQF+C3dft0LjdpTt4m7Cc68+Y=; b=Y/721oJwgy0EEAHTJUCjyzzTJh+BbsS3666MPQVh3r/fwtM2o4XIIR9HaCd9fuWOmIoqOoAIax5CPh7qvLYP/oMlWqChqjDgcszPYyoYPIvnFKKsseMMnvIIjkP9ZorihqxT/palKkHHZ27CszqFsSHCJQn1GXaOnOEkJA00HFQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1601576590842599.3076939522442; Thu, 1 Oct 2020 11:23:10 -0700 (PDT) Received: from localhost ([::1]:50392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kO3ET-0006Fb-Dx for importer@patchew.org; Thu, 01 Oct 2020 14:23:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kO2S2-0004ky-Um; Thu, 01 Oct 2020 13:33:08 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:45192) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kO2Rz-0005EC-0z; Thu, 01 Oct 2020 13:33:06 -0400 Received: by mail-pg1-x543.google.com with SMTP id y14so4542755pgf.12; Thu, 01 Oct 2020 10:33:02 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id b20sm7253767pfb.198.2020.10.01.10.32.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 10:32:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RL47DD7jczS4ueH47GPQF+C3dft0LjdpTt4m7Cc68+Y=; b=MBVaoiI+/YlTjj/Ue5bLeFkL4gKvwfuiYOIb7vAFJXA2r7BiIIvoDL7JmQ6Xy42r28 m3ZVanfSjA2kGaF5qQ5HvUjDSjmazZWXrdRr4QeJnE8Zg/4BkUR7wVGUxGy1jHi7K81u /3eLyiwFILzEL0OHPzO8hGQUHFgR6abhjdBdRjzRVv5m6RvcTfmmo2sEqERTSVK0qLB8 +mUMpb49D/mKC7E1Nua8p8Gl3aVoBqjfBvsbRWDcaN1LFRk3AoFOwqy5wg23mH9ds3sn Gp+cbVrrtPdSFIAoTFjZ4eDJ5hShMJ6+Uj42YrTp6GHG2Du5eKimAqqtF1OfO/hPXW9B V5RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RL47DD7jczS4ueH47GPQF+C3dft0LjdpTt4m7Cc68+Y=; b=n7uJ3h2UEztP9fOEkRKV17JnzKQ0fx+AgPmpD7ZxPbij5h3ctkt1tXr7Xr/msGmozz Cc+LtXU7KZLDluXzl2f9RAisx0hC9xs5k/albXhQP+XXvLR9YJrIUyMs0hQMylYfDnoR NGbiizrm+yu9DaaSBl3xkUKhahLGine/dJYD4vnzXfL1NoLgDa4bQsoCk4aYXmR84+6e UX4NuRprQwAL4YQ0NWuxYSWnI8a/5NEp/v3mV3q1SHCTQNbySas3DpuBhbl2CYwdxSvC s6GgfPjna15SPSHjhfByzvxz/obhQ20NTt9hhlwhRU34swM/xkS6oCM8TI5/JUPxTR2b 4esw== X-Gm-Message-State: AOAM531wUJupvnKILH11+vBV2AUD0Iy/IHBE5BP4aGa89I/KBI6tJuwm rC/aIvC8u/gjjMbYgr/RV4+NqrPBtAUZFw== X-Google-Smtp-Source: ABdhPJwvicv5NhXw8lS6X/ZM4YMCOJi5+XqEJoii8mMx/X2/YoxpT3VVBHofO0cFeKixIibHUrnDWA== X-Received: by 2002:a05:6a00:14cb:b029:142:2501:34eb with SMTP id w11-20020a056a0014cbb0290142250134ebmr8046038pfu.68.1601573580733; Thu, 01 Oct 2020 10:33:00 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v6 4/4] win32: Simplify gmtime_r detection not depends on if _POSIX_C_SOURCE are defined on msys2/mingw Date: Fri, 2 Oct 2020 01:32:30 +0800 Message-Id: <20201001173230.829-5-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201001173230.829-1-luoyonggang@gmail.com> References: <20201001173230.829-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::543; envelope-from=luoyonggang@gmail.com; helo=mail-pg1-x543.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: QEMU Trivial , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Laurent Vivier , Yonggang Luo , Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" We remove the CONFIG_LOCALTIME_R detection option in configure, and move th= e check existence of gmtime_r from configure into C header and source directly by u= sing macro `_POSIX_THREAD_SAFE_FUNCTIONS`. Before this patch, the configure script are always assume the compiler does= n't define _POSIX_C_SOURCE macro at all, but that's not true, because thirdparty libra= ry such as ncursesw may define -D_POSIX_C_SOURCE in it's pkg-config file. And that = C Flags will added -D_POSIX_C_SOURCE into each QEMU_CFLAGS. And that's causing the follo= wing compiling error: n file included from C:/work/xemu/qemu/include/qemu/osdep.h:119, from ../softmmu/main.c:25: C:/work/xemu/qemu/include/sysemu/os-win32.h:53:12: error: redundant redecla= ration of 'gmtime_r' [-Werror=3Dredundant-decls] 53 | struct tm *gmtime_r(const time_t *timep, struct tm *result); | ^~~~~~~~ In file included from C:/work/xemu/qemu/include/qemu/osdep.h:94, from ../softmmu/main.c:25: C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/time.h:284:36: note: = previous definition of 'gmtime_r' was here 284 | __forceinline struct tm *__CRTDECL gmtime_r(const time_t *_Time, st= ruct tm *_Tm) { | ^~~~~~~~ In file included from C:/work/xemu/qemu/include/qemu/osdep.h:119, from ../softmmu/main.c:25: C:/work/xemu/qemu/include/sysemu/os-win32.h:55:12: error: redundant redecla= ration of 'localtime_r' [-Werror=3Dredundant-decls] 55 | struct tm *localtime_r(const time_t *timep, struct tm *result); | ^~~~~~~~~~~ In file included from C:/work/xemu/qemu/include/qemu/osdep.h:94, from ../softmmu/main.c:25: C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/time.h:281:36: note: = previous definition of 'localtime_r' was here 281 | __forceinline struct tm *__CRTDECL localtime_r(const time_t *_Time,= struct tm *_Tm) { | ^~~~~~~~~~~ Compiling C object libcommon.fa.p/hw_gpio_zaurus.c.obj In file included from C:/work/xemu/qemu/include/qemu/osdep.h:119, from ../hw/i2c/smbus_slave.c:16: C:/work/xemu/qemu/include/sysemu/os-win32.h:53:12: error: redundant redecla= ration of 'gmtime_r' [-Werror=3Dredundant-decls] 53 | struct tm *gmtime_r(const time_t *timep, struct tm *result); | ^~~~~~~~ In file included from C:/work/xemu/qemu/include/qemu/osdep.h:94, from ../hw/i2c/smbus_slave.c:16: C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/time.h:284:36: note: = previous definition of 'gmtime_r' was here 284 | __forceinline struct tm *__CRTDECL gmtime_r(const time_t *_Time, st= ruct tm *_Tm) { | ^~~~~~~~ In file included from C:/work/xemu/qemu/include/qemu/osdep.h:119, from ../hw/i2c/smbus_slave.c:16: C:/work/xemu/qemu/include/sysemu/os-win32.h:55:12: error: redundant redecla= ration of 'localtime_r' [-Werror=3Dredundant-decls] 55 | struct tm *localtime_r(const time_t *timep, struct tm *result); | ^~~~~~~~~~~ In file included from C:/work/xemu/qemu/include/qemu/osdep.h:94, from ../hw/i2c/smbus_slave.c:16: C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/time.h:281:36: note: = previous definition of 'localtime_r' was here 281 | __forceinline struct tm *__CRTDECL localtime_r(const time_t *_Time,= struct tm *_Tm) { | ^~~~~~~~~~~ Compiling C object libcommon.fa.p/hw_dma_xilinx_axidma.c.obj After this patch, whenever ncursesw or other thirdparty libraries tried to = define or not define _POSIX_C_SOURCE, the source will building properly. Because now, we= don't make any assumption if _POSIX_C_SOURCE are defined. We solely relied on if the macro= `_POSIX_THREAD_SAFE_FUNCTIONS` are defined in msys2/mingw header. The _POSIX_THREAD_SAFE_FUNCTIONS are defined in mingw header like this: ``` #if defined(_POSIX_C_SOURCE) && !defined(_POSIX_THREAD_SAFE_FUNCTIONS) #define _POSIX_THREAD_SAFE_FUNCTIONS 200112L #endif #ifdef _POSIX_THREAD_SAFE_FUNCTIONS __forceinline struct tm *__CRTDECL localtime_r(const time_t *_Time, struct = tm *_Tm) { return localtime_s(_Tm, _Time) ? NULL : _Tm; } __forceinline struct tm *__CRTDECL gmtime_r(const time_t *_Time, struct tm = *_Tm) { return gmtime_s(_Tm, _Time) ? NULL : _Tm; } __forceinline char *__CRTDECL ctime_r(const time_t *_Time, char *_Str) { return ctime_s(_Str, 0x7fffffff, _Time) ? NULL : _Str; } __forceinline char *__CRTDECL asctime_r(const struct tm *_Tm, char * _Str) { return asctime_s(_Str, 0x7fffffff, _Tm) ? NULL : _Str; } #endif ``` Signed-off-by: Yonggang Luo Reviewed-by: Daniel P. Berrang=C3=A9 --- configure | 34 ---------------------------------- include/sysemu/os-win32.h | 4 ++-- util/oslib-win32.c | 4 ++-- 3 files changed, 4 insertions(+), 38 deletions(-) diff --git a/configure b/configure index 8f7bdbfdd3..d6dd147235 100755 --- a/configure +++ b/configure @@ -2500,37 +2500,6 @@ if test "$vhost_net" =3D ""; then test "$vhost_kernel" =3D "yes" && vhost_net=3Dyes fi =20 -########################################## -# MinGW / Mingw-w64 localtime_r/gmtime_r check - -if test "$mingw32" =3D "yes"; then - # Some versions of MinGW / Mingw-w64 lack localtime_r - # and gmtime_r entirely. - # - # Some versions of Mingw-w64 define a macro for - # localtime_r/gmtime_r. - # - # Some versions of Mingw-w64 will define functions - # for localtime_r/gmtime_r, but only if you have - # _POSIX_THREAD_SAFE_FUNCTIONS defined. For fun - # though, unistd.h and pthread.h both define - # that for you. - # - # So this #undef localtime_r and #include - # are not in fact redundant. -cat > $TMPC << EOF -#include -#include -#undef localtime_r -int main(void) { localtime_r(NULL, NULL); return 0; } -EOF - if compile_prog "" "" ; then - localtime_r=3D"yes" - else - localtime_r=3D"no" - fi -fi - ########################################## # pkg-config probe =20 @@ -6937,9 +6906,6 @@ if [ "$bsd" =3D "yes" ] ; then echo "CONFIG_BSD=3Dy" >> $config_host_mak fi =20 -if test "$localtime_r" =3D "yes" ; then - echo "CONFIG_LOCALTIME_R=3Dy" >> $config_host_mak -fi if test "$qom_cast_debug" =3D "yes" ; then echo "CONFIG_QOM_CAST_DEBUG=3Dy" >> $config_host_mak fi diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h index d8978e28c0..5346d51e89 100644 --- a/include/sysemu/os-win32.h +++ b/include/sysemu/os-win32.h @@ -48,12 +48,12 @@ #define siglongjmp(env, val) longjmp(env, val) =20 /* Missing POSIX functions. Don't use MinGW-w64 macros. */ -#ifndef CONFIG_LOCALTIME_R +#ifndef _POSIX_THREAD_SAFE_FUNCTIONS #undef gmtime_r struct tm *gmtime_r(const time_t *timep, struct tm *result); #undef localtime_r struct tm *localtime_r(const time_t *timep, struct tm *result); -#endif /* CONFIG_LOCALTIME_R */ +#endif /* _POSIX_THREAD_SAFE_FUNCTIONS */ =20 static inline void os_setup_signal_handling(void) {} static inline void os_daemonize(void) {} diff --git a/util/oslib-win32.c b/util/oslib-win32.c index 051afb217b..e99debfb8d 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -106,7 +106,7 @@ void qemu_anon_ram_free(void *ptr, size_t size) } } =20 -#ifndef CONFIG_LOCALTIME_R +#ifndef _POSIX_THREAD_SAFE_FUNCTIONS /* FIXME: add proper locking */ struct tm *gmtime_r(const time_t *timep, struct tm *result) { @@ -130,7 +130,7 @@ struct tm *localtime_r(const time_t *timep, struct tm *= result) } return p; } -#endif /* CONFIG_LOCALTIME_R */ +#endif /* _POSIX_THREAD_SAFE_FUNCTIONS */ =20 static int socket_error(void) { --=20 2.28.0.windows.1