Skip to content

Commit

Permalink
fix compile error with capstone_static_winkernel
Browse files Browse the repository at this point in the history
The MSVC project capstone_static_winkernel uses __stdcall as a
default calling convention to fit with environment for Windows driver
development. This leads to a compile error in a use of qsort() with
regs_cmp() since it is compiled as a __stdcall function while qsort()
expects a __cdelc function.

This fix adds explicit calling convention to regs_cmp() for MSVC.

Signed-off-by: Satoshi Tanda <[email protected]>
  • Loading branch information
tandasat committed Sep 28, 2016
1 parent 3730e20 commit bc954d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/X86/X86Mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -2923,7 +2923,7 @@ static struct insn_reg2 insn_regs_intel2[] = {

static struct insn_reg insn_regs_intel_sorted [ARR_SIZE(insn_regs_intel)];

static int regs_cmp(const void *a, const void *b)
static int CAPSTONE_API regs_cmp(const void *a, const void *b)
{
uint16_t l = ((struct insn_reg *)a)->insn;
uint16_t r = ((struct insn_reg *)b)->insn;
Expand Down

0 comments on commit bc954d0

Please sign in to comment.