Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37749853
en ru br
ALT Linux repos
S:3.4.0-alt1
5.0: 2.4.0-alt3

Group :: System/Libraries
RPM: libfreeglut

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: libfreeglut-alt-fix-visibility-hidden.patch
Download


From 54cd2b92f330391258294c824002b892a06aca55 Mon Sep 17 00:00:00 2001
From: "Dmitry V. Levin" <ldv@altlinux.org>
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
@@ -91,14 +91,14 @@ struct freeglutBitmapFont
 };
 
 
-struct freeglutStrokeFont glutStrokeRoman ;
-struct freeglutStrokeFont glutStrokeMonoRoman ;
+FGAPI struct freeglutStrokeFont glutStrokeRoman ;
+FGAPI struct freeglutStrokeFont glutStrokeMonoRoman ;
 
-struct freeglutBitmapFont glutBitmap9By15 ;
-struct freeglutBitmapFont glutBitmap8By13 ;
-struct freeglutBitmapFont glutBitmapTimesRoman10 ;
-struct freeglutBitmapFont glutBitmapTimesRoman24 ;
-struct freeglutBitmapFont glutBitmapHelvetica10 ;
-struct freeglutBitmapFont glutBitmapHelvetica12 ;
-struct freeglutBitmapFont glutBitmapHelvetica18 ;
+FGAPI struct freeglutBitmapFont glutBitmap9By15 ;
+FGAPI struct freeglutBitmapFont glutBitmap8By13 ;
+FGAPI struct freeglutBitmapFont glutBitmapTimesRoman10 ;
+FGAPI struct freeglutBitmapFont glutBitmapTimesRoman24 ;
+FGAPI struct freeglutBitmapFont glutBitmapHelvetica10 ;
+FGAPI struct freeglutBitmapFont glutBitmapHelvetica12 ;
+FGAPI struct freeglutBitmapFont glutBitmapHelvetica18 ;
 
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin