* type.
*/
#define FETCH_WCB(window,cbname) \
- ((FGCB ## cbname)((window).CallBacks[CB_ ## cbname]))
+ ((window).CallBacks[CB_ ## cbname])
/*
* INVOKE_WCB() is used as:
* 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 ); \
- FETCH_WCB( window, cbname ) arg_list; \
+ func arg_list; \
} \
} while( 0 )
+#else
+#define INVOKE_WCB(window,cbname,arg_list) \
+do \
+{ \
+ if( FETCH_WCB( window, cbname ) ) \
+ { \
+ fgSetWindow( &window ); \
+ ((FGCB ## cbname)FETCH_WCB( window, cbname )) arg_list; \
+ } \
+} while( 0 )
+#endif
/*
* The window callbacks the user can supply us with. Should be kept portable.
SFG_List WindowsToDestroy;
SFG_Window* CurrentWindow; /* The currently set window */
- SFG_Menu* CurrentMenu; /* Same, but menu... */
+ SFG_Menu* CurrentMenu; /* Same, but menu... */
SFG_MenuContext* MenuContext; /* OpenGL rendering context for menus */
* window set, respectively:
*/
#define FREEGLUT_EXIT_IF_NO_WINDOW( string ) \
- if ( ! fgStructure.CurrentWindow ) \
+ if ( ! fgStructure.CurrentWindow ) \
{ \
fgError ( " ERROR: Function <%s> called" \
" with no current window defined.", (string) ) ; \
* 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 );
}