Added the ugly ATEXIT_HACK from GLUT 3.7, making freeglut binary compatible with...
[freeglut] / src / freeglut_menu.c
index a96f5d6..8a04d0b 100644 (file)
@@ -25,6 +25,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
+#define FREEGLUT_BUILDING_LIB
 #include <GL/freeglut.h>
 #include "freeglut_internal.h"
 
@@ -778,6 +779,12 @@ int FGAPIENTRY glutCreateMenu( void(* callback)( int ) )
     return fgCreateMenu( callback )->ID;
 }
 
+int FGAPIENTRY __glutCreateMenuWithExit( void(* callback)( int ), void (__cdecl *exitfunc)(int) )
+{
+  __glutExitFunc = exitfunc;
+  return glutCreateMenu( callback );
+}
+
 /*
  * Destroys a menu object, removing all references to it
  */