1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:24:57 +00:00

Everywhere: Replace ElfW(type) macro usage with Elf_type

This works around a `clang-format-17` bug which caused certain usages to
be misformatted and fail to compile.

Fixes #8315
This commit is contained in:
Daniel Bertalan 2023-11-30 23:58:55 +01:00
parent 2151e6c8b4
commit 45d81dceed
20 changed files with 129 additions and 127 deletions

View file

@ -129,12 +129,12 @@ static ErrorOr<Optional<String>> elf_details(StringView description, StringView
return OptionalNone {};
StringBuilder interpreter_path_builder;
auto result_or_error = ELF::validate_program_headers(*(const ElfW(Ehdr)*)elf_data.data(), elf_data.size(), elf_data, &interpreter_path_builder);
auto result_or_error = ELF::validate_program_headers(*(Elf_Ehdr const*)elf_data.data(), elf_data.size(), elf_data, &interpreter_path_builder);
if (result_or_error.is_error() || !result_or_error.value())
return OptionalNone {};
auto interpreter_path = interpreter_path_builder.string_view();
auto& header = *reinterpret_cast<const ElfW(Ehdr)*>(elf_data.data());
auto& header = *reinterpret_cast<Elf_Ehdr const*>(elf_data.data());
auto bitness = header.e_ident[EI_CLASS] == ELFCLASS64 ? "64" : "32";
auto byteorder = header.e_ident[EI_DATA] == ELFDATA2LSB ? "LSB" : "MSB";