Skip to content

Commit 4dcc129

Browse files
committed
update:character set modify to unicode from ansi on vs2022
1 parent 69563fc commit 4dcc129

File tree

11 files changed

+33
-39
lines changed

11 files changed

+33
-39
lines changed

XEngine_Source/XEngine_ModuleConfigure/XEngine_ModuleConfigure.vcxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,27 @@
3030
<ConfigurationType>DynamicLibrary</ConfigurationType>
3131
<UseDebugLibraries>true</UseDebugLibraries>
3232
<PlatformToolset>v143</PlatformToolset>
33-
<CharacterSet>MultiByte</CharacterSet>
33+
<CharacterSet>Unicode</CharacterSet>
3434
</PropertyGroup>
3535
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
3636
<ConfigurationType>DynamicLibrary</ConfigurationType>
3737
<UseDebugLibraries>false</UseDebugLibraries>
3838
<PlatformToolset>v143</PlatformToolset>
3939
<WholeProgramOptimization>true</WholeProgramOptimization>
40-
<CharacterSet>MultiByte</CharacterSet>
40+
<CharacterSet>Unicode</CharacterSet>
4141
</PropertyGroup>
4242
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
4343
<ConfigurationType>DynamicLibrary</ConfigurationType>
4444
<UseDebugLibraries>true</UseDebugLibraries>
4545
<PlatformToolset>v143</PlatformToolset>
46-
<CharacterSet>MultiByte</CharacterSet>
46+
<CharacterSet>Unicode</CharacterSet>
4747
</PropertyGroup>
4848
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
4949
<ConfigurationType>DynamicLibrary</ConfigurationType>
5050
<UseDebugLibraries>false</UseDebugLibraries>
5151
<PlatformToolset>v143</PlatformToolset>
5252
<WholeProgramOptimization>true</WholeProgramOptimization>
53-
<CharacterSet>MultiByte</CharacterSet>
53+
<CharacterSet>Unicode</CharacterSet>
5454
</PropertyGroup>
5555
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
5656
<ImportGroup Label="ExtensionSettings">

XEngine_Source/XEngine_ModuleProtocol/XEngine_ModuleProtocol.vcxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,27 @@
3030
<ConfigurationType>DynamicLibrary</ConfigurationType>
3131
<UseDebugLibraries>true</UseDebugLibraries>
3232
<PlatformToolset>v143</PlatformToolset>
33-
<CharacterSet>MultiByte</CharacterSet>
33+
<CharacterSet>Unicode</CharacterSet>
3434
</PropertyGroup>
3535
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
3636
<ConfigurationType>DynamicLibrary</ConfigurationType>
3737
<UseDebugLibraries>false</UseDebugLibraries>
3838
<PlatformToolset>v143</PlatformToolset>
3939
<WholeProgramOptimization>true</WholeProgramOptimization>
40-
<CharacterSet>MultiByte</CharacterSet>
40+
<CharacterSet>Unicode</CharacterSet>
4141
</PropertyGroup>
4242
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
4343
<ConfigurationType>DynamicLibrary</ConfigurationType>
4444
<UseDebugLibraries>true</UseDebugLibraries>
4545
<PlatformToolset>v143</PlatformToolset>
46-
<CharacterSet>MultiByte</CharacterSet>
46+
<CharacterSet>Unicode</CharacterSet>
4747
</PropertyGroup>
4848
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
4949
<ConfigurationType>DynamicLibrary</ConfigurationType>
5050
<UseDebugLibraries>false</UseDebugLibraries>
5151
<PlatformToolset>v143</PlatformToolset>
5252
<WholeProgramOptimization>true</WholeProgramOptimization>
53-
<CharacterSet>MultiByte</CharacterSet>
53+
<CharacterSet>Unicode</CharacterSet>
5454
</PropertyGroup>
5555
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
5656
<ImportGroup Label="ExtensionSettings">

