@matheusbsbs / matheus-bagliano / commits / e7cf4e94c6
Fork 0

MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>

Sebastian Schuberth committed Dec 28, 2009 at 18:04 UTC e7cf4e94c6f147953af4d079ca2e9ef0d7a29ae9
1 file changed +6 -5
compat/mingw.h
+6 -5
@@ -6,6 +6,7 @@
6 */
7
8 typedef int pid_t;
9 +typedef int uid_t;
10 #define hstrerror strerror
11
12 #define S_IFLNK 0120000 /* Symbolic link */
@@ -75,17 +76,17 @@ static inline int symlink(const char *oldpath, const char *newpath)
76 { errno = ENOSYS; return -1; }
77 static inline int fchmod(int fildes, mode_t mode)
78 { errno = ENOSYS; return -1; }
78 -static inline int fork(void)
79 +static inline pid_t fork(void)
80 { errno = ENOSYS; return -1; }
81 static inline unsigned int alarm(unsigned int seconds)
82 { return 0; }
83 static inline int fsync(int fd)
84 { return _commit(fd); }
84 -static inline int getppid(void)
85 +static inline pid_t getppid(void)
86 { return 1; }
87 static inline void sync(void)
88 {}
88 -static inline int getuid()
89 +static inline uid_t getuid(void)
90 { return 1; }
91 static inline struct passwd *getpwnam(const char *name)
92 { return NULL; }
@@ -117,7 +118,7 @@ static inline int mingw_unlink(const char *pathname)
118 }
119 #define unlink mingw_unlink
120
120 -static inline int waitpid(pid_t pid, int *status, unsigned options)
121 +static inline pid_t waitpid(pid_t pid, int *status, unsigned options)
122 {
123 if (options == 0)
124 return _cwait(status, pid, 0);
@@ -158,7 +159,7 @@ int poll(struct pollfd *ufds, unsigned int nfds, int timeout);
159 struct tm *gmtime_r(const time_t *timep, struct tm *result);
160 struct tm *localtime_r(const time_t *timep, struct tm *result);
161 int getpagesize(void); /* defined in MinGW's libgcc.a */
161 -struct passwd *getpwuid(int uid);
162 +struct passwd *getpwuid(uid_t uid);
163 int setitimer(int type, struct itimerval *in, struct itimerval *out);
164 int sigaction(int sig, struct sigaction *in, struct sigaction *out);
165 int link(const char *oldpath, const char *newpath);