From c969a6321bc21d80fd9b993a6355e84f1bc880b8 Mon Sep 17 00:00:00 2001 From: Sven Panne Date: Sun, 23 Jan 2005 17:52:16 +0000 Subject: [PATCH 1/1] Stylistic change only (added "do { ... } while( 0 )" around multi-statement macros) git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@564 7f0cb862-5218-0410-a997-914c9d46530a --- src/freeglut_callbacks.c | 11 +++++++---- src/freeglut_internal.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/freeglut_callbacks.c b/src/freeglut_callbacks.c index 9e5e5c6..f1f4b90 100644 --- a/src/freeglut_callbacks.c +++ b/src/freeglut_callbacks.c @@ -33,10 +33,13 @@ /* * All of the callbacks setting methods can be generalized to this: */ -#define SET_CALLBACK(a) \ - if( fgStructure.Window == NULL ) \ - return; \ - SET_WCB( ( *( fgStructure.Window ) ), a, callback ); +#define SET_CALLBACK(a) \ +do \ +{ \ + if( fgStructure.Window == NULL ) \ + return; \ + SET_WCB( ( *( fgStructure.Window ) ), a, callback ); \ +} while( 0 ) /* * Sets the Display callback for the current window diff --git a/src/freeglut_internal.h b/src/freeglut_internal.h index a6a4a76..4004590 100644 --- a/src/freeglut_internal.h +++ b/src/freeglut_internal.h @@ -381,7 +381,7 @@ do \ { \ if( FETCH_WCB( window, cbname ) != func ) \ (((window).CallBacks[CB_ ## cbname]) = (void *) func); \ -} while( 0 ) \ +} while( 0 ) /* * FETCH_WCB() is used as: -- 1.7.10.4