From 9108ab693f53bc300edbad19912088c683ff17ff Mon Sep 17 00:00:00 2001 From: rkrolib Date: Fri, 7 Nov 2003 15:30:59 +0000 Subject: [PATCH] Adopted Eero Pajarre's suggestion of using a do { ... } while rather than { ... } for the INVOKE_WCB() macro. This lets it be used "more like a function", in that: if( ... ) INVOKE_WCB( ... ); else ... ...is now legal. git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@321 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/freeglut_internal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/freeglut/freeglut/src/freeglut_internal.h b/freeglut/freeglut/src/freeglut_internal.h index f74b71c..ea311b6 100644 --- a/freeglut/freeglut/src/freeglut_internal.h +++ b/freeglut/freeglut/src/freeglut_internal.h @@ -389,13 +389,14 @@ struct tagSFG_WindowState * */ #define INVOKE_WCB(window,cbname,arg_list) \ +do \ { \ if( FETCH_WCB( window, cbname ) ) \ { \ fgSetWindow( &window ); \ FETCH_WCB( window, cbname ) arg_list; \ } \ -} +} while( 0 ) /* * The window callbacks the user can supply us with. Should be kept portable.