qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

libvixl: Avoid std::abs() of 64-bit type

The std::abs() function did not get a version that works on
'long long' until C++11. Avoid it, so that we can compile on
32-bit platforms (where int64_t is 'long long') with older
compilers (which don't support C++11).

Reported-by: Franz-Josef Haider <Franz-Josef.Haider@student.uibk.ac.at>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1453739429-31477-1-git-send-email-peter.maydell@linaro.org

+5 -1
+5 -1
disas/libvixl/vixl/a64/disasm-a64.cc
··· 2688 2688 void Disassembler::AppendPCRelativeOffsetToOutput(const Instruction* instr, 2689 2689 int64_t offset) { 2690 2690 USE(instr); 2691 + uint64_t abs_offset = offset; 2691 2692 char sign = (offset < 0) ? '-' : '+'; 2692 - AppendToOutput("#%c0x%" PRIx64, sign, std::abs(offset)); 2693 + if (offset < 0) { 2694 + abs_offset = -abs_offset; 2695 + } 2696 + AppendToOutput("#%c0x%" PRIx64, sign, abs_offset); 2693 2697 } 2694 2698 2695 2699