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]
Other format: [Raw text]

[PATCH] guard function declarations against type clashes when compiling Cygwin


2003-03-09  Corinna Vinschen  <corinna at vinschen dot de>

        * libc/include/pwd.h: Add guards to avoid type clashes when compiling
        Cygwin.
        * libc/include/sys/stat.h: Ditto.
        * libc/include/sys/unistd.h: Ditto.
        * libc/sys/cygwin/sys/dirent.h: Ditto.

Index: libc/include/pwd.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/pwd.h,v
retrieving revision 1.1.1.1
diff -p -u -r1.1.1.1 pwd.h
--- libc/include/pwd.h	17 Feb 2000 19:39:46 -0000	1.1.1.1
+++ libc/include/pwd.h	9 Mar 2003 20:50:33 -0000
@@ -58,6 +58,7 @@ struct passwd {
 	char	*pw_shell;		/* default shell */
 };
 
+#ifndef __INSIDE_CYGWIN__
 struct passwd	*getpwuid (uid_t);
 struct passwd	*getpwnam (const char *);
 int 		 getpwnam_r (const char *, struct passwd *,
@@ -68,6 +69,7 @@ int		 getpwuid_r (uid_t, struct passwd *
 struct passwd	*getpwent (void);
 void		 setpwent (void);
 void		 endpwent (void);
+#endif
 #endif
 
 #ifdef __cplusplus
Index: libc/include/sys/stat.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/stat.h,v
retrieving revision 1.10
diff -p -u -r1.10 stat.h
--- libc/include/sys/stat.h	23 Feb 2002 20:46:28 -0000	1.10
+++ libc/include/sys/stat.h	9 Mar 2003 20:50:33 -0000
@@ -127,7 +127,7 @@ int	_EXFUN(mkfifo,( const char *__path, 
 int	_EXFUN(stat,( const char *__path, struct stat *__sbuf ));
 mode_t	_EXFUN(umask,( mode_t __mask ));
 
-#if defined(__rtems__) || defined(__CYGWIN__)
+#if defined(__rtems__) || defined(__CYGWIN__) && !defined(__INSIDE_CYGWIN__)
 int	_EXFUN(lstat,( const char *__path, struct stat *__buf ));
 int	_EXFUN(mknod,( const char *__path, mode_t __mode, dev_t __dev ));
 #endif
Index: libc/include/sys/unistd.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/unistd.h,v
retrieving revision 1.40
diff -p -u -r1.40 unistd.h
--- libc/include/sys/unistd.h	8 Mar 2003 04:57:41 -0000	1.40
+++ libc/include/sys/unistd.h	9 Mar 2003 20:50:35 -0000
@@ -20,7 +20,9 @@ int	_EXFUN(access,(const char *__path, i
 unsigned  _EXFUN(alarm, (unsigned __secs ));
 int     _EXFUN(chdir, (const char *__path ));
 int     _EXFUN(chmod, (const char *__path, mode_t __mode ));
+#if !defined(__INSIDE_CYGWIN__)
 int     _EXFUN(chown, (const char *__path, uid_t __owner, gid_t __group ));
+#endif
 #if defined(__CYGWIN__) || defined(__rtems__)
 int     _EXFUN(chroot, (const char *__path ));
 #endif
@@ -42,7 +44,9 @@ int     _EXFUN(execvp, (const char *__fi
 int     _EXFUN(fchdir, (int __fildes));
 #endif
 int     _EXFUN(fchmod, (int __fildes, mode_t __mode ));
+#if !defined(__INSIDE_CYGWIN__)
 int     _EXFUN(fchown, (int __fildes, uid_t __owner, gid_t __group ));
+#endif
 pid_t   _EXFUN(fork, (void ));
 long    _EXFUN(fpathconf, (int __fd, int __name ));
 int     _EXFUN(fsync, (int __fd));
@@ -50,9 +54,11 @@ char    _EXFUN(*getcwd, (char *__buf, si
 #if defined(__CYGWIN__)
 int	_EXFUN(getdomainname ,(char *__name, size_t __len));
 #endif
+#if !defined(__INSIDE_CYGWIN__)
 gid_t   _EXFUN(getegid, (void ));
 uid_t   _EXFUN(geteuid, (void ));
 gid_t   _EXFUN(getgid, (void ));
+#endif
 int     _EXFUN(getgroups, (int __gidsetsize, gid_t __grouplist[] ));
 char    _EXFUN(*getlogin, (void ));
 #if defined(_POSIX_THREAD_SAFE_FUNCTIONS)
@@ -67,17 +73,23 @@ pid_t   _EXFUN(getppid, (void ));
 #ifdef __CYGWIN__
 pid_t   _EXFUN(getsid, (pid_t));
 #endif
+#if !defined(__INSIDE_CYGWIN__)
 uid_t   _EXFUN(getuid, (void ));
+#endif
 #ifdef __CYGWIN__
 char *	_EXFUN(getusershell, (void));
 char    _EXFUN(*getwd, (char *__buf ));
 int	_EXFUN(iruserok, (unsigned long raddr, int superuser, const char *ruser, const char *luser));
 #endif
 int     _EXFUN(isatty, (int __fildes ));
+#if !defined(__INSIDE_CYGWIN__)
 int     _EXFUN(lchown, (const char *__path, uid_t __owner, gid_t __group ));
+#endif
 int     _EXFUN(link, (const char *__path1, const char *__path2 ));
 int	_EXFUN(nice, (int __nice_value ));
+#if !defined(__INSIDE_CYGWIN__)
 off_t   _EXFUN(lseek, (int __fildes, off_t __offset, int __whence ));
+#endif
 long    _EXFUN(pathconf, (const char *__path, int __name ));
 int     _EXFUN(pause, (void ));
 #ifdef __CYGWIN__
@@ -96,22 +108,26 @@ int     _EXFUN(rmdir, (const char *__pat
 int	_EXFUN(ruserok, (const char *rhost, int superuser, const char *ruser, const char *luser));
 #endif
 void *  _EXFUN(sbrk,  (ptrdiff_t __incr));
+#if !defined(__INSIDE_CYGWIN__)
 #if defined(__CYGWIN__)
 int     _EXFUN(setegid, (gid_t __gid ));
 int     _EXFUN(seteuid, (uid_t __uid ));
 #endif
 int     _EXFUN(setgid, (gid_t __gid ));
+#endif
 #if defined(__CYGWIN__)
 int	_EXFUN(setgroups, (int ngroups, const gid_t *grouplist ));
 #endif
 int     _EXFUN(setpgid, (pid_t __pid, pid_t __pgid ));
 int     _EXFUN(setpgrp, (void ));
-#if defined(__CYGWIN__)
+#if defined(__CYGWIN__) && !defined(__INSIDE_CYGWIN__)
 int	_EXFUN(setregid, (gid_t __rgid, gid_t __egid));
 int	_EXFUN(setreuid, (uid_t __ruid, uid_t __euid));
 #endif
 pid_t   _EXFUN(setsid, (void ));
+#if !defined(__INSIDE_CYGWIN__)
 int     _EXFUN(setuid, (uid_t __uid ));
+#endif
 #if defined(__CYGWIN__)
 void	_EXFUN(setusershell, (void));
 #endif
@@ -161,8 +177,10 @@ int	_EXFUN(getdtablesize, (void));
 int	_EXFUN(setdtablesize, (int));
 useconds_t _EXFUN(ualarm, (useconds_t __useconds, useconds_t __interval));
 unsigned _EXFUN(usleep, (unsigned int __useconds));
+#if !defined(__INSIDE_CYGWIN__)
 int     _EXFUN(ftruncate, (int __fd, off_t __length));
 int     _EXFUN(truncate, (const char *, off_t __length));
+#endif
 #if !(defined  (_WINSOCK_H) || defined (__USE_W32_SOCKETS))
 /* winsock[2].h defines as __stdcall, and with int as 2nd arg */
  int	_EXFUN(gethostname, (char *__name, size_t __len));
Index: libc/sys/cygwin/sys/dirent.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/sys/cygwin/sys/dirent.h,v
retrieving revision 1.7
diff -p -u -r1.7 dirent.h
--- libc/sys/cygwin/sys/dirent.h	23 Feb 2002 14:37:29 -0000	1.7
+++ libc/sys/cygwin/sys/dirent.h	9 Mar 2003 20:50:35 -0000
@@ -57,8 +57,10 @@ int closedir (DIR *);
 int dirfd (DIR *);
 
 #ifndef _POSIX_SOURCE
+#ifndef __INSIDE_CYGWIN__
 off_t telldir (DIR *);
 void seekdir (DIR *, off_t loc);
+#endif
 
 int scandir (const char *__dir,
 	     struct dirent ***__namelist,

-- 
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.
mailto:vinschen at redhat dot com


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