From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH 1/2] Use Jansson's error code support if available Date: Tue, 19 Dec 2017 19:11:05 +0200 Message-ID: <83zi6eod7a.fsf@gnu.org> References: <20171218231730.38840-1-phst@google.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1513703354 14624 195.159.176.226 (19 Dec 2017 17:09:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 19 Dec 2017 17:09:14 +0000 (UTC) Cc: phst@google.com, emacs-devel@gnu.org To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 19 18:09:10 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eRLOA-0003I5-24 for ged-emacs-devel@m.gmane.org; Tue, 19 Dec 2017 18:09:10 +0100 Original-Received: from localhost ([::1]:55111 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLQ8-0008HQ-1R for ged-emacs-devel@m.gmane.org; Tue, 19 Dec 2017 12:11:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLPt-0008FW-EX for emacs-devel@gnu.org; Tue, 19 Dec 2017 12:10:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRLPs-0008OH-9V for emacs-devel@gnu.org; Tue, 19 Dec 2017 12:10:57 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35162) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLPq-0008M4-65; Tue, 19 Dec 2017 12:10:54 -0500 Original-Received: from [176.228.60.248] (port=2320 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eRLPp-00007c-Ig; Tue, 19 Dec 2017 12:10:54 -0500 In-reply-to: <20171218231730.38840-1-phst@google.com> (message from Philipp Stephani on Tue, 19 Dec 2017 00:17:29 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:221249 Archived-At: > From: Philipp Stephani > Date: Tue, 19 Dec 2017 00:17:29 +0100 > Cc: Philipp Stephani > > * src/json.c (json_parse_error): Use Jansson's error code support if > available. > --- > src/json.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff --git a/src/json.c b/src/json.c > index 29e4400fc9..b996cad5a6 100644 > --- a/src/json.c > +++ b/src/json.c > @@ -249,15 +249,24 @@ static _Noreturn void > json_parse_error (const json_error_t *error) > { > Lisp_Object symbol; > - /* FIXME: Upstream Jansson should have a way to return error codes > - without parsing the error messages. See > - https://github.com/akheron/jansson/issues/352. */ > +#if JANSSON_VERSION_HEX >= 0x020B00 > + switch (json_error_code (error)) Would it be possible for you to add the few lines which would make this work on MS-Windows? It's pretty much boilerplate (you can see what I did for every jansson function we need, and copycat that), but if you don't add those few lines, the Windows build will fail to link. TIA