Skip to content

Commit

Permalink
fix compiler break due to compiler std header changes
Browse files Browse the repository at this point in the history
fix x86 compiler break debug_module_info_size_aligned fix
  • Loading branch information
shanepowell committed Feb 21, 2025
1 parent 7a380c4 commit bbf75d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DbgHelpUtils/filesystem_utils.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#include <functional>
// ReSharper disable once CppUnusedIncludeDirective
#include <string>
#include <string_view>
#include <vector>
#include <experimental/generator>
Expand Down
6 changes: 3 additions & 3 deletions DbgHelpUtils/symbol_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1082,10 +1082,10 @@ namespace dlg_help_utils::dbg_help
auto const debug_module_info_size = sizeof(IMAGE_DEBUG_DIRECTORY) + cv_record_size;

// Most recent DbgHelp.dll now requires sizeof(IMAGE_DEBUG_DIRECTORY) + cv_record_size to be 8bytes-aligned
auto const mandatoryAlignment = 8;
auto const debug_module_info_size_aligned = (debug_module_info_size + mandatoryAlignment) & (~uint64_t(mandatoryAlignment - 1));
constexpr auto mandatoryAlignment = 8;
auto const debug_module_info_size_aligned = (debug_module_info_size + mandatoryAlignment) & (~static_cast<uint64_t>(mandatoryAlignment - 1));

auto const debug_module_info = std::make_unique<uint8_t[]>(debug_module_info_size_aligned);
auto const debug_module_info = std::make_unique<uint8_t[]>(static_cast<size_t>(debug_module_info_size_aligned));
auto* info = reinterpret_cast<IMAGE_DEBUG_DIRECTORY*>(debug_module_info.get());

info->TimeDateStamp = module_time_stamp;
Expand Down

0 comments on commit bbf75d1

Please sign in to comment.