Added the ugly ATEXIT_HACK from GLUT 3.7, making freeglut binary compatible with...
[freeglut] / src / freeglut_window.c
index 005074b..03a3b25 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"
 
@@ -1092,6 +1093,14 @@ int FGAPIENTRY glutCreateWindow( const char* title )
                            GL_FALSE, GL_FALSE )->ID;
 }
 
+#ifdef _WIN32
+int FGAPIENTRY __glutCreateWindowWithExit( const char *title, void (__cdecl *exitfunc)(int) )
+{
+  __glutExitFunc = exitfunc;
+  return glutCreateWindow( title );
+}
+#endif
+
 /*
  * This function creates a sub window.
  */