added error check (John Fay)
[freeglut] / src / freeglut_callbacks.c
index 9e5e5c6..2dd2232 100644 (file)
 /*
  * 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
@@ -128,6 +131,7 @@ static void fghVisibility( int status )
 {
     int glut_status = GLUT_VISIBLE;
 
+    FREEGLUT_INTERNAL_ERROR_EXIT_IF_NOT_INITIALISED ( "Visibility Callback" );
     freeglut_return_if_fail( fgStructure.Window );
 
     if( ( GLUT_HIDDEN == status )  || ( GLUT_FULLY_COVERED == status ) )