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 19:26:59 +0200 Message-ID: <83sfh32y3g.fsf@gnu.org> References: <83wn6f330g.fsf@gnu.org> <83v8lz30yx.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8880"; 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 18:28:24 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 1p9UnO-00027S-6Y for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Dec 2022 18:28:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p9Un6-0004RK-Ey; Sun, 25 Dec 2022 12:28:04 -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 1p9Un4-0004R7-JA for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 12:28: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 1p9Un4-000566-1r for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 12:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p9Un3-0007LO-U3 for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 12:28: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 17:28: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.167198922528131 (code B ref 60311); Sun, 25 Dec 2022 17:28:01 +0000 Original-Received: (at 60311) by debbugs.gnu.org; 25 Dec 2022 17:27:05 +0000 Original-Received: from localhost ([127.0.0.1]:50077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9Um9-0007Je-92 for submit@debbugs.gnu.org; Sun, 25 Dec 2022 12:27:05 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47388) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9Um6-0007J1-J7 for 60311@debbugs.gnu.org; Sun, 25 Dec 2022 12:27:03 -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 1p9Um1-0004sj-Cv; Sun, 25 Dec 2022 12:26:57 -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=+y7NeKQpoN1B7sov/bPbzbQp4Cdzw3RHeXWK1WyIRh4=; b=qP64MNTuJR5M pPjbc9pPXT2dubndQPbh2u8T+Ngd/Bc4OUkg4Ce3bHxXKRITpgoYVer+2hL3cOZb5I6q9HsyMbVNw qMeStwstrLWMEj5jwAOG92PKSmrHjCT1mg2eRRlp3t6eib7rqC/spbXKkMdazwzze7ztv+Me61BKL tobf/Z8YJl5Dz3gRPJsX4X2SaABOc6syceSS6dz3h3gkpYdC/Ugp5WJPAFZSXftg0/gFodKHr+wKp O/LS6D98umF78KH67R3a6MFcUWxlzZBnTNDvzC61n93ZbnNPVJMDMJRhLGUE5KHVr9QlSqZDYIs0S 3RytN2sf5WPpgSzucuq7SA==; 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 1p9Um0-00032I-TM; Sun, 25 Dec 2022 12:26:57 -0500 In-Reply-To: <83v8lz30yx.fsf@gnu.org> (message from Eli Zaretskii on Sun, 25 Dec 2022 18:24:54 +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:251860 Archived-At: > Cc: 60311@debbugs.gnu.org > Date: Sun, 25 Dec 2022 18:24:54 +0200 > From: Eli Zaretskii > > 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. The above is for the emacs-29 branch. I think on master we should compile json.c on all platforms, even if libjansson is not being linked against, and then have json--available-p always fboundp, so that test at run time will not be needed.