diff options
-rw-r--r-- | include/mingw.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/include/mingw.h b/include/mingw.h index ea70313ff..9d102a93f 100644 --- a/include/mingw.h +++ b/include/mingw.h | |||
@@ -156,6 +156,15 @@ NOIMPL(ioctl,int fd UNUSED_PARAM, int code UNUSED_PARAM,...); | |||
156 | */ | 156 | */ |
157 | #define hstrerror strerror | 157 | #define hstrerror strerror |
158 | 158 | ||
159 | #ifdef CONFIG_WIN32_NET | ||
160 | struct hostent *mingw_gethostbyname(const char *host); | ||
161 | int mingw_socket(int domain, int type, int protocol); | ||
162 | int mingw_connect(int sockfd, struct sockaddr *sa, size_t sz); | ||
163 | |||
164 | # define gethostbyname mingw_gethostbyname | ||
165 | # define socket mingw_socket | ||
166 | # define connect mingw_connect | ||
167 | #else | ||
159 | NOIMPL(mingw_socket,int domain UNUSED_PARAM, int type UNUSED_PARAM, int protocol UNUSED_PARAM); | 168 | NOIMPL(mingw_socket,int domain UNUSED_PARAM, int type UNUSED_PARAM, int protocol UNUSED_PARAM); |
160 | NOIMPL(mingw_sendto,SOCKET s UNUSED_PARAM, const char *buf UNUSED_PARAM, int len UNUSED_PARAM, int flags UNUSED_PARAM, const struct sockaddr *sa UNUSED_PARAM, int salen UNUSED_PARAM); | 169 | NOIMPL(mingw_sendto,SOCKET s UNUSED_PARAM, const char *buf UNUSED_PARAM, int len UNUSED_PARAM, int flags UNUSED_PARAM, const struct sockaddr *sa UNUSED_PARAM, int salen UNUSED_PARAM); |
161 | NOIMPL(mingw_listen,SOCKET s UNUSED_PARAM,int backlog UNUSED_PARAM); | 170 | NOIMPL(mingw_listen,SOCKET s UNUSED_PARAM,int backlog UNUSED_PARAM); |
@@ -166,6 +175,7 @@ NOIMPL(mingw_bind,SOCKET s UNUSED_PARAM,const struct sockaddr* sa UNUSED_PARAM,i | |||
166 | #define sendto mingw_sendto | 175 | #define sendto mingw_sendto |
167 | #define listen mingw_listen | 176 | #define listen mingw_listen |
168 | #define bind mingw_bind | 177 | #define bind mingw_bind |
178 | #endif | ||
169 | 179 | ||
170 | /* | 180 | /* |
171 | * sys/stat.h | 181 | * sys/stat.h |
@@ -226,7 +236,7 @@ int waitpid(pid_t pid, int *status, unsigned options); | |||
226 | */ | 236 | */ |
227 | struct tm *gmtime_r(const time_t *timep, struct tm *result); | 237 | struct tm *gmtime_r(const time_t *timep, struct tm *result); |
228 | struct tm *localtime_r(const time_t *timep, struct tm *result); | 238 | struct tm *localtime_r(const time_t *timep, struct tm *result); |
229 | IMPL(strptime,char*,NULL,const char *s UNUSED_PARAM, const char *format UNUSED_PARAM, struct tm *tm UNUSED_PARAM); | 239 | char *strptime(const char *s, const char *format, struct tm *tm); |
230 | 240 | ||
231 | /* | 241 | /* |
232 | * unistd.h | 242 | * unistd.h |
@@ -268,10 +278,13 @@ NOIMPL(setuid,uid_t gid UNUSED_PARAM); | |||
268 | unsigned int sleep(unsigned int seconds); | 278 | unsigned int sleep(unsigned int seconds); |
269 | NOIMPL(symlink,const char *oldpath UNUSED_PARAM, const char *newpath UNUSED_PARAM); | 279 | NOIMPL(symlink,const char *oldpath UNUSED_PARAM, const char *newpath UNUSED_PARAM); |
270 | static inline void sync(void) {} | 280 | static inline void sync(void) {} |
281 | int mingw_unlink(const char *pathname); | ||
271 | NOIMPL(vfork,void); | 282 | NOIMPL(vfork,void); |
272 | 283 | ||
284 | //#define dup mingw_dup | ||
273 | #define getcwd mingw_getcwd | 285 | #define getcwd mingw_getcwd |
274 | #define lchown(a,b,c) chown(a,b,c) | 286 | #define lchown(a,b,c) chown(a,b,c) |
287 | #define unlink mingw_unlink | ||
275 | 288 | ||
276 | /* | 289 | /* |
277 | * utime.h | 290 | * utime.h |
@@ -286,8 +299,20 @@ NOIMPL(utimes,const char *filename UNUSED_PARAM, const struct timeval times[2] U | |||
286 | */ | 299 | */ |
287 | #define has_dos_drive_prefix(path) (isalpha(*(path)) && (path)[1] == ':') | 300 | #define has_dos_drive_prefix(path) (isalpha(*(path)) && (path)[1] == ':') |
288 | #define is_dir_sep(c) ((c) == '/' || (c) == '\\') | 301 | #define is_dir_sep(c) ((c) == '/' || (c) == '\\') |
302 | #define PATH_SEP ';' | ||
289 | #define PRIuMAX "I64u" | 303 | #define PRIuMAX "I64u" |
290 | 304 | ||
305 | pid_t mingw_spawn(char **argv); | ||
306 | int mingw_execv(const char *cmd, const char *const *argv); | ||
307 | int mingw_execvp(const char *cmd, const char *const *argv); | ||
308 | int mingw_execve(const char *cmd, const char *const *argv, const char *const *envp); | ||
309 | pid_t mingw_spawn_applet(int mode, const char *applet, const char *const *argv, const char *const *envp, int transfer_fd); | ||
310 | pid_t mingw_spawn_1(int mode, const char *cmd, const char *const *argv, const char *const *envp); | ||
311 | #define execvp mingw_execvp | ||
312 | #define execve mingw_execve | ||
313 | #define execv mingw_execv | ||
314 | |||
315 | |||
291 | /* | 316 | /* |
292 | * helpers | 317 | * helpers |
293 | */ | 318 | */ |