From 800772e993a3ceffa01ccf3fca449d3279cde338 Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Sun, 17 Nov 2024 01:14:26 +0000
Subject: [PATCH 1/1] egl: fix fgPlatformDestroyContext prototype for C23

C23 removes unprototyped functions, so this conflicted with the definition
in fg_init_x11.c.

Bug: https://github.com/freeglut/freeglut/issues/186
---
 src/egl/fg_init_egl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/egl/fg_init_egl.h b/src/egl/fg_init_egl.h
index 592c5221..8753dc0b 100644
--- a/src/egl/fg_init_egl.h
+++ b/src/egl/fg_init_egl.h
@@ -28,6 +28,6 @@
 
 extern void fghPlatformInitializeEGL();
 extern void fghPlatformCloseDisplayEGL();
-extern void fgPlatformDestroyContext();
+extern void fgPlatformDestroyContext ( SFG_PlatformDisplay pDisplay, SFG_WindowContextType MContext );
 
 #endif
-- 
2.50.0

From 84091ec3893ea75b5aca04d4f9feecd5b9df781a Mon Sep 17 00:00:00 2001
From: Andrew Woods <drew.woods@gmail.com>
Date: Mon, 10 Mar 2025 19:06:32 -0400
Subject: [PATCH 1/1] build: remove strict-prototype warnings (#202)

* build: remove strict-prototype warnings

Removes these types of warnings:
 - warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]

Test builds ran:
 - CFLAGS="-Wall -Wpedantic"  cmake -DCMAKE_BUILD_TYPE=Debug -DFREEGLUT_COCOA=OFF .. && make
 - CFLAGS="-std=gnu89 -Wall -Wpedantic" cmake -DCMAKE_BUILD_TYPE=Debug -DFREEGLUT_COCOA=OFF .. && make
---
 src/egl/fg_init_egl.c | 4 ++--
 src/egl/fg_init_egl.h | 4 ++--
 src/fg_gl2.c          | 2 +-
 src/fg_gl2.h          | 2 +-
 src/fg_internal.h     | 6 +++---
 src/fg_structure.c    | 4 ++--
 6 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/egl/fg_init_egl.c b/src/egl/fg_init_egl.c
index 3c83fb2a..89f6c3dd 100644
--- a/src/egl/fg_init_egl.c
+++ b/src/egl/fg_init_egl.c
@@ -30,7 +30,7 @@
 /*
  * A call to this function should initialize all the display stuff...
  */
-void fghPlatformInitializeEGL()
+void fghPlatformInitializeEGL( void )
 {
   /* CreateDisplay */
   /* Using EGL_DEFAULT_DISPLAY, or a specific native display */
@@ -59,7 +59,7 @@ void fghPlatformInitializeEGL()
   /* fgDisplay.ScreenHeightMM = ...; */
 }
 
-void fghPlatformCloseDisplayEGL()
+void fghPlatformCloseDisplayEGL( void )
 {
   if (fgDisplay.pDisplay.egl.Display != EGL_NO_DISPLAY) {
     eglTerminate(fgDisplay.pDisplay.egl.Display);
diff --git a/src/egl/fg_init_egl.h b/src/egl/fg_init_egl.h
index 8753dc0b..4700aaeb 100644
--- a/src/egl/fg_init_egl.h
+++ b/src/egl/fg_init_egl.h
@@ -26,8 +26,8 @@
 #ifndef __FG_INIT_EGL_H__
 #define __FG_INIT_EGL_H__
 
-extern void fghPlatformInitializeEGL();
-extern void fghPlatformCloseDisplayEGL();
+extern void fghPlatformInitializeEGL( void );
+extern void fghPlatformCloseDisplayEGL( void );
 extern void fgPlatformDestroyContext ( SFG_PlatformDisplay pDisplay, SFG_WindowContextType MContext );
 
 #endif
diff --git a/src/fg_gl2.c b/src/fg_gl2.c
index 1a3ec3d8..09cd0e9d 100644
--- a/src/fg_gl2.c
+++ b/src/fg_gl2.c
@@ -59,7 +59,7 @@ void FGAPIENTRY glutSetVertexAttribTexCoord2(GLint attrib) {
 #define LOADFUNC(ptr, type, name)	\
 	do { if(!(ptr = (type)glutGetProcAddress(name))) return; } while(0)
 
-void fgInitGL2() {
+void fgInitGL2( void ) {
 #ifdef GL_ES_VERSION_2_0
     fgState.HasOpenGL20 = (fgState.MajorVersion >= 2);
 #else
diff --git a/src/fg_gl2.h b/src/fg_gl2.h
index 53cbc333..48e19a8b 100644
--- a/src/fg_gl2.h
+++ b/src/fg_gl2.h
@@ -77,6 +77,6 @@ extern FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
 
 #    endif
 
-extern void fgInitGL2();
+extern void fgInitGL2( void );
 
 #endif
diff --git a/src/fg_internal.h b/src/fg_internal.h
index 9dfcc8dd..617a13d7 100644
--- a/src/fg_internal.h
+++ b/src/fg_internal.h
@@ -573,7 +573,7 @@ struct tagSFG_WindowState   /* as per notes above, sizes always refer to the cli
  * defined in freeglut_ext.h, but if we include that header in this file
  * a bunch of other stuff (font-related) blows up!
  */
-typedef void (*SFG_Proc)();
+typedef void (*SFG_Proc)( void );
 
 
 /*
@@ -1079,7 +1079,7 @@ void        fgOpenWindow( SFG_Window* window, const char* title,
                           GLboolean gameMode, GLboolean isSubWindow );
 void        fgCloseWindow( SFG_Window* window );
 void        fgAddToWindowDestroyList ( SFG_Window* window );
-void        fgCloseWindows ();
+void        fgCloseWindows ( void );
 void        fgDestroyWindow( SFG_Window* window );
 
 /* Menu creation and destruction. Defined in fg_structure.c */
@@ -1149,7 +1149,7 @@ SFG_Menu* fgMenuByID( int menuID );
  * Returns active menu, if any. Assumption: only one menu active throughout application at any one time.
  * This is easier than fgWindowByXXX as all menus are placed in one doubly linked list...
  */
-SFG_Menu* fgGetActiveMenu( );
+SFG_Menu* fgGetActiveMenu( void );
 
 /*
  * The menu activation and deactivation the code. This is the meat
diff --git a/src/fg_structure.c b/src/fg_structure.c
index 747a8b5e..d29a80cb 100644
--- a/src/fg_structure.c
+++ b/src/fg_structure.c
@@ -192,7 +192,7 @@ void fgAddToWindowDestroyList( SFG_Window* window )
 /*
  * Function to close down all the windows in the "WindowsToDestroy" list
  */
-void fgCloseWindows( )
+void fgCloseWindows( void )
 {
     while( fgStructure.WindowsToDestroy.First )
     {
@@ -598,7 +598,7 @@ static void fghcbGetActiveMenu( SFG_Menu *menu,
  * This is false when a submenu is also open.
  * This is easier than fgWindowByXXX as all menus are placed in one doubly linked list...
  */
-SFG_Menu* fgGetActiveMenu( )
+SFG_Menu* fgGetActiveMenu( void )
 {
     SFG_Enumerator enumerator;
 
-- 
2.50.0

