bug-m4
[Top][All Lists]
Advanced

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

Re: m4-1.4.2 freeze files on cygwin


From: Gary V. Vaughan
Subject: Re: m4-1.4.2 freeze files on cygwin
Date: Thu, 03 Feb 2005 17:21:31 +0000
User-agent: Mozilla Thunderbird 0.9 (X11/20041103)

Stepan Kasal wrote:
> Hello,
>       I'm forwarding your message to the bug-m4 list.
> Stepan Kasal
> 
> ----- message from Bolo <address@hidden> -----
> To: address@hidden
> Date: Thu, 30 Dec 2004 11:22:22 -0600
> 
> I noticed a problem with m4 freeze files that occurs in the cygwin
> environment.  I'm using a slightly older version of cygwin;
> haven't tested it against the current version.  However, this is
> a generic problem that can occur in any "non-unix" environment which
> uses something different than newline for line endings.
> 
> The problem is that the freeze-file parser assumes that a save-file is
> a unix style '\n' delimited  file.  However on win32 systems normal text
> files are \r\n delimited .... which causes the freeze file reader
> to choke when it finds a \r instead of the expected \n.

Thanks for the report,  I've applied the following patch to branch-1_4:

Index: ChangeLog
===================================================================
RCS file: /cvsroot/m4/m4/ChangeLog,v
retrieving revision 1.1.1.1.2.9
diff -u -p -u -r1.1.1.1.2.9 ChangeLog
--- ChangeLog   3 Feb 2005 16:43:10 -0000       1.1.1.1.2.9
+++ ChangeLog   3 Feb 2005 17:05:28 -0000
@@ -1,5 +1,15 @@
 2005-02-03  Gary V. Vaughan  <address@hidden>

+       * src/m4.h (__CYGWIN__, WIN32): Canonicalise Windows and Cygwin
+       recognition macros.
+       * src/freeze.c (produce_frozen_state): Use \n line-endings even
+       on Windows, so that the frozen file reader will work.
+       Reported by Josef T. Burger <address@hidden>
+
+2005-02-03  Gary V. Vaughan  <address@hidden>
+
        Modernise the configury a little to prevent spurious errors from
        Autoconf-2.59's autoreconf:

Index: src/freeze.c
===================================================================
RCS file: /cvsroot/m4/m4/src/freeze.c,v
retrieving revision 1.1.1.1.2.1
diff -u -p -u -r1.1.1.1.2.1 freeze.c
--- src/freeze.c        3 Feb 2005 16:43:12 -0000       1.1.1.1.2.1
+++ src/freeze.c        3 Feb 2005 17:05:28 -0000
@@ -53,7 +53,13 @@ produce_frozen_state (const char *name)
   symbol *sym;
   const builtin *bp;

-  if (file = fopen (name, "w"), !file)
+#ifdef WIN32
+# define FROZEN_WRITE "wb"
+#else
+# define FROZEN_WRITE "w"
+#endif
+
+  if (file = fopen (name, FROZEN_WRITE), !file)
     {
       M4ERROR ((warning_status, errno, name));
       return;
Index: src/m4.h
===================================================================
RCS file: /cvsroot/m4/m4/src/m4.h,v
retrieving revision 1.1.1.1.2.1
diff -u -p -u -r1.1.1.1.2.1 m4.h
--- src/m4.h    9 Jun 2004 10:53:27 -0000       1.1.1.1.2.1
+++ src/m4.h    3 Feb 2005 17:05:28 -0000
@@ -1,6 +1,6 @@
 /* GNU m4 -- A simple macro processor

-   Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004 Free
+   Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005 Free
    Software Foundation, Inc.

    This program is free software; you can redistribute it and/or modify
@@ -26,6 +26,14 @@
 # include <config.h>
 #endif

+/* Canonicalise Windows and Cygwin recognition macros.  */
+#if defined __CYGWIN32__ && !defined __CYGWIN__
+#  define __CYGWIN__ __CYGWIN32__
+#endif
+#if defined _WIN32 && !defined WIN32
+#  define WIN32 _WIN32
+#endif
+
 #include <sys/types.h>

 #ifdef __STDC__


Cheers,
        Gary.
-- 
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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