From 3f39c5ae420a21280875f285d529446c152a6234 Mon Sep 17 00:00:00 2001 From: Torsten Walluhn Date: Tue, 14 Aug 2012 23:34:26 +0200 Subject: [PATCH] Fixed compiling issues on mac os x with llvm-gcc 4.2 --- src/cocoa_joystick.m | 9 +++++---- src/fullscreen.c | 5 +++++ src/window.c | 5 +++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/cocoa_joystick.m b/src/cocoa_joystick.m index bf567f86..4ca3c3a7 100644 --- a/src/cocoa_joystick.m +++ b/src/cocoa_joystick.m @@ -5,6 +5,7 @@ // WWW: http://www.glfw.org/ //------------------------------------------------------------------------ // Copyright (c) 2009-2010 Camilla Berglund +// Copyright (c) 2012 Torsten Walluhn // // This software is provided 'as-is', without any express or implied // 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]; -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); - const int value = hat->value; + int value = hat->value; if (value < 0 || value > 8) value = 8; for (j = 0; j < 4 && button < numbuttons; j++) { if (directions[value] & (1 << j)) - buttons[button = GLFW_PRESS; + buttons[button] = GLFW_PRESS; else - buttons[button = GLFW_RELEASE; + buttons[button] = GLFW_RELEASE; button++; } diff --git a/src/fullscreen.c b/src/fullscreen.c index 9dab1a59..408a211f 100644 --- a/src/fullscreen.c +++ b/src/fullscreen.c @@ -6,6 +6,7 @@ //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund +// Copyright (c) 2012 Torsten Walluhn // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages @@ -31,7 +32,11 @@ #include "internal.h" #include +#ifdef __APPLE__ +#include +#else #include +#endif //======================================================================== diff --git a/src/window.c b/src/window.c index 1e169743..4e95129a 100644 --- a/src/window.c +++ b/src/window.c @@ -6,6 +6,7 @@ //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund +// Copyright (c) 2012 Torsten Walluhn // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages @@ -32,7 +33,11 @@ #include #include +#ifdef __APPLE__ +#include +#else #include +#endif //========================================================================