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

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

Re: w32 build fails with mingw runtime 3.6


From: Alejandro López-Valencia
Subject: Re: w32 build fails with mingw runtime 3.6
Date: Thu, 13 Jan 2005 10:20:40 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041206 Thunderbird/1.0 Mnenhy/0.6.0.104

On 13/01/2005 08:32 a.m., Kim F. Storm wrote:
Alejandro López-Valencia <address@hidden> writes:



I just noticed that I shouldn't have mixed S_ISLNK with S_IFLNK, this new version fixes that. Sorry :-)

<legalese>
If someone asks, I'm making an irrevokable donation to the FSF,
regardless its acceptance.
</legalese>

Cheers

--
Alejandro López-Valencia         <http://dradul.tripod.com/>

Lo que Natura non da, Salamanca non presta.
                                 Francisco Quevedo y Villegas

2005-01-13  Alejandro López-Valencia <address@hidden>

        * s/ms-w32.h: Mingw Runtime 3.6 (and later versions?) has a
        non-functional implementation of S_ISLNK, _S_ISLNK, S_IFLNK and
        _S_FLNK in sys/stat.h. As well it includes definitions for lstat
        and _lstat. Added an #ifdef for Mingw GCC that defines the
        symbols BROKEN_S_ISLNK, BROKEN_S_IFLNK and HAS_LSTAT.
        
        * fileio.c: Disabled broken symlink handling code when using
        Mingw GCC and lstat redefinition with the help of the new
        symbols defined in s/ms-w32.h
? makefile
Index: fileio.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/fileio.c,v
retrieving revision 1.524
diff -c -r1.524 fileio.c
*** fileio.c    30 Dec 2004 12:28:41 -0000      1.524
--- fileio.c    13 Jan 2005 15:15:30 -0000
***************
*** 144,150 ****
  #define O_RDONLY 0
  #endif
  
! #ifndef S_ISLNK
  #  define lstat stat
  #endif
  
--- 144,150 ----
  #define O_RDONLY 0
  #endif
  
! #if !defined(S_ISLNK) && !defined(HAS_LSTAT)
  #  define lstat stat
  #endif
  
***************
*** 2491,2497 ****
      }
  #endif
  
! #if defined (S_ISREG) && defined (S_ISLNK)
    if (input_file_statable_p)
      {
        if (!(S_ISREG (st.st_mode)) && !(S_ISLNK (st.st_mode)))
--- 2491,2497 ----
      }
  #endif
  
! #if defined (S_ISREG) && defined (S_ISLNK) && !defined(BROKEN_S_ISLNK)
    if (input_file_statable_p)
      {
        if (!(S_ISREG (st.st_mode)) && !(S_ISLNK (st.st_mode)))
***************
*** 2729,2735 ****
      {
        if (errno == EXDEV)
        {
! #ifdef S_IFLNK
            symlink_target = Ffile_symlink_p (file);
            if (! NILP (symlink_target))
              Fmake_symbolic_link (symlink_target, newname,
--- 2729,2735 ----
      {
        if (errno == EXDEV)
        {
! #if defined(S_IFLNK) && !defined(BROKEN_S_IFLNK)
            symlink_target = Ffile_symlink_p (file);
            if (! NILP (symlink_target))
              Fmake_symbolic_link (symlink_target, newname,
***************
*** 2819,2825 ****
    return Qnil;
  }
  
! #ifdef S_IFLNK
  DEFUN ("make-symbolic-link", Fmake_symbolic_link, Smake_symbolic_link, 2, 3,
         "FMake symbolic link to file: \nFMake symbolic link to file %s: \np",
         doc: /* Make a symbolic link to FILENAME, named LINKNAME.  Both args 
strings.
--- 2819,2825 ----
    return Qnil;
  }
  
! #if defined(S_IFLNK) && !defined(BROKEN_S_IFLNK)
  DEFUN ("make-symbolic-link", Fmake_symbolic_link, Smake_symbolic_link, 2, 3,
         "FMake symbolic link to file: \nFMake symbolic link to file %s: \np",
         doc: /* Make a symbolic link to FILENAME, named LINKNAME.  Both args 
strings.
***************
*** 3225,3231 ****
    if (!NILP (handler))
      return call2 (handler, Qfile_symlink_p, filename);
  
! #ifdef S_IFLNK
    {
    char *buf;
    int bufsize;
--- 3225,3231 ----
    if (!NILP (handler))
      return call2 (handler, Qfile_symlink_p, filename);
  
! #if defined(S_IFLNK) && !defined(BROKEN_S_IFLNK)
    {
    char *buf;
    int bufsize;
***************
*** 6681,6687 ****
    defsubr (&Sdelete_file);
    defsubr (&Srename_file);
    defsubr (&Sadd_name_to_file);
! #ifdef S_IFLNK
    defsubr (&Smake_symbolic_link);
  #endif /* S_IFLNK */
  #ifdef VMS
--- 6681,6687 ----
    defsubr (&Sdelete_file);
    defsubr (&Srename_file);
    defsubr (&Sadd_name_to_file);
! #if defined(S_IFLNK) && !defined(BROKEN_S_IFLNK)
    defsubr (&Smake_symbolic_link);
  #endif /* S_IFLNK */
  #ifdef VMS
Index: s/ms-w32.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/s/ms-w32.h,v
retrieving revision 1.30
diff -c -r1.30 ms-w32.h
*** s/ms-w32.h  1 Sep 2003 15:45:58 -0000       1.30
--- s/ms-w32.h  13 Jan 2005 15:15:33 -0000
***************
*** 490,495 ****
--- 490,505 ----
  #define DebPrint(stuff)
  #endif
  
+ /* Mingw Runtime 3.6, the latest version as of this writing, has
+    a broken implementation of S_ISLNK, _S_ISLNK, S_IFLNK and _S_IFLNK
+    in sys/stat.h. As well it provides its own definitions of lstat and
+    _lstat. */
+ 
+ #if defined __MINGW32__
+ #define BROKEN_S_ISLNK 1
+ #define BROKEN_S_IFLNK 1
+ #define HAS_LSTAT 1
+ #endif
  
  /* ============================================================ */
  

reply via email to

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