diff options
Diffstat (limited to 'compat/mingw.h')
-rw-r--r-- | compat/mingw.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/compat/mingw.h b/compat/mingw.h index 547568b918..61a652138a 100644 --- a/compat/mingw.h +++ b/compat/mingw.h @@ -22,9 +22,10 @@ typedef int socklen_t; #define S_IWOTH 0 #define S_IXOTH 0 #define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) -#define S_ISUID 0 -#define S_ISGID 0 -#define S_ISVTX 0 + +#define S_ISUID 0004000 +#define S_ISGID 0002000 +#define S_ISVTX 0001000 #define WIFEXITED(x) 1 #define WIFSIGNALED(x) 0 @@ -120,7 +121,7 @@ static inline int mingw_mkdir(const char *path, int mode) #define mkdir mingw_mkdir #define WNOHANG 1 -pid_t waitpid(pid_t pid, int *status, unsigned options); +pid_t waitpid(pid_t pid, int *status, int options); #define kill mingw_kill int mingw_kill(pid_t pid, int sig); @@ -190,6 +191,9 @@ char *mingw_getcwd(char *pointer, int len); char *mingw_getenv(const char *name); #define getenv mingw_getenv +int mingw_gethostname(char *host, int namelen); +#define gethostname mingw_gethostname + struct hostent *mingw_gethostbyname(const char *host); #define gethostbyname mingw_gethostbyname @@ -271,9 +275,9 @@ int mingw_utime(const char *file_name, const struct utimbuf *times); pid_t mingw_spawnvpe(const char *cmd, const char **argv, char **env, const char *dir, int fhin, int fhout, int fherr); -void mingw_execvp(const char *cmd, char *const *argv); +int mingw_execvp(const char *cmd, char *const *argv); #define execvp mingw_execvp -void mingw_execv(const char *cmd, char *const *argv); +int mingw_execv(const char *cmd, char *const *argv); #define execv mingw_execv static inline unsigned int git_ntohl(unsigned int x) @@ -300,6 +304,15 @@ int winansi_fprintf(FILE *stream, const char *format, ...) __attribute__((format #define has_dos_drive_prefix(path) (isalpha(*(path)) && (path)[1] == ':') #define is_dir_sep(c) ((c) == '/' || (c) == '\\') +static inline char *mingw_find_last_dir_sep(const char *path) +{ + char *ret = NULL; + for (; *path; ++path) + if (is_dir_sep(*path)) + ret = (char *)path; + return ret; +} +#define find_last_dir_sep mingw_find_last_dir_sep #define PATH_SEP ';' #define PRIuMAX "I64u" |