Skip to content

Commit

Permalink
windows: fix build on MinGW
Browse files Browse the repository at this point in the history
  • Loading branch information
huxingyi authored and saghul committed Aug 10, 2014
1 parent 09cb5b5 commit ca4741b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 14 additions & 0 deletions include/uv-win.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ typedef struct pollfd {
} WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;
#endif

#ifndef LOCALE_INVARIANT
# define LOCALE_INVARIANT 0x007f
#endif

#ifndef _malloca
# if defined(_DEBUG)
# define _malloca(size) malloc(size)
# define _freea(ptr) free(ptr)
# else
# define _malloca(size) alloca(size)
# define _freea(ptr)
# endif
#endif

#include <mswsock.h>
#include <ws2tcpip.h>
#include <windows.h>
Expand Down
4 changes: 1 addition & 3 deletions src/win/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,10 +800,8 @@ int make_program_env(char* env_block[], WCHAR** dst_ptr) {
i++;
} else {
/* copy var from env_block */
DWORD r;
len = wcslen(*ptr_copy) + 1;
r = wmemcpy_s(ptr, (env_len - (ptr - dst)), *ptr_copy, len);
assert(!r);
wmemcpy(ptr, *ptr_copy, len);
ptr_copy++;
if (cmp == 0)
i++;
Expand Down

0 comments on commit ca4741b

Please sign in to comment.