[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 16:38:45 -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 03:32 p.m., Eli Zaretskii wrote:
Date: Thu, 13 Jan 2005 07:50:41 -0500
From: =?ISO-8859-15?Q?Alejandro_L=F3pez-Valencia?= <address@hidden>
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.
How does the MinGW runtime define these macros and _lstat, what
exactly is non-functional about them, and why did they introduce those
definitions? Surely they didn't want to provide a non-functional
symlink support, did they?
I'm asking these questions because the answers might suggest what
would be the best way of dealing with these new misfeatures.
TIA
That's information that you may have more luck in extracting from them
than I ever would. My past interactions have been less than contructive.
To give you an idea, these are the changes done to sys/stat.h, as you'll
notice they did add the stat functions to the runtime library, but the
ISLNK and IFLNK macros are dummies:
diff -r -u mingw-old/sys/stat.h mingw/sys/stat.h
--- mingw-old/sys/stat.h 2004-09-05 09:19:00.001000000 -0500
+++ mingw/sys/stat.h 2005-01-02 11:17:54.001000000 -0500
@@ -26,6 +26,7 @@
/*
* Constants for the stat st_mode member.
*/
+#define _S_IFLNK 0xF000 /* Pretend */
#define _S_IFIFO 0x1000 /* FIFO */
#define _S_IFCHR 0x2000 /* Character */
#define _S_IFBLK 0x3000 /* Block: Is this ever set under w32? */
@@ -48,9 +49,11 @@
#define _S_ISCHR(m) (((m) & _S_IFMT) == _S_IFCHR)
#define _S_ISBLK(m) (((m) & _S_IFMT) == _S_IFBLK)
#define _S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
+#define _S_ISLNK(m) (((m) & _S_IFMT) == _S_IFLNK) /* Should always be
zero.*/
#ifndef _NO_OLDNAMES
+#define S_IFLNK _S_IFLNK
#define S_IFIFO _S_IFIFO
#define S_IFCHR _S_IFCHR
#define S_IFBLK _S_IFBLK
@@ -70,6 +73,7 @@
#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) /* Should always be zero.*/
#endif /* Not _NO_OLDNAMES */
@@ -155,6 +159,7 @@
_CRTIMP int __cdecl _fstat (int, struct _stat*);
_CRTIMP int __cdecl _chmod (const char*, int);
_CRTIMP int __cdecl _stat (const char*, struct _stat*);
+#define _lstat _stat
#ifndef _NO_OLDNAMES
@@ -162,6 +167,7 @@
_CRTIMP int __cdecl fstat (int, struct stat*);
_CRTIMP int __cdecl chmod (const char*, int);
_CRTIMP int __cdecl stat (const char*, struct stat*);
+#define lstat stat
#endif /* Not _NO_OLDNAMES */
--
Alejandro López-Valencia <http://dradul.tripod.com/>
Lo que Natura non da, Salamanca non presta.
Francisco Quevedo y Villegas