Fix some extern structure definitions that cause problems with some compilers

ugfx_release_2.6
inmarket 2014-11-26 13:01:47 +10:00
parent 746527632c
commit bd3a58ccfc
2 changed files with 16 additions and 12 deletions

View File

@ -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
{

View File

@ -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