mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-22 17:39:53 +03:00
Merge PR #590: Fix compilation with Visual Studio 2017's toolchain
This commit is contained in:
commit
a99a9351e3
@ -123,6 +123,7 @@
|
|||||||
|
|
||||||
#define _WIN32_WINNT 0x0502
|
#define _WIN32_WINNT 0x0502
|
||||||
#define WINVER 0x0502
|
#define WINVER 0x0502
|
||||||
|
#define SECURITY_WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <Iphlpapi.h>
|
#include <Iphlpapi.h>
|
||||||
@ -136,6 +137,7 @@
|
|||||||
#include <psapi.h>
|
#include <psapi.h>
|
||||||
#include <wtsapi32.h>
|
#include <wtsapi32.h>
|
||||||
#include <Ntsecapi.h>
|
#include <Ntsecapi.h>
|
||||||
|
#include <security.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -2201,9 +2201,9 @@ UNI_TOKEN_LIST *UniParseToken(wchar_t *src, wchar_t *separator)
|
|||||||
wchar_t *str1, *str2;
|
wchar_t *str1, *str2;
|
||||||
UINT len, num;
|
UINT len, num;
|
||||||
|
|
||||||
#ifdef OS_UNIX
|
#if (!defined _MSC_VER) || (_MSC_VER >= 1900)
|
||||||
wchar_t *state = NULL;
|
wchar_t *state = NULL;
|
||||||
#endif // OS_UNIX
|
#endif // (!defined _MSC_VER) || (_MSC_VER >= 1900)
|
||||||
|
|
||||||
// Validate arguments
|
// Validate arguments
|
||||||
if (src == NULL)
|
if (src == NULL)
|
||||||
@ -2225,18 +2225,18 @@ UNI_TOKEN_LIST *UniParseToken(wchar_t *src, wchar_t *separator)
|
|||||||
Lock(token_lock);
|
Lock(token_lock);
|
||||||
{
|
{
|
||||||
tmp = wcstok(str1, separator
|
tmp = wcstok(str1, separator
|
||||||
#ifdef OS_UNIX
|
#if (!defined _MSC_VER) || (_MSC_VER >= 1900)
|
||||||
, &state
|
, &state
|
||||||
#endif // OS_UNIX
|
#endif // (!defined _MSC_VER) || (_MSC_VER >= 1900)
|
||||||
);
|
);
|
||||||
num = 0;
|
num = 0;
|
||||||
while (tmp != NULL)
|
while (tmp != NULL)
|
||||||
{
|
{
|
||||||
num++;
|
num++;
|
||||||
tmp = wcstok(NULL, separator
|
tmp = wcstok(NULL, separator
|
||||||
#ifdef OS_UNIX
|
#if (!defined _MSC_VER) || (_MSC_VER >= 1900)
|
||||||
, &state
|
, &state
|
||||||
#endif // OS_UNIX
|
#endif // (!defined _MSC_VER) || (_MSC_VER >= 1900)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
ret = Malloc(sizeof(UNI_TOKEN_LIST));
|
ret = Malloc(sizeof(UNI_TOKEN_LIST));
|
||||||
@ -2244,9 +2244,9 @@ UNI_TOKEN_LIST *UniParseToken(wchar_t *src, wchar_t *separator)
|
|||||||
ret->Token = (wchar_t **)Malloc(sizeof(wchar_t *) * num);
|
ret->Token = (wchar_t **)Malloc(sizeof(wchar_t *) * num);
|
||||||
num = 0;
|
num = 0;
|
||||||
tmp = wcstok(str2, separator
|
tmp = wcstok(str2, separator
|
||||||
#ifdef OS_UNIX
|
#if (!defined _MSC_VER) || (_MSC_VER >= 1900)
|
||||||
, &state
|
, &state
|
||||||
#endif // OS_UNIX
|
#endif // (!defined _MSC_VER) || (_MSC_VER >= 1900)
|
||||||
);
|
);
|
||||||
while (tmp != NULL)
|
while (tmp != NULL)
|
||||||
{
|
{
|
||||||
@ -2254,9 +2254,9 @@ UNI_TOKEN_LIST *UniParseToken(wchar_t *src, wchar_t *separator)
|
|||||||
UniStrCpy(ret->Token[num], 0, tmp);
|
UniStrCpy(ret->Token[num], 0, tmp);
|
||||||
num++;
|
num++;
|
||||||
tmp = wcstok(NULL, separator
|
tmp = wcstok(NULL, separator
|
||||||
#ifdef OS_UNIX
|
#if (!defined _MSC_VER) || (_MSC_VER >= 1900)
|
||||||
, &state
|
, &state
|
||||||
#endif // OS_UNIX
|
#endif // (!defined _MSC_VER) || (_MSC_VER >= 1900)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user