Skip to content

Commit 6b269bc

Browse files
committed
Merge branch 'master' into pr_multi_out_params
2 parents 9b7663c + c260fa4 commit 6b269bc

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-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 *);

Source/UnrealEnginePython/UnrealEnginePython.Build.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,11 @@ private string DiscoverPythonPath(string[] knownPaths, string binaryPath)
292292
if (!string.IsNullOrEmpty(environmentPath))
293293
paths.Insert(0, environmentPath);
294294

295+
// look in an alternate custom location
296+
environmentPath = System.Environment.GetEnvironmentVariable("UNREALENGINEPYTHONHOME");
297+
if (!string.IsNullOrEmpty(environmentPath))
298+
paths.Insert(0, environmentPath);
299+
295300
foreach (string path in paths)
296301
{
297302
string actualPath = path;

0 commit comments

Comments
 (0)