mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-07 15:36:26 +00:00
Formatting system improved
`unveil<>` renamed to `fmt_unveil<>`, now packs args to u64 imitating va_args `bijective...` removed, `cfg::enum_entry` now uses formatting system `fmt_class_string<>` added, providing type-specific "%s" handler function Added `fmt::append`, removed `fmt::narrow` (too obscure) Utilities/cfmt.h: C-style format template function (WIP) Minor formatting fixes and cleanup
This commit is contained in:
parent
662fce38bd
commit
5a36c57c57
63 changed files with 1305 additions and 469 deletions
31
rpcs3/Loader/ELF.cpp
Normal file
31
rpcs3/Loader/ELF.cpp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#include "stdafx.h"
|
||||
#include "ELF.h"
|
||||
|
||||
// ELF loading error information
|
||||
template<>
|
||||
void fmt_class_string<elf_error>::format(std::string& out, u64 arg)
|
||||
{
|
||||
format_enum(out, arg, [](elf_error error)
|
||||
{
|
||||
switch (error)
|
||||
{
|
||||
case elf_error::ok: return "OK";
|
||||
|
||||
case elf_error::stream: return "Invalid stream";
|
||||
case elf_error::stream_header: return "Failed to read ELF header";
|
||||
case elf_error::stream_phdrs: return "Failed to read ELF program headers";
|
||||
case elf_error::stream_shdrs: return "Failed to read ELF section headers";
|
||||
case elf_error::stream_data: return "Failed to read ELF program data";
|
||||
|
||||
case elf_error::header_magic: return "Not an ELF";
|
||||
case elf_error::header_version: return "Invalid or unsupported ELF format";
|
||||
case elf_error::header_class: return "Invalid ELF class";
|
||||
case elf_error::header_machine: return "Invalid ELF machine";
|
||||
case elf_error::header_endianness: return "Invalid ELF data (endianness)";
|
||||
case elf_error::header_type: return "Invalid ELF type";
|
||||
case elf_error::header_os: return "Invalid ELF OS ABI";
|
||||
}
|
||||
|
||||
return unknown;
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue