Skip to content

Commit

Permalink
linux/bfd: define 'enum fake_disassembler_style' in case the real 'en…
Browse files Browse the repository at this point in the history
…um disassembler_style' is not defined in older dis-asm.h
  • Loading branch information
robertswiecki committed Oct 2, 2023
1 parent fd8d1a7 commit c0522ed
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion linux/bfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,15 @@ static int arch_bfdFPrintF(void* buf, const char* fmt, ...) {
return ret;
}

/*
* The 'disassembler_style' is defined with newert dis-asm.h versions only. Use a fake identifier,
* just to be able to define a function pointer.
*/
enum fake_disassembler_style {
hf_fake_dis_asm_style_unused,
};
static int arch_bfdFPrintFStyled(
void* buf, enum disassembler_style style HF_ATTR_UNUSED, const char* fmt, ...) {
void* buf, enum fake_disassembler_style style HF_ATTR_UNUSED, const char* fmt, ...) {
va_list args;
va_start(args, fmt);
int ret = util_vssnprintf(buf, _HF_INSTR_SZ, fmt, args);
Expand Down

0 comments on commit c0522ed

Please sign in to comment.