From 54cd2b92f330391258294c824002b892a06aca55 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Fri, 19 Oct 2018 11:12:59 +0000 Subject: [PATCH 1/2] Fix build with gcc -fvisibility=hidden FGAPI used to be defined to an empty body on non-windows platforms. Provide a proper definition for gcc to fix build with gcc -fvisibility=hidden. Add FGAPI attribute to definitions of glutStroke* and glutBitmap* variables, to make them exported when gcc -fvisibility=hidden is in effect. --- freeglut/freeglut/include/GL/freeglut_std.h | 4 ++++ .../src/x11/fg_glutfont_definitions_x11.c | 18 +++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/freeglut/freeglut/include/GL/freeglut_std.h b/freeglut/freeglut/include/GL/freeglut_std.h index a658c7c..3d9132f 100644 --- a/freeglut/freeglut/include/GL/freeglut_std.h +++ b/freeglut/freeglut/include/GL/freeglut_std.h @@ -111,7 +111,11 @@ #else /* Non-Windows definition of FGAPI and FGAPIENTRY */ +# ifdef __GNUC__ +# define FGAPI __attribute__((__visibility__("default"))) +# else # define FGAPI +# endif # define FGAPIENTRY #endif diff --git a/freeglut/freeglut/src/x11/fg_glutfont_definitions_x11.c b/freeglut/freeglut/src/x11/fg_glutfont_definitions_x11.c index bec2037..fd6a844 100644 --- a/freeglut/freeglut/src/x11/fg_glutfont_definitions_x11.c +++ b/freeglut/freeglut/src/x11/fg_glutfont_definitions_x11.c @@ -103,13 +103,13 @@ static struct freeglutBitmapFont glutBit static struct freeglutBitmapFont glutBitmapHelvetica18_ ; -void *glutStrokeRoman = &glutStrokeRoman_ ; -void *glutStrokeMonoRoman = &glutStrokeMonoRoman_ ; +FGAPI void *glutStrokeRoman = &glutStrokeRoman_ ; +FGAPI void *glutStrokeMonoRoman = &glutStrokeMonoRoman_ ; -void *glutBitmap9By15 = &glutBitmap9By15_ ; -void *glutBitmap8By13 = &glutBitmap8By13_ ; -void *glutBitmapTimesRoman10 = &glutBitmapTimesRoman10_ ; -void *glutBitmapTimesRoman24 = &glutBitmapTimesRoman24_ ; -void *glutBitmapHelvetica10 = &glutBitmapHelvetica10_ ; -void *glutBitmapHelvetica12 = &glutBitmapHelvetica12_ ; -void *glutBitmapHelvetica18 = &glutBitmapHelvetica18_ ; +FGAPI void *glutBitmap9By15 = &glutBitmap9By15_ ; +FGAPI void *glutBitmap8By13 = &glutBitmap8By13_ ; +FGAPI void *glutBitmapTimesRoman10 = &glutBitmapTimesRoman10_ ; +FGAPI void *glutBitmapTimesRoman24 = &glutBitmapTimesRoman24_ ; +FGAPI void *glutBitmapHelvetica10 = &glutBitmapHelvetica10_ ; +FGAPI void *glutBitmapHelvetica12 = &glutBitmapHelvetica12_ ; +FGAPI void *glutBitmapHelvetica18 = &glutBitmapHelvetica18_ ;