lilypad: fix windows build

I think lilypad used libc instead of libc++
This commit is contained in:
Gregory Hainaut 2015-02-20 23:04:27 +01:00
parent 642371996a
commit 8d76586dec
2 changed files with 8 additions and 0 deletions

View File

@ -223,7 +223,11 @@ void Device::CalcVirtualState() {
double East = sin(angle);
double South = -cos(angle);
// Normalize so greatest direction is 1.
#ifdef __linux__
double mul = FULLY_DOWN / std::max(fabs(South), fabs(East));
#else
double mul = FULLY_DOWN / max(fabs(South), fabs(East));
#endif
iEast = (int) floor(East * mul + 0.5);
iSouth = (int) floor(South * mul + 0.5);
}

View File

@ -421,7 +421,11 @@ void ProcessButtonBinding(Binding *b, ButtonSum *sum, int value) {
void CapSum(ButtonSum *sum) {
int i;
for (i=0; i<3; i++) {
#ifdef __linux__
int div = std::max(abs(sum->sticks[i].horiz), abs(sum->sticks[i].vert));
#else
int div = max(abs(sum->sticks[i].horiz), abs(sum->sticks[i].vert));
#endif
if (div > 255) {
sum->sticks[i].horiz = sum->sticks[i].horiz * 255 / div;
sum->sticks[i].vert = sum->sticks[i].vert * 255 / div;