Fixing the typecasts on the callback fetches and invocations to allow \"freeglut\" to compile with GCC 4.0
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@584 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
cd7f74dca3
commit
0bd8456a65
@ -403,7 +403,7 @@ do \
|
||||
* type.
|
||||
*/
|
||||
#define FETCH_WCB(window,cbname) \
|
||||
((FGCB ## cbname)((window).CallBacks[CB_ ## cbname]))
|
||||
((window).CallBacks[CB_ ## cbname])
|
||||
|
||||
/*
|
||||
* INVOKE_WCB() is used as:
|
||||
@ -424,15 +424,28 @@ do \
|
||||
* current window.
|
||||
*
|
||||
*/
|
||||
#if TARGET_HOST_WIN32
|
||||
#define INVOKE_WCB(window,cbname,arg_list) \
|
||||
do \
|
||||
{ \
|
||||
if( FETCH_WCB( window, cbname ) ) \
|
||||
{ \
|
||||
FGCB ## cbname func = (FGCB ## cbname)(FETCH_WCB( window, cbname )); \
|
||||
fgSetWindow( &window ); \
|
||||
func arg_list; \
|
||||
} \
|
||||
} while( 0 )
|
||||
#else
|
||||
#define INVOKE_WCB(window,cbname,arg_list) \
|
||||
do \
|
||||
{ \
|
||||
if( FETCH_WCB( window, cbname ) ) \
|
||||
{ \
|
||||
fgSetWindow( &window ); \
|
||||
FETCH_WCB( window, cbname ) arg_list; \
|
||||
((FGCB ## cbname)FETCH_WCB( window, cbname )) arg_list; \
|
||||
} \
|
||||
} while( 0 )
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The window callbacks the user can supply us with. Should be kept portable.
|
||||
|
@ -165,7 +165,7 @@ void fgAddToWindowDestroyList( SFG_Window* window )
|
||||
* to ensure that they are no longer called after this point.
|
||||
*/
|
||||
{
|
||||
FGCBDestroy destroy = FETCH_WCB( *window, Destroy );
|
||||
FGCBDestroy destroy = (FGCBDestroy)FETCH_WCB( *window, Destroy );
|
||||
fghClearCallBacks( window );
|
||||
SET_WCB( *window, Destroy, destroy );
|
||||
}
|
||||
|
Reference in New Issue
Block a user