X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_internal.h;h=02262142e1d863c3c6623803df45b0386ce89142;hb=fc98e7c77fdb427eab9de022cff9e149d6737971;hp=cddae4e86ec48bdfe43123d1ec30ec65e691d66b;hpb=6a5114c6be53a01766ee8b7b2867bd22d9008a37;p=freeglut diff --git a/src/freeglut_internal.h b/src/freeglut_internal.h index cddae4e..0226214 100644 --- a/src/freeglut_internal.h +++ b/src/freeglut_internal.h @@ -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 ); \ - 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. @@ -570,7 +583,7 @@ struct tagSFG_Structure 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 */ @@ -693,7 +706,7 @@ extern SFG_State fgState; * 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) ) ; \