GNU bug report logs - #60311
json-available-p: make dynamically correct for Windows

Previous Next

Package: emacs;

Reported by: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>

Date: Sun, 25 Dec 2022 14:33:01 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 60311 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: mattias.engdegard <at> gmail.com
Cc: 60311 <at> debbugs.gnu.org
Subject: Re: bug#60311: json-available-p: make dynamically correct for Windows
Date: Sun, 25 Dec 2022 18:24:54 +0200
> Cc: 60311 <at> debbugs.gnu.org
> Date: Sun, 25 Dec 2022 17:40:47 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> 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.




This bug report was last modified 2 years and 201 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.