On 06/25/12 01:24 AM, Yaakov (Cygwin/X) wrote:
> On Sun, 2012-06-24 at 09:31 -0700, Alan Coopersmith wrote:
>> So replace the original [PATCH 1/4] with the following which adds
>> GetGlyphs() to dixfonts.c, making all platforms export it from the same
>> binary, instead of differing based on how libXfont is linked.
>
> Sorry, but that doesn't work either:
>
> /usr/lib/libXfont.a(fontutil.o): In function `GetGlyphs':
> libXfont/src/util/fontutil.c:54: multiple definition of `_GetGlyphs'
> ../../dix/.libs/libdix.a(dixfonts.o):dix/dixfonts.c:123: first defined
> here
Damn, you're going to make me work for this aren't you? 8-)
Okay, how about we make the compiler think they have the same name (so
we don't have to go fix all the callers right away) while letting the
linker use a new name so there's no clash?
Try #3 attached.
--
-Alan Coopersmith- [email protected]
Oracle Solaris Engineering - http://blogs.oracle.com/alanc
From 7be17e0fe34df21933384bd7b838429924a0e24b Mon Sep 17 00:00:00 2001
From: Alan Coopersmith <[email protected]>
Date: Fri, 22 Jun 2012 23:02:47 -0700
Subject: [PATCH] Add dixGetGlyphs to replace GetGlyphs from libXfont to
simplify linking
No other Xfont consumer used it, and this saves us from having to link
callers against libXfont for one simple function when doing
-no-undefined symbols builds.
The function is given a new name to avoid clashing with existing libXfont
binaries, but a #define is provided to preserve the API so we don't have
to fix all the callers at the same time.
Signed-off-by: Alan Coopersmith <[email protected]>
---
dix/dixfonts.c | 9 +++++++++
include/dixfont.h | 13 +++++++------
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index 19fd31e..dd93311 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -115,6 +115,15 @@ LoadGlyphs(ClientPtr client, FontPtr pfont, unsigned
nchars, int item_size,
return Successful;
}
+void
+dixGetGlyphs(FontPtr font, unsigned long count, unsigned char *chars,
+ FontEncoding fontEncoding,
+ unsigned long *glyphcount, /* RETURN */
+ CharInfoPtr *glyphs) /* RETURN */
+{
+ (*font->get_glyphs) (font, count, chars, fontEncoding, glyphcount, glyphs);
+}
+
/*
* adding RT_FONT prevents conflict with default cursor font
*/
diff --git a/include/dixfont.h b/include/dixfont.h
index 9333041..3d09eb5 100644
--- a/include/dixfont.h
+++ b/include/dixfont.h
@@ -117,12 +117,13 @@ extern _X_EXPORT void FreeFonts(void);
extern _X_EXPORT FontPtr find_old_font(XID /*id */ );
-extern _X_EXPORT void GetGlyphs(FontPtr /*font */ ,
- unsigned long /*count */ ,
- unsigned char * /*chars */ ,
- FontEncoding /*fontEncoding */ ,
- unsigned long * /*glyphcount */ ,
- CharInfoPtr * /*glyphs */ );
+#define GetGlyphs dixGetGlyphs
+extern _X_EXPORT void dixGetGlyphs(FontPtr /*font */ ,
+ unsigned long /*count */ ,
+ unsigned char * /*chars */ ,
+ FontEncoding /*fontEncoding */ ,
+ unsigned long * /*glyphcount */ ,
+ CharInfoPtr * /*glyphs */ );
extern _X_EXPORT void QueryGlyphExtents(FontPtr /*pFont */ ,
CharInfoPtr * /*charinfo */ ,
--
1.7.9.2
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel