From adebde7a9959aa6414e1599847edea63feb81159 Mon Sep 17 00:00:00 2001
From: inmarket <andrewh@inmarket.com.au>
Date: Tue, 27 Jan 2015 13:42:11 +1000
Subject: Fix multiple display/keyboard/mouse problem with some compilers.

---
 src/ginput/ginput_keyboard.c | 9 ++++-----
 src/ginput/ginput_mouse.c    | 9 ++++-----
 2 files changed, 8 insertions(+), 10 deletions(-)

(limited to 'src/ginput')

diff --git a/src/ginput/ginput_keyboard.c b/src/ginput/ginput_keyboard.c
index eac2e9e0..cdbe52a6 100644
--- a/src/ginput/ginput_keyboard.c
+++ b/src/ginput/ginput_keyboard.c
@@ -457,16 +457,15 @@ static void KeyboardPoll(void *param) {
 	}
 }
 
-typedef const GKeyboardVMT const GKEYBOARDVMTLIST[];
-
 void _gkeyboardInit(void) {
 	// GINPUT_KEYBOARD_DRIVER_LIST is defined - create each driver instance
 	#if defined(GINPUT_KEYBOARD_DRIVER_LIST)
 		{
 			int		i;
+			typedef const GKeyboardVMT const GKEYBOARDVMTLIST[1];
 
-			extern GKEYBOARDVMTLIST				GINPUT_KEYBOARD_DRIVER_LIST;
-			static GKEYBOARDVMTLIST	dclist[] = {GINPUT_KEYBOARD_DRIVER_LIST};
+			extern GKEYBOARDVMTLIST GINPUT_KEYBOARD_DRIVER_LIST;
+			static const GKeyboardVMT *	const dclist[] = {GINPUT_KEYBOARD_DRIVER_LIST};
 
 			for(i = 0; i < sizeof(dclist)/sizeof(dclist[0]); i++) {
                 if (!(dclist[i]->d.flags & GKEYBOARD_VFLG_DYNAMICONLY))
@@ -477,7 +476,7 @@ void _gkeyboardInit(void) {
 	// One and only one mouse
 	#else
 		{
-			extern GKEYBOARDVMTLIST			GKEYBOARDVMT_OnlyOne;
+			extern const GKeyboardVMT const GKEYBOARDVMT_OnlyOne[1];
 
             if (!(GKEYBOARDVMT_OnlyOne->d.flags & GKEYBOARD_VFLG_DYNAMICONLY))
 					gdriverRegister(&GKEYBOARDVMT_OnlyOne->d, 0);
diff --git a/src/ginput/ginput_mouse.c b/src/ginput/ginput_mouse.c
index f88c2ded..fc993646 100644
--- a/src/ginput/ginput_mouse.c
+++ b/src/ginput/ginput_mouse.c
@@ -623,16 +623,15 @@ static void MousePoll(void *param) {
 	}
 #endif
 
-typedef const GMouseVMT const GMOUSEVMTLIST[];
-
 void _gmouseInit(void) {
 	// GINPUT_MOUSE_DRIVER_LIST is defined - create each driver instance
 	#if defined(GINPUT_MOUSE_DRIVER_LIST)
 		{
 			int		i;
+			typedef const GMouseVMT const GMOUSEVMTLIST[1];
 
-			extern GMOUSEVMTLIST				GINPUT_MOUSE_DRIVER_LIST;
-			static GMOUSEVMTLIST	dclist[] = {GINPUT_MOUSE_DRIVER_LIST};
+			extern GMOUSEVMTLIST GINPUT_MOUSE_DRIVER_LIST;
+			static const GMouseVMT * const dclist[] = {GINPUT_MOUSE_DRIVER_LIST};
 
 			for(i = 0; i < sizeof(dclist)/sizeof(dclist[0]); i++) {
                 if (!(dclist[i]->d.flags & GMOUSE_VFLG_DYNAMICONLY))
@@ -643,7 +642,7 @@ void _gmouseInit(void) {
 	// One and only one mouse
 	#else
 		{
-			extern GMOUSEVMTLIST			GMOUSEVMT_OnlyOne;
+			extern const GMouseVMT const GMOUSEVMT_OnlyOne[1];
 
             if (!(GMOUSEVMT_OnlyOne->d.flags & GMOUSE_VFLG_DYNAMICONLY))
 					gdriverRegister(&GMOUSEVMT_OnlyOne->d, GDISP);
-- 
cgit v1.2.3