bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Eli Zaretskii
Subject: bug#60311: json-available-p: make dynamically correct for Windows
Date: Sun, 25 Dec 2022 19:26:59 +0200

> Cc: 60311@debbugs.gnu.org
> Date: Sun, 25 Dec 2022 18:24:54 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> 
> 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]