From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: [PATCH 1/2] Use Jansson's error code support if available Date: Tue, 19 Dec 2017 17:35:48 +0000 Message-ID: References: <20171218231730.38840-1-phst@google.com> <83zi6eod7a.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114844d86033b00560b4e6b7" X-Trace: blaine.gmane.org 1513705165 9332 195.159.176.226 (19 Dec 2017 17:39:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 19 Dec 2017 17:39:25 +0000 (UTC) Cc: phst@google.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 19 18:39:20 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 1eRLrL-00020c-F7 for ged-emacs-devel@m.gmane.org; Tue, 19 Dec 2017 18:39:19 +0100 Original-Received: from localhost ([::1]:56452 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLtJ-0005ta-Jb for ged-emacs-devel@m.gmane.org; Tue, 19 Dec 2017 12:41:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRLoA-00023i-Oy for emacs-devel@gnu.org; Tue, 19 Dec 2017 12:36:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRLo9-0001a7-FR for emacs-devel@gnu.org; Tue, 19 Dec 2017 12:36:02 -0500 Original-Received: from mail-qt0-x235.google.com ([2607:f8b0:400d:c0d::235]:44944) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRLo7-0001W6-RG; Tue, 19 Dec 2017 12:35:59 -0500 Original-Received: by mail-qt0-x235.google.com with SMTP id m59so25088889qte.11; Tue, 19 Dec 2017 09:35:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NBdaSRj71RMWmEHZ13rp3N4HKbBhyp+lhwY+7a+CxYU=; b=gALZSrP//NnYo0XpO+1vmNLfGYg51Gop5vUfImM1MMdv0DzIhWBj2mzt4qHKi7FvCa KqaoPyQ2vgAp1W4t1sDTreRlZvvOS8LLsGlQE8ELLMCz5/NzJLXg6uDUsa4PCBUaXACk e3btiLzoyGBti7yZM5L1tpZ4eiWCgyddk+gm1PMCp8DpGWdwVJ0m+VHMTPE7mCsooAtq RXymGYHfJ+ecwHJ8OnfBDOy1+IQoMVvormZXnYGa4DtKewC4t63A6kuCgqLAgGVstsaR JqEdS1WK3NRvEvMSdJ0S9Idgjs4w5bGwCHntKoLUoT2Jv+JwIZo5gkxr+lV9TnhPc+g1 gukw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NBdaSRj71RMWmEHZ13rp3N4HKbBhyp+lhwY+7a+CxYU=; b=EIo1OFDo3T0ghkb6R8cnfrh6wBmxo6DFgcxdG8pPko+5NBCKlOZ/utOLDX2wMeapHv WgH5+cPeu7UbZvj7gt+2RaOQEuFEYC+E2r0YmA/3XPDI3MCoC54JCqGS+IMgCOB8r2Tm QVGFuzSqGCn/ZQLLQ2wPJ+ocFbIuB1I4e7K36k213Yiq0GT2/LoyXZxGxOnb9vCfZxy7 v5bbCMlgmdiwP73cQB6uG8lp7ZSL1DZ/Bmp2ur7wsyyJvNRTEzoHJLP7MwzdEavO0KyU hwcc/R6VsHKKWlzHR3cI/O87l01vvOrkMrM8zSPr31TxIj/4Hh8SdpcnRDqSqZ14tgH5 +8yw== X-Gm-Message-State: AKGB3mL8BvJ2Bf6RzJSfotiG4ImUMCVwsvjtfrO/3r0zSocuF9RTNh41 fNpuYsL70oucSIaJ5n3QSq9lb7xHb8lKstL/far9Qg== X-Google-Smtp-Source: ACJfBov471P0Ti9YZdIX7GB/r5p6/y0nJVBJF1rPC5JVo5poP8qxOdcIAh+Tp5HgXs98XnOxHqpSUD8x7OtAHo+Knus= X-Received: by 10.200.28.44 with SMTP id a41mr6311698qtk.340.1513704958996; Tue, 19 Dec 2017 09:35:58 -0800 (PST) In-Reply-To: <83zi6eod7a.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::235 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:221252 Archived-At: --001a114844d86033b00560b4e6b7 Content-Type: text/plain; charset="UTF-8" Eli Zaretskii schrieb am Di., 19. Dez. 2017 um 18:11 Uhr: > > 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. > > The json_error_code function is inline, is it still necessary to load it from the DLL? --001a114844d86033b00560b4e6b7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= Di., 19. Dez. 2017 um 18:11=C2=A0Uhr:
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Tue, 19 Dec 2017 00:17:29 +0100
> Cc: Philipp Stephani <phst@google.com>
>
> * src/json.c (json_parse_error): Use Jansson's error code support = if
> available.
> ---
>=C2=A0 src/json.c | 15 ++++++++++++---
>=C2=A0 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
>=C2=A0 json_parse_error (const json_error_t *error)
>=C2=A0 {
>=C2=A0 =C2=A0 Lisp_Object symbol;
> -=C2=A0 /* FIXME: Upstream Jansson should have a way to return error c= odes
> -=C2=A0 =C2=A0 =C2=A0without parsing the error messages.=C2=A0 See
> -=C2=A0 =C2=A0 =C2=A0https://github.com/akheron/ja= nsson/issues/352.=C2=A0 */
> +#if JANSSON_VERSION_HEX >=3D 0x020B00
> +=C2=A0 switch (json_error_code (error))

Would it be possible for you to add the few lines which would make
this work on MS-Windows?=C2=A0 It's pretty much boilerplate (you can se= e
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.<= br>

The json_error_code function is inline= , is it still necessary to load it from the DLL?=C2=A0
--001a114844d86033b00560b4e6b7--