Fix glut to work with -fvisibility=hidden
authorKristian Høgsberg <krh@bitplanet.net>
Mon, 4 Jan 2010 01:59:52 +0000 (20:59 -0500)
committerKristian Høgsberg <krh@bitplanet.net>
Mon, 4 Jan 2010 01:59:56 +0000 (20:59 -0500)
The GLUTAPI #define used in the header file to mark the font structs
visible wasn't kicking in because of the #define glutBitmap9By15 XXX
prior to #include <GL/glut.h>.  High quality code... worked around by
copying the GLUTAPI specifier to the invidual C files.

src/glut/glx/capturexfont.c
src/glut/glx/glut_8x13.c
src/glut/glx/glut_9x15.c
src/glut/glx/glut_hel10.c
src/glut/glx/glut_hel12.c
src/glut/glx/glut_hel18.c
src/glut/glx/glut_mroman.c
src/glut/glx/glut_roman.c
src/glut/glx/glut_tr10.c
src/glut/glx/glut_tr24.c
src/glut/glx/glutstroke.h

index b99e7930564a19899189cff289fb007ad463a25b..fd63fb7c49f98e2b2accb200cbe9696283cb7857 100644 (file)
@@ -321,6 +321,7 @@ captureXFont(Display * dpy, Font font, char *xfont, char *name)
     }
   }
   printf("};\n\n");
+  printf("GLUTAPI const BitmapFontRec %s;\n", name);
   printf("const BitmapFontRec %s = {\n", name);
   printf("\"%s\",\n", xfont);
   printf("%d,\n", last - first + 1);
index 843c63d35ae6d0faecbc56a6f49bd7fad4371f2f..f4e18eb0a4548f8bc1a951f2f871c6a73aa5fe63 100644 (file)
@@ -2064,6 +2064,7 @@ static const BitmapCharRec * const chars[] = {
 &ch255,
 };
 
+GLUTAPI const BitmapFontRec glutBitmap8By13;
 const BitmapFontRec glutBitmap8By13 = {
 "-misc-fixed-medium-r-normal--13-120-75-75-C-80-iso8859-1",
 256,
index 2d5c004e47a653acb622a84ebb8ce245e33982d5..7dbec124d096f88aeb97e17ae97f9c1637fd0342 100644 (file)
@@ -2066,6 +2066,7 @@ static const BitmapCharRec * const chars[] = {
 &ch255,
 };
 
+GLUTAPI const BitmapFontRec glutBitmap9By15;
 const BitmapFontRec glutBitmap9By15 = {
 "-misc-fixed-medium-r-normal--15-140-75-75-C-90-iso8859-1",
 256,
index 703cef38f260571519f55d23501281e19ad4bfd4..3de1750ce6c4c286380c0098559f5e588a0e9eb9 100644 (file)
@@ -1769,6 +1769,7 @@ static const BitmapCharRec * const chars[] = {
 &ch255,
 };
 
+GLUTAPI const BitmapFontRec glutBitmapHelvetica10;
 const BitmapFontRec glutBitmapHelvetica10 = {
 "-adobe-helvetica-medium-r-normal--10-100-75-75-p-56-iso8859-1",
 224,
index 68aed8a2bd65b598bda20c5aac541a76fd996ce7..e6f1bbb5e268f2ed41e483b5bd15f873487aac45 100644 (file)
@@ -1779,6 +1779,7 @@ static const BitmapCharRec * const chars[] = {
 &ch255,
 };
 
+GLUTAPI const BitmapFontRec glutBitmapHelvetica12;
 const BitmapFontRec glutBitmapHelvetica12 = {
 "-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1",
 224,
index f0800843e8efd1fbaa757b0279890fdac9efa752..3ddcefd6421d85fd1bbb42c1aaa876be3b0019a2 100644 (file)
@@ -1888,6 +1888,7 @@ static const BitmapCharRec * const chars[] = {
 &ch255,
 };
 
+GLUTAPI const BitmapFontRec glutBitmapHelvetica18;
 const BitmapFontRec glutBitmapHelvetica18 = {
 "-adobe-helvetica-medium-r-normal--18-180-75-75-p-98-iso8859-1",
 224,
index a29f043b4a8b2ebf8c26a4b0224fc20d905654ac..08f879a5112308f80d45c625c2b52ab85f887d2e 100644 (file)
@@ -1,7 +1,9 @@
 
 /* GENERATED FILE -- DO NOT MODIFY */
 
+#define glutStrokeMonoRoman XXX
 #include "glutstroke.h"
+#undef glutStrokeMonoRoman
 
 /* char: 33 '!' */
 
@@ -2447,5 +2449,6 @@ static const StrokeCharRec chars[] = {
     { 2, char127, 52.381, 104.762 },
 };
 
-StrokeFontRec glutStrokeMonoRoman = { "Roman", 128, chars, 119.048, -33.3333 };
+GLUTAPI const StrokeFontRec glutStrokeMonoRoman;
+const StrokeFontRec glutStrokeMonoRoman = { "Roman", 128, chars, 119.048, -33.3333 };
 
index af2b4ec956d2638c0f150b21c4087089f52366d3..95b9f8160f1cf258bc4de5e7c585f2c2a6f50e2a 100644 (file)
@@ -1,7 +1,9 @@
 
 /* GENERATED FILE -- DO NOT MODIFY */
 
+#define glutStrokeRoman XXX
 #include "glutstroke.h"
+#undef glutStrokeRoman
 
 /* char: 33 '!' */
 
@@ -2447,5 +2449,6 @@ static const StrokeCharRec chars[] = {
     { 2, char127, 33.3333, 66.6667 },
 };
 
-StrokeFontRec glutStrokeRoman = { "Roman", 128, chars, 119.048, -33.3333 };
+GLUTAPI const StrokeFontRec glutStrokeRoman;
+const StrokeFontRec glutStrokeRoman = { "Roman", 128, chars, 119.048, -33.3333 };
 
index 0fac8070ca50a90a95ab1054751b2e026e91e117..dbf5ebde5e068948c14d0fa6b24d15066dadd44d 100644 (file)
@@ -1768,6 +1768,7 @@ static const BitmapCharRec * const chars[] = {
 &ch255,
 };
 
+GLUTAPI const BitmapFontRec glutBitmapTimesRoman10;
 const BitmapFontRec glutBitmapTimesRoman10 = {
 "-adobe-times-medium-r-normal--10-100-75-75-p-54-iso8859-1",
 224,
index 22b0e5160352a245ba6deeeafbee1dc7e26fe83d..5db9d36e197affe60d0f2239e7ae9ccec01bc099 100644 (file)
@@ -2051,6 +2051,7 @@ static const BitmapCharRec * const chars[] = {
 &ch255,
 };
 
+GLUTAPI const BitmapFontRec glutBitmapTimesRoman24;
 const BitmapFontRec glutBitmapTimesRoman24 = {
 "-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1",
 224,
index 74b60314aa2a5b5713264afea5264fbbdc47da41..d6eac7aa516a1586ced00d998a035ecf4d31313a 100644 (file)
@@ -7,6 +7,10 @@
    and is provided without guarantee or warrantee expressed or 
    implied. This program is -not- in the public domain. */
 
+#define GLUT_NO_LIB_PRAGMA  /* Avoid auto library linking when building
+                               the GLUT library itself. */
+#include <GL/glut.h>
+
 #if defined(_MSC_VER)
 #pragma warning (disable:4244)  /* disable bogus conversion warnings */
 #pragma warning (disable:4305)  /* VC++ 5.0 version of above warning. */