From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#60311: json-available-p: make dynamically correct for Windows Date: Sun, 25 Dec 2022 18:24:54 +0200 Message-ID: <83v8lz30yx.fsf@gnu.org> References: <83wn6f330g.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39159"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60311@debbugs.gnu.org To: mattias.engdegard@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 25 17:25:17 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p9ToK-000A2G-5n for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Dec 2022 17:25:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p9To7-0001s0-J2; Sun, 25 Dec 2022 11:25:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p9To6-0001rn-76 for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 11:25:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p9To5-0004mt-V0 for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 11:25:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p9To5-00059r-Mj for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 11:25:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Dec 2022 16:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60311 X-GNU-PR-Package: emacs Original-Received: via spool by 60311-submit@debbugs.gnu.org id=B60311.167198550119824 (code B ref 60311); Sun, 25 Dec 2022 16:25:01 +0000 Original-Received: (at 60311) by debbugs.gnu.org; 25 Dec 2022 16:25:01 +0000 Original-Received: from localhost ([127.0.0.1]:50016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9To4-00059a-QB for submit@debbugs.gnu.org; Sun, 25 Dec 2022 11:25:01 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9To3-00059N-1I for 60311@debbugs.gnu.org; Sun, 25 Dec 2022 11:24:59 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p9Tnx-0004jo-R5; Sun, 25 Dec 2022 11:24:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=UGCNTx/qD2/CV780Z351AsQsC+/bENp6grdgJ2pnY4Q=; b=R+8Uwc7G1Deo kig7jPgCUCPMxbS15fIg0sYZxXoX56lWrLFEYr8ZxzuMvZsZCoRQXKfq4oWHUtKAW67NmQGJkq3T8 YFOsEWxPhCJp4ZtxcCAI5Ap/qMnS+OJOoJuKvodItjw2JDTncFED8cO3DO3pZmwh8WiKP7i4TuMpq QXq+zZk8falSml5YhGqAckSHSXIMr+0P5SoCvTb/mJ0pYI3q+IYbWMXguz6vLWR/udrYjD1cJ4hTM CgTRraqZRi/mIkYvY3l/Lgy3g4vbL7vZWlE5aF54guCUx1EkHxtikOnz+6R1aCHAGGhagfAUDfC1C zZGQ+YaVFb/w7FZ58GT+hQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p9Tnx-0000uo-5u; Sun, 25 Dec 2022 11:24:53 -0500 In-Reply-To: <83wn6f330g.fsf@gnu.org> (message from Eli Zaretskii on Sun, 25 Dec 2022 17:40:47 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:251857 Archived-At: > Cc: 60311@debbugs.gnu.org > Date: Sun, 25 Dec 2022 17:40:47 +0200 > From: Eli Zaretskii > > AFAIU, we just need a C implementation of json-available-p, since > doing this in Lisp doesn't work. This came out too ambiguous. So here's a more accurate request: please make your json_available_p use the same code as the first part of the below: #ifdef WINDOWSNT if (!json_initialized) { Lisp_Object status; json_initialized = init_json_functions (); status = json_initialized ? Qt : Qnil; Vlibrary_cache = Fcons (Fcons (Qjson, status), Vlibrary_cache); } if (!json_initialized) Fsignal (Qjson_unavailable, list1 (build_unibyte_string ("jansson library not found"))); #endif and your ensure_json_available use the second part of the above. There's no reason to reshuffle the code that works. Also, please make ensure_json_available specific to WINDOWSNT, so that we don't pay an extra function call on Posix platforms. And finally, json--available-p should be defined on all platforms that compile json.c, not just on WINDOWSNT; it should return t on Posix platforms. Thanks.