Skip to content

Commit

Permalink
Windows fix
Browse files Browse the repository at this point in the history
  • Loading branch information
romainthomas committed May 9, 2024
1 parent fc8aa9a commit 3c76f67
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions cmake/LIEFCompilerFlags.cmake
Expand Up @@ -119,6 +119,10 @@ if(MSVC AND NOT CLANG_CL)
endforeach(flag)

if (LIEF_DISABLE_EXCEPTIONS)
string(REGEX REPLACE " /EHsc" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REGEX REPLACE " /EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REGEX REPLACE " /EHc" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REGEX REPLACE " /EHc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
target_compile_options(LIB_LIEF PRIVATE /EHsc-)
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion include/LIEF/MachO/DyldExportsTrie.hpp
Expand Up @@ -53,7 +53,7 @@ class LIEF_API DyldExportsTrie : public LoadCommand {
//! Iterator which outputs const ExportInfo&
using it_const_export_info = const_ref_iterator<const export_info_t&, ExportInfo*>;

DyldExportsTrie() = default;
DyldExportsTrie();
DyldExportsTrie(const details::linkedit_data_command& cmd);
std::unique_ptr<LoadCommand> clone() const override {
return std::unique_ptr<DyldExportsTrie>(new DyldExportsTrie(*this));
Expand Down
3 changes: 2 additions & 1 deletion src/MachO/Builder.cpp
Expand Up @@ -26,6 +26,7 @@
#include "LIEF/MachO/Builder.hpp"
#include "LIEF/MachO/FatBinary.hpp"
#include "LIEF/MachO/UUIDCommand.hpp"
#include "LIEF/MachO/ExportInfo.hpp"

#include "Object.tcc"

Expand Down Expand Up @@ -140,7 +141,7 @@ ok_error_t Builder::build_fat() {
std::vector<uint8_t> raw = build_raw(*binaries_[i], config_);

auto alignment = BinaryStream::swap_endian<uint32_t>(arch->align);
uint32_t offset = align(raw_.size(), 1 << alignment);
uint32_t offset = align(raw_.size(), 1llu << alignment);

arch->offset = BinaryStream::swap_endian<uint32_t>(offset);
arch->size = BinaryStream::swap_endian<uint32_t>(raw.size());
Expand Down
2 changes: 2 additions & 0 deletions src/MachO/DyldExportsTrie.cpp
Expand Up @@ -27,6 +27,8 @@

namespace LIEF {
namespace MachO {

DyldExportsTrie::DyldExportsTrie() = default;
DyldExportsTrie::~DyldExportsTrie() = default;
DyldExportsTrie::DyldExportsTrie(const DyldExportsTrie& other) :
LoadCommand::LoadCommand(other),
Expand Down

0 comments on commit 3c76f67

Please sign in to comment.