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:
fayjf 2005-04-26 17:44:57 +00:00
parent cd7f74dca3
commit 0bd8456a65
2 changed files with 18 additions and 5 deletions

View File

@ -403,7 +403,7 @@ do \
* type. * type.
*/ */
#define FETCH_WCB(window,cbname) \ #define FETCH_WCB(window,cbname) \
((FGCB ## cbname)((window).CallBacks[CB_ ## cbname])) ((window).CallBacks[CB_ ## cbname])
/* /*
* INVOKE_WCB() is used as: * INVOKE_WCB() is used as:
@ -424,15 +424,28 @@ do \
* current window. * 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) \ #define INVOKE_WCB(window,cbname,arg_list) \
do \ do \
{ \ { \
if( FETCH_WCB( window, cbname ) ) \ if( FETCH_WCB( window, cbname ) ) \
{ \ { \
fgSetWindow( &window ); \ fgSetWindow( &window ); \
FETCH_WCB( window, cbname ) arg_list; \ ((FGCB ## cbname)FETCH_WCB( window, cbname )) arg_list; \
} \ } \
} while( 0 ) } while( 0 )
#endif
/* /*
* The window callbacks the user can supply us with. Should be kept portable. * The window callbacks the user can supply us with. Should be kept portable.

View File

@ -165,7 +165,7 @@ void fgAddToWindowDestroyList( SFG_Window* window )
* to ensure that they are no longer called after this point. * 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 ); fghClearCallBacks( window );
SET_WCB( *window, Destroy, destroy ); SET_WCB( *window, Destroy, destroy );
} }