This file is part of MXE. See LICENSE.md for licensing information.

Contains ad hoc patches for cross building.

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Boris Nagaev <bnagaev@gmail.com>
Date: Thu, 14 Jul 2016 19:15:17 +0300
Subject: [PATCH 1/2] add glu to requirements in .pc file

glu.pc is generated by mxe-conf and it adds -lglu32 to linker flags.
libglu32.a defines gluUnProject and other symbols used by users of GLU.

Fix https://github.com/mxe/mxe/issues/1434
See https://github.com/mxe/mxe/pull/1429
See https://stackoverflow.com/a/17451000

diff --git a/freeglut.pc.in b/freeglut.pc.in
index 1111111..2222222 100644
--- a/freeglut.pc.in
+++ b/freeglut.pc.in
@@ -8,3 +8,4 @@ Version: @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@
 Libs: -L${libdir} -l@PC_LIBNAME@
 Libs.private: @PC_LIBS_PRIVATE@
 Cflags: -I${includedir} @PC_CFLAGS@
+Requires: glu

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Thu, 28 May 2020 12:36:54 +0200
Subject: [PATCH 2/2] gcc 10 compatibility: add missing "extern"

Related to:
        Default to -fno-common
        https://gcc.gnu.org/gcc-10/porting_to.html

diff --git a/src/fg_gl2.c b/src/fg_gl2.c
index 1111111..2222222 100644
--- a/src/fg_gl2.c
+++ b/src/fg_gl2.c
@@ -27,6 +27,14 @@
 #include "fg_internal.h"
 #include "fg_gl2.h"
 
+FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
+FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
+FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
+FGH_PFNGLBUFFERDATAPROC fghBufferData;
+FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
+FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
+FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
+
 void FGAPIENTRY glutSetVertexAttribCoord3(GLint attrib) {
   if (fgStructure.CurrentWindow != NULL)
     fgStructure.CurrentWindow->Window.attribute_v_coord = attrib;
diff --git a/src/fg_gl2.h b/src/fg_gl2.h
index 1111111..2222222 100644
--- a/src/fg_gl2.h
+++ b/src/fg_gl2.h
@@ -67,13 +67,13 @@ typedef void (APIENTRY *FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
 typedef void (APIENTRY *FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint);
 typedef void (APIENTRY *FGH_PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
 
-FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
-FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
-FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
-FGH_PFNGLBUFFERDATAPROC fghBufferData;
-FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
-FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
-FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
+extern FGH_PFNGLGENBUFFERSPROC fghGenBuffers;
+extern FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers;
+extern FGH_PFNGLBINDBUFFERPROC fghBindBuffer;
+extern FGH_PFNGLBUFFERDATAPROC fghBufferData;
+extern FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray;
+extern FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray;
+extern FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer;
 
 #    endif
 
