libopenmpt: add upstream patch to fix build with gcc-6

Signed-off-by: Stephan Raue <stephan@openelec.tv>
(cherry picked from commit 60560259bdc2b7883b76bb08b9af3c7fde12b169)
This commit is contained in:
Stephan Raue 2016-11-15 23:49:07 +00:00 committed by MilhouseVH
parent 7dc9988eea
commit 8fc8625139

View File

@ -0,0 +1,14 @@
Index: soundlib/tuning.cpp
===================================================================
--- a/soundlib/tuning.cpp (revision 6294)
+++ b/soundlib/tuning.cpp (working copy)
@@ -375,7 +375,8 @@
if(!IsOfType(TT_GROUPGEOMETRIC)) return 0;
if(note >= 0) return note % GetGroupSize();
- else return (GetGroupSize() - (abs(note) % GetGroupSize())) % GetGroupSize();
+ // static_cast<int>(note) because g++-6 template-disables std::abs overloads for 8bit and 16bit integer types via std::enable_if.
+ else return (GetGroupSize() - (std::abs(static_cast<int>(note)) % GetGroupSize())) % GetGroupSize();
}