[Top][All Lists]
[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 09:55:54 -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:
Mingw Runtime 3.6 provides definitions for S_ISLNK, _S_ISLNK, S_IFLNK,
_S_IFLNK and _lstat. Most of these definitions are non-functional, and
break fileio.c.
I am attaching a diff with the modifications I used to build CVS HEAD as
of January 12. I'm not sure it is the proper solution to the problem,
though.
-#ifdef S_ISLNK
+#if defined(S_ISLNK) && !defined(__MINGW32__)
It would be more consitent with emacs coding practice if you put a
define like this in the relevant src/s/???.h header file:
#if defined(__MINGW32__)
#define BROKEN_S_ISLNK 1
#endif
and then use tests like this:
+#if defined(S_ISLNK) && !defined(BROKEN_S_ISLNK)
etc.
OK, here is a new version of the patch with your suggestions and a
matching Changelog entry. As well, it is now a proper context diff.
<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 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
? alloc.c.2004-01-05
? 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 14:53:39 -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_ISLNK)
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_ISLNK)
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_ISLNK)
{
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_ISLNK)
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 14:53:40 -0000
***************
*** 490,495 ****
--- 490,504 ----
#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 HAS_LSTAT 1
+ #endif
/* ============================================================ */