diff options
| author | inmarket <andrewh@inmarket.com.au> | 2014-11-26 13:01:47 +1000 | 
|---|---|---|
| committer | inmarket <andrewh@inmarket.com.au> | 2014-11-26 13:02:47 +1000 | 
| commit | bd3a58ccfc0a484e18cd562539edc71c2f8ebefc (patch) | |
| tree | 46b7f6ce86eb194df8d2a72928d4bffb04ce0bf7 /src | |
| parent | 746527632c1fd6a35f23c828a2bb392bcfc1659a (diff) | |
| download | uGFX-bd3a58ccfc0a484e18cd562539edc71c2f8ebefc.tar.gz uGFX-bd3a58ccfc0a484e18cd562539edc71c2f8ebefc.tar.bz2 uGFX-bd3a58ccfc0a484e18cd562539edc71c2f8ebefc.zip | |
Fix some extern structure definitions that cause problems with some compilers
Diffstat (limited to 'src')
| -rw-r--r-- | src/gdisp/gdisp_gdisp.c | 12 | ||||
| -rw-r--r-- | src/ginput/ginput_mouse.c | 16 | 
2 files changed, 16 insertions, 12 deletions
| diff --git a/src/gdisp/gdisp_gdisp.c b/src/gdisp/gdisp_gdisp.c index f5675a82..dcac102d 100644 --- a/src/gdisp/gdisp_gdisp.c +++ b/src/gdisp/gdisp_gdisp.c @@ -561,6 +561,8 @@ static void line_clip(GDisplay *g) {  /* Driver exported functions.                                                */  /*===========================================================================*/ +typedef const GDISPVMT const GDISPVMTLIST[]; +  void _gdispInit(void)  {  	// GDISP_DRIVER_LIST is defined - create each driver instance @@ -568,19 +570,19 @@ void _gdispInit(void)  		{  			unsigned	i; -			extern GDriverVMTList					GDISP_DRIVER_LIST; -			static const struct GDriverVMT const *	dclist[] = {GDISP_DRIVER_LIST}; +			extern GDISPVMTLIST				GDISP_DRIVER_LIST; +			static GDISPVMTLIST dclist[] = {GDISP_DRIVER_LIST};  			for(i = 0; i < sizeof(dclist)/sizeof(dclist[0]); i++) -				gdriverRegister(dclist[i], 0); +				gdriverRegister(&dclist[i]->d, 0);  		}  	#elif GDISP_TOTAL_DISPLAYS > 1  		{  			unsigned	i; -			extern GDriverVMTList					GDISPVMT_OnlyOne; +			extern GDISPVMTLIST				GDISPVMT_OnlyOne;  			for(i = 0; i < GDISP_TOTAL_DISPLAYS; i++) -				gdriverRegister(GDISPVMT_OnlyOne, 0); +				gdriverRegister(&GDISPVMT_OnlyOne->d, 0);  		}  	#else  		{ diff --git a/src/ginput/ginput_mouse.c b/src/ginput/ginput_mouse.c index e6741b76..4a1906ec 100644 --- a/src/ginput/ginput_mouse.c +++ b/src/ginput/ginput_mouse.c @@ -623,28 +623,30 @@ 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; -			extern GDriverVMTList					GINPUT_MOUSE_DRIVER_LIST; -			static const struct GDriverVMT const *	dclist[] = {GINPUT_MOUSE_DRIVER_LIST}; +			extern GMOUSEVMTLIST				GINPUT_MOUSE_DRIVER_LIST; +			static GMOUSEVMTLIST	dclist[] = {GINPUT_MOUSE_DRIVER_LIST};  			for(i = 0; i < sizeof(dclist)/sizeof(dclist[0]); i++) { -                if (!(dclist[i]->flags & GMOUSE_VFLG_DYNAMICONLY)) -					gdriverRegister(dclist[i], GDISP); +                if (!(dclist[i]->d.flags & GMOUSE_VFLG_DYNAMICONLY)) +					gdriverRegister(&dclist[i]->d, GDISP);  			}  		}  	// One and only one mouse  	#else  		{ -			extern GDriverVMTList			GMOUSEVMT_OnlyOne; +			extern GMOUSEVMTLIST			GMOUSEVMT_OnlyOne; -            if (!(GMOUSEVMT_OnlyOne->flags & GMOUSE_VFLG_DYNAMICONLY)) -					gdriverRegister(GMOUSEVMT_OnlyOne, GDISP); +            if (!(GMOUSEVMT_OnlyOne->d.flags & GMOUSE_VFLG_DYNAMICONLY)) +					gdriverRegister(&GMOUSEVMT_OnlyOne->d, GDISP);  		}  	#endif | 
