Skip to content

Commit 9e4f393

Browse files
committed
Add backwards compatibility macro for TCHAR_TO_WCHAR.
This macro was only introduced in UE4.20. We copy it if wchar_t and TCHAR differ in size.
1 parent 078908e commit 9e4f393

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)