Skip to content

Commit

Permalink
Merge branch 'Tencent:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnoChenFx authored Nov 19, 2024
2 parents 645f8f9 + 3f5572d commit 8408b61
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions unreal/Puerts/Source/JsEnv/Private/ContainerMeta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,12 @@ PropertyMacro* FContainerMeta::GetObjectProperty(UField* Field)
if (Enum->GetCppForm() == UEnum::ECppForm::EnumClass)
{
FEnumProperty* EnumProp =
#if ENGINE_MAJOR_VERSION > 4 && ENGINE_MINOR_VERSION > 4 // 5.5+
new FEnumProperty(PropertyMetaRoot, NAME_None, RF_Transient);
EnumProp->SetEnum(Enum);
#else
new FEnumProperty(PropertyMetaRoot, NAME_None, RF_Transient, 0, CPF_HasGetValueTypeHash, Enum);
#endif
FNumericProperty* UnderlyingProp = new FByteProperty(EnumProp, TEXT("UnderlyingType"), RF_Transient);
EnumProp->AddCppProperty(UnderlyingProp);
EnumProp->ElementSize = UnderlyingProp->ElementSize;
Expand Down
8 changes: 4 additions & 4 deletions unreal/Puerts/Source/JsEnv/Public/UEDataBinding.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,10 +490,10 @@ struct IsUStructHelper<T, Void_t<decltype(&TScriptStructTraits<T>::Get)>> : std:
namespace v8_impl
{
template <typename T>
struct Converter<T*,
typename std::enable_if<!std::is_convertible<T*, const UObject*>::value && internal::IsUStructHelper<T>::value>::type>
struct Converter<T*, typename std::enable_if<!std::is_const<T>::value && !std::is_convertible<T*, const UObject*>::value &&
internal::IsUStructHelper<T>::value>::type>
{
static v8::Local<v8::Value> toScript(v8::Local<v8::Context> context, T* value)
static v8::Local<v8::Value> toScript(v8::Local<v8::Context> context, const T* value)
{
return DataTransfer::FindOrAddStruct<T>(context->GetIsolate(), context, (void*) value, true);
}
Expand All @@ -519,7 +519,7 @@ struct Converter<const T*,
template <typename T>
struct Converter<T, typename std::enable_if<internal::IsUStructHelper<T>::value>::type>
{
static v8::Local<v8::Value> toScript(v8::Local<v8::Context> context, T value)
static v8::Local<v8::Value> toScript(v8::Local<v8::Context> context, const T value)
{
return DataTransfer::FindOrAddStruct<T>(context->GetIsolate(), context, new T(value), false);
}
Expand Down

0 comments on commit 8408b61

Please sign in to comment.