diff options
Diffstat (limited to 'compat')
-rw-r--r-- | compat/mingw.c | 2 | ||||
-rw-r--r-- | compat/mingw.h | 6 | ||||
-rw-r--r-- | compat/win32/pthread.h | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/compat/mingw.c b/compat/mingw.c index cfedcf9656..54c82ecf20 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1069,7 +1069,7 @@ static pid_t mingw_spawnve_fd(const char *cmd, const char **argv, char **deltaen free(quoted); } - wargs = xmalloc_array(st_add(st_mult(2, args.len), 1), sizeof(wchar_t)); + ALLOC_ARRAY(wargs, st_add(st_mult(2, args.len), 1)); xutftowcs(wargs, args.buf, 2 * args.len + 1); strbuf_release(&args); diff --git a/compat/mingw.h b/compat/mingw.h index 8c5bf5076b..c008694639 100644 --- a/compat/mingw.h +++ b/compat/mingw.h @@ -396,6 +396,12 @@ static inline char *mingw_find_last_dir_sep(const char *path) ret = (char *)path; return ret; } +static inline void convert_slashes(char *path) +{ + for (; *path; path++) + if (*path == '\\') + *path = '/'; +} #define find_last_dir_sep mingw_find_last_dir_sep int mingw_offset_1st_component(const char *path); #define offset_1st_component mingw_offset_1st_component diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h index 20b35a283c..b6ed9e7462 100644 --- a/compat/win32/pthread.h +++ b/compat/win32/pthread.h @@ -78,7 +78,7 @@ extern int win32_pthread_join(pthread_t *thread, void **value_ptr); #define pthread_equal(t1, t2) ((t1).tid == (t2).tid) extern pthread_t pthread_self(void); -static inline int pthread_exit(void *ret) +static inline void NORETURN pthread_exit(void *ret) { ExitThread((DWORD)(intptr_t)ret); } |