Skip to content

Commit

Permalink
android编译错误
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Oct 24, 2024
1 parent 17acd1f commit afd8ccc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
8 changes: 4 additions & 4 deletions unreal/Puerts/Source/JsEnv/Private/PesapiV8Impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1023,10 +1023,10 @@ void pesapi_define_class(const void* type_id, const void* super_type_id, const c

free_property_descriptor(properties, property_count);

p_methods.push_back({nullptr, nullptr, nullptr});
p_functions.push_back({nullptr, nullptr, nullptr});
p_properties.push_back({nullptr, nullptr, nullptr, nullptr});
p_variables.push_back({nullptr, nullptr, nullptr, nullptr});
p_methods.push_back(puerts::JSFunctionInfo());
p_functions.push_back(puerts::JSFunctionInfo());
p_properties.push_back(puerts::JSPropertyInfo());
p_variables.push_back(puerts::JSPropertyInfo());

classDef.Methods = p_methods.data();
classDef.Functions = p_functions.data();
Expand Down
12 changes: 4 additions & 8 deletions unreal/Puerts/Source/JsEnv/Public/PesapiBackend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,26 +168,22 @@ struct API
size_t pos = 0;
for (const auto& func : Cdb.functions_)
{
pesapi_set_method_info(
properties, pos++, func.Name, true, reinterpret_cast<FunctionCallbackType>(func.Callback), nullptr, nullptr);
pesapi_set_method_info(properties, pos++, func.Name, true, func.Callback, nullptr, nullptr);
}

for (const auto& method : Cdb.methods_)
{
pesapi_set_method_info(
properties, pos++, method.Name, false, reinterpret_cast<FunctionCallbackType>(method.Callback), nullptr, nullptr);
pesapi_set_method_info(properties, pos++, method.Name, false, method.Callback, nullptr, nullptr);
}

for (const auto& prop : Cdb.properties_)
{
pesapi_set_property_info(properties, pos++, prop.Name, false, reinterpret_cast<FunctionCallbackType>(prop.Getter),
reinterpret_cast<FunctionCallbackType>(prop.Setter), nullptr, nullptr, nullptr);
pesapi_set_property_info(properties, pos++, prop.Name, false, prop.Getter, prop.Setter, nullptr, nullptr, nullptr);
}

for (const auto& prop : Cdb.variables_)
{
pesapi_set_property_info(properties, pos++, prop.Name, true, reinterpret_cast<FunctionCallbackType>(prop.Getter),
reinterpret_cast<FunctionCallbackType>(prop.Setter), nullptr, nullptr, nullptr);
pesapi_set_property_info(properties, pos++, prop.Name, true, prop.Getter, prop.Setter, nullptr, nullptr, nullptr);
}

pesapi_finalize finalize = Finalize;
Expand Down
8 changes: 4 additions & 4 deletions unreal/Puerts/Source/JsEnv/Public/V8Backend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,19 @@ struct API
ClassDef.Finalize = Finalize;

s_functions_ = std::move(Cdb.functions_);
s_functions_.push_back({nullptr, nullptr, nullptr});
s_functions_.push_back(JSFunctionInfo());
ClassDef.Functions = s_functions_.data();

s_methods_ = std::move(Cdb.methods_);
s_methods_.push_back({nullptr, nullptr, nullptr});
s_methods_.push_back(JSFunctionInfo());
ClassDef.Methods = s_methods_.data();

s_properties_ = std::move(Cdb.properties_);
s_properties_.push_back(JSPropertyInfo{nullptr, nullptr, nullptr, nullptr, nullptr});
s_properties_.push_back(JSPropertyInfo());
ClassDef.Properties = s_properties_.data();

s_variables_ = std::move(Cdb.variables_);
s_variables_.push_back(JSPropertyInfo{nullptr, nullptr, nullptr, nullptr, nullptr});
s_variables_.push_back(JSPropertyInfo());
ClassDef.Variables = s_variables_.data();

s_constructorInfos_ = std::move(Cdb.constructorInfos_);
Expand Down

0 comments on commit afd8ccc

Please sign in to comment.