mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 09:01:46 +00:00
Merge pull request #18 from madcad/master
Fixed compilation issues on OS X.
This commit is contained in:
commit
b77bdea734
@ -5,6 +5,7 @@
|
|||||||
// WWW: http://www.glfw.org/
|
// WWW: http://www.glfw.org/
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
// Copyright (c) 2009-2010 Camilla Berglund <elmindreda@elmindreda.org>
|
// Copyright (c) 2009-2010 Camilla Berglund <elmindreda@elmindreda.org>
|
||||||
|
// Copyright (c) 2012 Torsten Walluhn <tw@mad-cad.net>
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied
|
// This software is provided 'as-is', without any express or implied
|
||||||
// warranty. In no event will the authors be held liable for any damages
|
// warranty. In no event will the authors be held liable for any damages
|
||||||
@ -86,7 +87,7 @@ typedef struct
|
|||||||
static _glfwJoystick _glfwJoysticks[GLFW_JOYSTICK_LAST + 1];
|
static _glfwJoystick _glfwJoysticks[GLFW_JOYSTICK_LAST + 1];
|
||||||
|
|
||||||
|
|
||||||
void getElementsCFArrayHandler(const void* value, void* parameter);
|
static void getElementsCFArrayHandler(const void* value, void* parameter);
|
||||||
|
|
||||||
|
|
||||||
//========================================================================
|
//========================================================================
|
||||||
@ -610,16 +611,16 @@ int _glfwPlatformGetJoystickButtons(int joy, unsigned char* buttons,
|
|||||||
{
|
{
|
||||||
_glfwJoystickElement* hat = (_glfwJoystickElement*) CFArrayGetValueAtIndex(joystick.hats, i);
|
_glfwJoystickElement* hat = (_glfwJoystickElement*) CFArrayGetValueAtIndex(joystick.hats, i);
|
||||||
|
|
||||||
const int value = hat->value;
|
int value = hat->value;
|
||||||
if (value < 0 || value > 8)
|
if (value < 0 || value > 8)
|
||||||
value = 8;
|
value = 8;
|
||||||
|
|
||||||
for (j = 0; j < 4 && button < numbuttons; j++)
|
for (j = 0; j < 4 && button < numbuttons; j++)
|
||||||
{
|
{
|
||||||
if (directions[value] & (1 << j))
|
if (directions[value] & (1 << j))
|
||||||
buttons[button = GLFW_PRESS;
|
buttons[button] = GLFW_PRESS;
|
||||||
else
|
else
|
||||||
buttons[button = GLFW_RELEASE;
|
buttons[button] = GLFW_RELEASE;
|
||||||
|
|
||||||
button++;
|
button++;
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
// Copyright (c) 2002-2006 Marcus Geelnard
|
// Copyright (c) 2002-2006 Marcus Geelnard
|
||||||
// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>
|
// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>
|
||||||
|
// Copyright (c) 2012 Torsten Walluhn <tw@mad-cad.net>
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied
|
// This software is provided 'as-is', without any express or implied
|
||||||
// warranty. In no event will the authors be held liable for any damages
|
// warranty. In no event will the authors be held liable for any damages
|
||||||
@ -31,7 +32,11 @@
|
|||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#include <sys/malloc.h>
|
||||||
|
#else
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//========================================================================
|
//========================================================================
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
// Copyright (c) 2002-2006 Marcus Geelnard
|
// Copyright (c) 2002-2006 Marcus Geelnard
|
||||||
// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>
|
// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>
|
||||||
|
// Copyright (c) 2012 Torsten Walluhn <tw@mad-cad.net>
|
||||||
//
|
//
|
||||||
// This software is provided 'as-is', without any express or implied
|
// This software is provided 'as-is', without any express or implied
|
||||||
// warranty. In no event will the authors be held liable for any damages
|
// warranty. In no event will the authors be held liable for any damages
|
||||||
@ -32,7 +33,11 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#include <sys/malloc.h>
|
||||||
|
#else
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//========================================================================
|
//========================================================================
|
||||||
|
Loading…
Reference in New Issue
Block a user