XEngine_Source/XEngine_ModuleSession/ModuleSession_Forward/ModuleSession_Forward.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ bool CModuleSession_Forward::ModuleSession_Forward_Insert(LPCXSTR lpszAddr, XENG
5757
memcpy(&st_Forward.st_UserAuth, pSt_UserAuth, sizeof(XENGINE_PROTOCOL_USERAUTH));
5858

5959
st_Locker.lock();
60-
unordered_map<tstring, SESSION_FORWARD>::const_iterator stl_MapIterator = stl_MapSession.find(lpszAddr);
60+
unordered_map<xstring, SESSION_FORWARD>::const_iterator stl_MapIterator = stl_MapSession.find(lpszAddr);
6161
if (stl_MapIterator != stl_MapSession.end())
6262
{
6363
Session_IsErrorOccur = true;

XEngine_Source/XEngine_ModuleSession/ModuleSession_Forward/ModuleSession_Forward.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ class CModuleSession_Forward
2626
private:
2727
shared_mutex st_Locker;
2828
private:
29-
unordered_map<tstring, SESSION_FORWARD> stl_MapSession;
29+
unordered_map<xstring, SESSION_FORWARD> stl_MapSession;
3030
};

XEngine_Source/XEngine_ModuleSession/ModuleSession_Socks/ModuleSession_Socks.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ bool CModuleSession_Socks::ModuleSession_Socks_Delete(LPCXSTR lpszClientID)
7878
Session_IsErrorOccur = false;
7979

8080
st_Locker.lock();
81-
unordered_map<tstring, RFCPROTOCOL_SOCKS5CLIENT*>::const_iterator stl_MapIterator = stl_MapClients.find(lpszClientID);
81+
unordered_map<xstring, RFCPROTOCOL_SOCKS5CLIENT*>::const_iterator stl_MapIterator = stl_MapClients.find(lpszClientID);
8282
if (stl_MapIterator != stl_MapClients.end())
8383
{
8484
if (NULL != stl_MapIterator->second->lParam)
@@ -125,7 +125,7 @@ bool CModuleSession_Socks::ModuleSession_Socks_SetInfo(LPCXSTR lpszClientID, XPV
125125
return false;
126126
}
127127
st_Locker.lock();
128-
unordered_map<tstring, RFCPROTOCOL_SOCKS5CLIENT*>::const_iterator stl_MapIterator = stl_MapClients.find(lpszClientID);
128+
unordered_map<xstring, RFCPROTOCOL_SOCKS5CLIENT*>::const_iterator stl_MapIterator = stl_MapClients.find(lpszClientID);
129129
if (stl_MapIterator == stl_MapClients.end())
130130
{
131131
Session_IsErrorOccur = true;
@@ -195,7 +195,7 @@ bool CModuleSession_Socks::ModuleSession_Socks_GetInfo(LPCXSTR lpszClientID, XPV
195195
return false;
196196
}
197197
st_Locker.lock_shared();
198-
unordered_map<tstring, RFCPROTOCOL_SOCKS5CLIENT*>::const_iterator stl_MapIterator = stl_MapClients.find(lpszClientID);
198+
unordered_map<xstring, RFCPROTOCOL_SOCKS5CLIENT*>::const_iterator stl_MapIterator = stl_MapClients.find(lpszClientID);
199199
if (stl_MapIterator == stl_MapClients.end())
200200
{
201201
Session_IsErrorOccur = true;
@@ -251,7 +251,7 @@ bool CModuleSession_Socks::ModuleSession_Socks_GetList(XPPPMEM xpppMem, int* pIn
251251
*pInt_Count = stl_MapClients.size();
252252
BaseLib_Memory_Malloc(xpppMem, *pInt_Count, nSize);
253253

254-
unordered_map<tstring, RFCPROTOCOL_SOCKS5CLIENT*>::const_iterator stl_MapIterator = stl_MapClients.begin();
254+
unordered_map<xstring, RFCPROTOCOL_SOCKS5CLIENT*>::const_iterator stl_MapIterator = stl_MapClients.begin();
255255
for (int i = 0; stl_MapIterator != stl_MapClients.end(); stl_MapIterator++, i++)
256256
{
257257
//是否设置有值
@@ -293,7 +293,7 @@ bool CModuleSession_Socks::ModuleSession_Socks_GetStatus(LPCXSTR lpszClientID, E
293293
return false;
294294
}
295295
st_Locker.lock_shared();
296-
unordered_map<tstring, RFCPROTOCOL_SOCKS5CLIENT*>::const_iterator stl_MapIterator = stl_MapClients.find(lpszClientID);
296+
unordered_map<xstring, RFCPROTOCOL_SOCKS5CLIENT*>::const_iterator stl_MapIterator = stl_MapClients.find(lpszClientID);
297297
if (stl_MapIterator == stl_MapClients.end())
298298
{
299299
Session_IsErrorOccur = true;
@@ -334,7 +334,7 @@ bool CModuleSession_Socks::ModuleSession_Socks_SetStatus(LPCXSTR lpszClientID, E
334334
return false;
335335
}
336336
st_Locker.lock_shared();
337-
unordered_map<tstring, RFCPROTOCOL_SOCKS5CLIENT*>::const_iterator stl_MapIterator = stl_MapClients.find(lpszClientID);
337+
unordered_map<xstring, RFCPROTOCOL_SOCKS5CLIENT*>::const_iterator stl_MapIterator = stl_MapClients.find(lpszClientID);
338338
if (stl_MapIterator == stl_MapClients.end())
339339
{
340340
Session_IsErrorOccur = true;

XEngine_Source/XEngine_ModuleSession/ModuleSession_Socks/ModuleSession_Socks.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ class CModuleSession_Socks
4141
private:
4242
shared_mutex st_Locker;
4343
private:
44-
unordered_map<tstring, RFCPROTOCOL_SOCKS5CLIENT*> stl_MapClients;
44+
unordered_map<xstring, RFCPROTOCOL_SOCKS5CLIENT*> stl_MapClients;
4545
};

XEngine_Source/XEngine_ModuleSession/ModuleSession_Tunnel/ModuleSession_Tunnel.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ bool CModuleSession_Tunnel::ModuleSession_Tunnel_Create(LPCXSTR lpszClientID)
5353
}
5454
memset(pSt_TunnelInfo, '\0', sizeof(PROXYTUNNEL_CLIENTINFO));
5555

56-
pSt_TunnelInfo->pStl_ListField = new list<tstring>;
56+
pSt_TunnelInfo->pStl_ListField = new list<xstring>;
5757
if (NULL == pSt_TunnelInfo->pStl_ListField)
5858
{
5959
Session_IsErrorOccur = true;
@@ -85,7 +85,7 @@ bool CModuleSession_Tunnel::ModuleSession_Tunnel_Delete(LPCXSTR lpszClientID)
8585
Session_IsErrorOccur = false;
8686

8787
st_Locker.lock();
88-
unordered_map<tstring, PROXYTUNNEL_CLIENTINFO*>::const_iterator stl_MapIterator = stl_MapClient.find(lpszClientID);
88+
unordered_map<xstring, PROXYTUNNEL_CLIENTINFO*>::const_iterator stl_MapIterator = stl_MapClient.find(lpszClientID);
8989
if (stl_MapIterator != stl_MapClient.end())
9090
{
9191
if (NULL != stl_MapIterator->second->lParam)
@@ -137,7 +137,7 @@ bool CModuleSession_Tunnel::ModuleSession_Tunnel_SetInfo(LPCXSTR lpszClientID, X
137137
return false;
138138
}
139139
st_Locker.lock_shared();
140-
unordered_map<tstring, PROXYTUNNEL_CLIENTINFO*>::const_iterator stl_MapIterator = stl_MapClient.find(lpszClientID);
140+
unordered_map<xstring, PROXYTUNNEL_CLIENTINFO*>::const_iterator stl_MapIterator = stl_MapClient.find(lpszClientID);
141141
if (stl_MapIterator == stl_MapClient.end())
142142
{
143143
Session_IsErrorOccur = true;
@@ -206,7 +206,7 @@ bool CModuleSession_Tunnel::ModuleSession_Tunnel_GetInfo(LPCXSTR lpszClientID, X
206206
return false;
207207
}
208208
st_Locker.lock_shared();
209-
unordered_map<tstring, PROXYTUNNEL_CLIENTINFO*>::const_iterator stl_MapIterator = stl_MapClient.find(lpszClientID);
209+
unordered_map<xstring, PROXYTUNNEL_CLIENTINFO*>::const_iterator stl_MapIterator = stl_MapClient.find(lpszClientID);
210210
if (stl_MapIterator == stl_MapClient.end())
211211
{
212212
Session_IsErrorOccur = true;
@@ -262,7 +262,7 @@ bool CModuleSession_Tunnel::ModuleSession_Tunnel_GetList(XPPPMEM xpppMem, int* p
262262

263263
*pInt_Count = stl_MapClient.size();
264264
BaseLib_Memory_Malloc(xpppMem, *pInt_Count, nSize);
265-
unordered_map<tstring, PROXYTUNNEL_CLIENTINFO*>::const_iterator stl_MapIterator = stl_MapClient.begin();
265+
unordered_map<xstring, PROXYTUNNEL_CLIENTINFO*>::const_iterator stl_MapIterator = stl_MapClient.begin();
266266
for (int i = 0; stl_MapIterator != stl_MapClient.end(); stl_MapIterator++, i++)
267267
{
268268
//是否设置有值
@@ -323,7 +323,7 @@ bool CModuleSession_Tunnel::ModuleSession_Tunnel_Packet(LPCXSTR lpszClientID, LP
323323
return false;
324324
}
325325
st_Locker.lock_shared();
326-
unordered_map<tstring, PROXYTUNNEL_CLIENTINFO*>::const_iterator stl_MapIterator = stl_MapClient.find(lpszClientID);
326+
unordered_map<xstring, PROXYTUNNEL_CLIENTINFO*>::const_iterator stl_MapIterator = stl_MapClient.find(lpszClientID);
327327
if (stl_MapIterator == stl_MapClient.end())
328328
{
329329
Session_IsErrorOccur = true;

XEngine_Source/XEngine_ModuleSession/ModuleSession_Tunnel/ModuleSession_Tunnel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ typedef struct
1717
int nHdrLen; //HTTP头大小
1818
int nPosLen; //HTTP当前大小
1919
int nCtmLen; //自定义内容大小
20-
list<tstring>* pStl_ListField; //HTTP字段
20+
list<xstring>* pStl_ListField; //HTTP字段
2121
XPVOID lParam;
2222
}PROXYTUNNEL_CLIENTINFO,*LPPROXYTUNNEL_CLIENTINFO;
2323

@@ -38,5 +38,5 @@ class CModuleSession_Tunnel
3838
private:
3939
shared_mutex st_Locker;
4040
private:
41-
unordered_map<tstring,PROXYTUNNEL_CLIENTINFO *> stl_MapClient;
41+
unordered_map<xstring,PROXYTUNNEL_CLIENTINFO *> stl_MapClient;
4242
};

XEngine_Source/XEngine_ModuleSession/XEngine_ModuleSession.vcxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,27 @@
3030
<ConfigurationType>DynamicLibrary</ConfigurationType>
3131
<UseDebugLibraries>true</UseDebugLibraries>
3232
<PlatformToolset>v143</PlatformToolset>
33-
<CharacterSet>MultiByte</CharacterSet>
33+
<CharacterSet>Unicode</CharacterSet>
3434
</PropertyGroup>
3535
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
3636
<ConfigurationType>DynamicLibrary</ConfigurationType>
3737
<UseDebugLibraries>false</UseDebugLibraries>
3838
<PlatformToolset>v143</PlatformToolset>
3939
<WholeProgramOptimization>true</WholeProgramOptimization>
40-
<CharacterSet>MultiByte</CharacterSet>
40+
<CharacterSet>Unicode</CharacterSet>
4141
</PropertyGroup>
4242
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
4343
<ConfigurationType>DynamicLibrary</ConfigurationType>
4444
<UseDebugLibraries>true</UseDebugLibraries>
4545
<PlatformToolset>v143</PlatformToolset>
46-
<CharacterSet>MultiByte</CharacterSet>
46+
<CharacterSet>Unicode</CharacterSet>
4747
</PropertyGroup>
4848
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
4949
<ConfigurationType>DynamicLibrary</ConfigurationType>
5050
<UseDebugLibraries>false</UseDebugLibraries>
5151
<PlatformToolset>v143</PlatformToolset>
5252
<WholeProgramOptimization>true</WholeProgramOptimization>
53-
<CharacterSet>MultiByte</CharacterSet>
53+
<CharacterSet>Unicode</CharacterSet>
5454
</PropertyGroup>
5555
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
5656
<ImportGroup Label="ExtensionSettings">

XEngine_Source/XEngine_ModuleSession/pch.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ using namespace std;
4242
extern bool Session_IsErrorOccur;
4343
extern XLONG Session_dwErrorCode;
4444

45-
#ifdef _UNICODE
46-
typedef std::wstring tstring;
47-
#else
48-
typedef std::string tstring;
49-
#endif
50-
5145
#ifdef _MSC_BUILD
5246
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
5347
#pragma comment(lib,"XEngine_BaseLib/XEngine_Algorithm")

0 commit comments

Comments
 (0)