From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.lisp.guile.user Subject: Re: guile 2.0.9 build on mingw Date: Sun, 16 Jun 2013 18:48:37 +0300 Message-ID: <83txkyt5t6.fsf@gnu.org> References: <83sj1hv2ml.fsf@gnu.org> <874ndx9y7h.fsf@pobox.com> <83ip2bt4qk.fsf@gnu.org> <8761xqhyyt.fsf@gnu.org> <83li6mt18y.fsf@gnu.org> <83wqq3mcq9.fsf@gnu.org> <87k3m3kor5.fsf@gnu.org> <83ehcalysu.fsf@gnu.org> <87sj0pvl4a.fsf@tines.lan> <837gi1n3v5.fsf@gnu.org> <87k3m1vg8b.fsf@tines.lan> <83txl4lhby.fsf@gnu.org> <838v2fky99.fsf@gnu.org> <83hah2w2jr.fsf@gnu.org> <871u8214i8.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: ger.gmane.org 1371397738 25032 80.91.229.3 (16 Jun 2013 15:48:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 16 Jun 2013 15:48:58 +0000 (UTC) Cc: guile-user@gnu.org To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Jun 16 17:48:58 2013 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UoFCK-0006d7-0G for guile-user@m.gmane.org; Sun, 16 Jun 2013 17:48:56 +0200 Original-Received: from localhost ([::1]:33724 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoFCJ-0005Gv-N7 for guile-user@m.gmane.org; Sun, 16 Jun 2013 11:48:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoFC9-0005G0-0f for guile-user@gnu.org; Sun, 16 Jun 2013 11:48:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UoFC4-00042D-2D for guile-user@gnu.org; Sun, 16 Jun 2013 11:48:44 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:48797) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoFC3-00041m-Mc; Sun, 16 Jun 2013 11:48:39 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MOH00H00SN0P700@a-mtaout21.012.net.il>; Sun, 16 Jun 2013 18:48:38 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MOH00HC4T91L870@a-mtaout21.012.net.il>; Sun, 16 Jun 2013 18:48:38 +0300 (IDT) In-reply-to: <871u8214i8.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.169 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:10453 Archived-At: > From: ludo@gnu.org (Ludovic Court=C3=A8s) > Cc: mhw@netris.org, guile-user@gnu.org > Date: Sun, 16 Jun 2013 17:04:15 +0200 >=20 > Eli Zaretskii skribis: >=20 > > The changes below work around the lack of h_error on Windows: > > > > --- libguile/net_db.c~0=092013-03-25 23:44:46.000000000 +0200 > > +++ libguile/net_db.c=092013-06-13 13:30:20.448923200 +0300 > > @@ -55,6 +55,47 @@ > > #include "libguile/net_db.h" > > #include "libguile/socket.h" > > =20 > > +#ifdef __MINGW32__ > > +# define h_errno WSAGetLastError() > > +# define HAVE_H_ERRNO 1 > > +# define HAVE_HSTRERROR 1 > > +# ifdef HAVE_DECL_HSTRERROR > > +# undef HAVE_DECL_HSTRERROR > > +# endif > > +# define HAVE_DECL_HSTRERROR 1 > > +# define HOST_NOT_FOUND WSAHOST_NOT_FOUND > > +# define TRY_AGAIN WSATRY_AGAIN > > +# define NO_RECOVERY WSANO_RECOVERY > > +# define NO_DATA WSANO_DATA > > + > > +char *hstrerror (int); > > + > > +char * > > +hstrerror (int error_no) > > +{ > > + static char buf[500]; >=20 > Rather allocate it dynamically, with =E2=80=98scm_gc_malloc_pointer= less=E2=80=99. >=20 > > + DWORD ret; > > + > > + if (error_no =3D=3D 0) > > + error_no =3D WSAGetLastError (); > > + > > + ret =3D FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | > > + FORMAT_MESSAGE_IGNORE_INSERTS, > > + NULL, > > + error_no, > > + 0, /* choose most suitable language */ > > + buf, sizeof (buf), NULL); > > + > > + while (ret > 0 && (buf[ret - 1] =3D=3D '\n' || > > + buf[ret - 1] =3D=3D '\r' )) > > + --ret; > > + buf[ret] =3D '\0'; > > + if (!ret) > > + sprintf (buf, "Winsock error %u", error_no); > > + > > + return buf; > > +} > > +#endif=09/* __MINGW32__ */ >=20 > This looks good, but I feel that this ought to be in a Gnulib modul= e, > no? Would you like to propose such a module on bug-gnulib@? I will try. Thanks.