From f4eff70e98a58a6a1881c37ead31f1d2bf38f5a1 Mon Sep 17 00:00:00 2001 From: spanne Date: Sun, 23 Jan 2005 17:52:16 +0000 Subject: [PATCH] Stylistic change only (added "do { ... } while( 0 )" around multi-statement macros) git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@564 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/freeglut_callbacks.c | 11 +++++++---- freeglut/freeglut/src/freeglut_internal.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/freeglut/freeglut/src/freeglut_callbacks.c b/freeglut/freeglut/src/freeglut_callbacks.c index 9e5e5c6..f1f4b90 100644 --- a/freeglut/freeglut/src/freeglut_callbacks.c +++ b/freeglut/freeglut/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/freeglut/freeglut/src/freeglut_internal.h b/freeglut/freeglut/src/freeglut_internal.h index a6a4a76..4004590 100644 --- a/freeglut/freeglut/src/freeglut_internal.h +++ b/freeglut/freeglut/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: