Skip to content

Commit c260fa4

Browse files
authored
Merge pull request 20tab#627 from dontnod/tchar-to-wchar
Add backwards compatibility macro for TCHAR_TO_WCHAR.
2 parents 3462fab + 9e4f393 commit c260fa4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Source/UnrealEnginePython/Private/UEPyModule.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414
#include "Wrappers/UEPyFColor.h"
1515
#include "Wrappers/UEPyFLinearColor.h"
1616

17+
// backward compatibility for UE4.20 TCHAR_TO_WCHAR
18+
#ifndef TCHAR_TO_WCHAR
19+
// SIZEOF_WCHAR_T is provided by pyconfig.h
20+
#if SIZEOF_WCHAR_T == (PLATFORM_TCHAR_IS_4_BYTES ? 4 : 2)
21+
#define TCHAR_TO_WCHAR(str) str
22+
#else
23+
#define TCHAR_TO_WCHAR(str) (wchar_t*)StringCast<wchar_t>(static_cast<const TCHAR*>(str)).Get()
24+
#endif
25+
#endif
1726

1827

1928
UWorld *ue_get_uworld(ue_PyUObject *);

0 commit comments

Comments
 (0)