windows: fix build on MinGW
This commit is contained in:
parent
09cb5b534e
commit
ca4741b4a5
@ -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>
|
||||
|
||||
@ -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++;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user