Skip to content

Commit

Permalink
Merge pull request #1025 from jevinskie/jev/dylibify
Browse files Browse the repository at this point in the history
Add usable constructor for MachO::BuildVersion
  • Loading branch information
romainthomas committed Feb 24, 2024
2 parents 5aba7e8 + a076f51 commit 3f05610
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/LIEF/MachO/BuildVersion.hpp
Expand Up @@ -53,6 +53,10 @@ class LIEF_API BuildVersion : public LoadCommand {
public:
BuildVersion();
BuildVersion(const details::build_version_command& version_cmd);
BuildVersion(const PLATFORMS platform,
const version_t &minos,
const version_t &sdk,
const tools_list_t &tools);

BuildVersion& operator=(const BuildVersion& copy);
BuildVersion(const BuildVersion& copy);
Expand Down
12 changes: 12 additions & 0 deletions src/MachO/BuildVersion.cpp
Expand Up @@ -45,6 +45,18 @@ BuildVersion::BuildVersion(const details::build_version_command& ver) :
{
}

BuildVersion::BuildVersion(const PLATFORMS platform,
const version_t &minos,
const version_t &sdk,
const tools_list_t &tools) :
LoadCommand::LoadCommand{LOAD_COMMAND_TYPES::LC_BUILD_VERSION,
static_cast<uint32_t>(sizeof(details::build_version_command) +
sizeof(details::build_tool_version) * tools.size())},
platform_{platform}, minos_{minos}, sdk_{sdk}, tools_{tools}
{
original_data_.resize(size());
}

BuildVersion* BuildVersion::clone() const {
return new BuildVersion(*this);
}
Expand Down

0 comments on commit 3f05610

Please sign in to comment.