This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: X_OK redefinition protection for Cygwin.


I've included a new a more appropriate patch.

Earnie.
2001-04-22  Earnie Boyd  <earnie@users.sourceforge.net>

	* include/sys/unistd.h (X_OK): Better protection for CYGWIN specific
	needs to prevent redefinition warnings when including both Newlib's
	sys/unistd.h and Cygwin's sys/file.h.

Index: unistd.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/unistd.h,v
retrieving revision 1.20
diff -p -u -r1.20 unistd.h
--- unistd.h	2001/04/13 15:37:47	1.20
+++ unistd.h	2001/04/22 14:14:24
@@ -131,13 +131,13 @@ int     _EXFUN(symlink, (const char *__n
 # define	F_OK	0
 # define	R_OK	4
 # define	W_OK	2
-# define	X_OK	1
 
-#if defined (__CYGWIN__) && !defined (__INSIDE_CYGWIN__)
-# undef		X_OK
+#if !defined (__CYGWIN__) || defined (__INSIDE_CYGWIN__)
+# define	X_OK	1
+#else /* defined (__CYGWIN__) */
+  extern const unsigned _cygwin_X_OK;
 # define X_OK	_cygwin_X_OK
-extern const unsigned _cygwin_X_OK;
-#endif
+#endif /* defined (__CYGWIN__) */
 
 # define	SEEK_SET	0
 # define	SEEK_CUR	1

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]