summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@nwnk.net>2006-06-01 21:49:51 +0000
committerAdam Jackson <ajax@nwnk.net>2006-06-01 21:49:51 +0000
commitddd281e6b9408c786cdc759cf7d1ec8972048658 (patch)
tree1a89d9415450d874dfdbae0235391a0d67690e87
parente9357d6670fc2e8ccf8d8770bac4c31994d6cc2f (diff)
For the 20-odd symbols defined both in libXfont and the X server, emit them
as weak symbols so that the linker will prefer the server's definition when present.
-rw-r--r--ChangeLog28
-rw-r--r--include/X11/fonts/fontmisc.h2
-rw-r--r--src/stubs/cauthgen.c6
-rw-r--r--src/stubs/csignal.c6
-rw-r--r--src/stubs/delfntcid.c6
-rw-r--r--src/stubs/errorf.c6
-rw-r--r--src/stubs/fatalerror.c6
-rw-r--r--src/stubs/findoldfnt.c6
-rw-r--r--src/stubs/getcres.c6
-rw-r--r--src/stubs/getdefptsize.c6
-rw-r--r--src/stubs/getnewfntcid.c6
-rw-r--r--src/stubs/gettime.c6
-rw-r--r--src/stubs/initfshdl.c6
-rw-r--r--src/stubs/regfpefunc.c6
-rw-r--r--src/stubs/rmfshdl.c6
-rw-r--r--src/stubs/servclient.c7
-rw-r--r--src/stubs/setfntauth.c6
-rw-r--r--src/stubs/stfntcfnt.c6
-rw-r--r--src/stubs/stubs.h10
-rw-r--r--src/stubs/xpstubs.c12
-rw-r--r--src/util/Makefile.am3
-rw-r--r--src/util/atom.c7
-rw-r--r--src/util/miscutil.c16
23 files changed, 72 insertions, 103 deletions
diff --git a/ChangeLog b/ChangeLog
index 279e9bc..ad3d914 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+2006-06-01 Adam Jackson <ajax@freedesktop.org>
+
+ * include/X11/fonts/fontmisc.h:
+ * src/stubs/cauthgen.c:
+ * src/stubs/csignal.c:
+ * src/stubs/delfntcid.c:
+ * src/stubs/errorf.c:
+ * src/stubs/fatalerror.c:
+ * src/stubs/findoldfnt.c:
+ * src/stubs/getcres.c:
+ * src/stubs/getdefptsize.c:
+ * src/stubs/getnewfntcid.c:
+ * src/stubs/gettime.c:
+ * src/stubs/initfshdl.c:
+ * src/stubs/regfpefunc.c:
+ * src/stubs/rmfshdl.c:
+ * src/stubs/servclient.c:
+ * src/stubs/setfntauth.c:
+ * src/stubs/stfntcfnt.c:
+ * src/stubs/stubs.h:
+ * src/stubs/xpstubs.c:
+ * src/util/Makefile.am:
+ * src/util/atom.c:
+ * src/util/miscutil.c:
+ For the 20-odd symbols defined both in libXfont and the X server,
+ emit them as weak symbols so that the linker will prefer the
+ server's definition when present.
+
2006-04-01 Adam Jackson <ajax@freedesktop.org>
* Makefile.am:
diff --git a/include/X11/fonts/fontmisc.h b/include/X11/fonts/fontmisc.h
index b7e3590..7b86517 100644
--- a/include/X11/fonts/fontmisc.h
+++ b/include/X11/fonts/fontmisc.h
@@ -47,7 +47,7 @@ extern int close();
#endif /* FONTMODULE */
-#include "X11/Xdefs.h"
+#include <X11/Xdefs.h>
#ifndef LSBFirst
diff --git a/src/stubs/cauthgen.c b/src/stubs/cauthgen.c
index dec438d..06f1a34 100644
--- a/src/stubs/cauthgen.c
+++ b/src/stubs/cauthgen.c
@@ -1,14 +1,10 @@
-/* $XFree86$ */
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "stubs.h"
-int
+weak int
client_auth_generation(ClientPtr client)
{
return 0;
}
-
-/* end of file */
diff --git a/src/stubs/csignal.c b/src/stubs/csignal.c
index c957eb8..3e102cc 100644
--- a/src/stubs/csignal.c
+++ b/src/stubs/csignal.c
@@ -1,14 +1,10 @@
-/* $XFree86$ */
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "stubs.h"
-Bool
+weak Bool
ClientSignal(ClientPtr client)
{
return True;
}
-
-/* end of file */
diff --git a/src/stubs/delfntcid.c b/src/stubs/delfntcid.c
index af5c0a8..0b0a747 100644
--- a/src/stubs/delfntcid.c
+++ b/src/stubs/delfntcid.c
@@ -1,13 +1,9 @@
-/* $XFree86$ */
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "stubs.h"
-void
+weak void
DeleteFontClientID(Font id)
{
}
-
-/* end of file */
diff --git a/src/stubs/errorf.c b/src/stubs/errorf.c
index 52c6042..28872e2 100644
--- a/src/stubs/errorf.c
+++ b/src/stubs/errorf.c
@@ -1,13 +1,9 @@
-/* $XFree86: xc/lib/font/stubs/errorf.c,v 1.1 1999/01/11 05:13:19 dawes Exp $ */
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "stubs.h"
-void
+weak void
ErrorF(const char *f, ...)
{
}
-
-/* end of file */
diff --git a/src/stubs/fatalerror.c b/src/stubs/fatalerror.c
index 7dff170..295593e 100644
--- a/src/stubs/fatalerror.c
+++ b/src/stubs/fatalerror.c
@@ -1,13 +1,9 @@
-/* $XFree86: xc/lib/font/stubs/fatalerror.c,v 1.1 1999/01/11 05:13:19 dawes Exp $ */
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "stubs.h"
-void
+weak void
FatalError(const char *f, ...)
{
}
-
-/* end of file */
diff --git a/src/stubs/findoldfnt.c b/src/stubs/findoldfnt.c
index 218ecd4..22bd8c1 100644
--- a/src/stubs/findoldfnt.c
+++ b/src/stubs/findoldfnt.c
@@ -1,14 +1,10 @@
-/* $XFree86$ */
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "stubs.h"
-FontPtr
+weak FontPtr
find_old_font(FSID id)
{
return (FontPtr)NULL;
}
-
-/* end of file */
diff --git a/src/stubs/getcres.c b/src/stubs/getcres.c
index da0de91..b564f24 100644
--- a/src/stubs/getcres.c
+++ b/src/stubs/getcres.c
@@ -1,14 +1,10 @@
-/* $XFree86$ */
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "stubs.h"
-FontResolutionPtr
+weak FontResolutionPtr
GetClientResolutions(int *num)
{
return (FontResolutionPtr) 0;
}
-
-/* end of file */
diff --git a/src/stubs/getdefptsize.c b/src/stubs/getdefptsize.c
index 10a46c8..11804dd 100644
--- a/src/stubs/getdefptsize.c
+++ b/src/stubs/getdefptsize.c
@@ -1,14 +1,10 @@
-/* $XFree86$ */
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "stubs.h"
-int
+weak int
GetDefaultPointSize(void)
{
return 0;
}
-
-/* end of file */
diff --git a/src/stubs/getnewfntcid.c b/src/stubs/getnewfntcid.c
index 5a1e927..aefc553 100644
--- a/src/stubs/getnewfntcid.c
+++ b/src/stubs/getnewfntcid.c
@@ -1,14 +1,10 @@
-/* $XFree86$ */
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "stubs.h"
-Font
+weak Font
GetNewFontClientID(void)
{
return (Font)0;
}
-
-/* end of file */
diff --git a/src/stubs/gettime.c b/src/stubs/gettime.c
index 60a4e39..1aca1cc 100644
--- a/src/stubs/gettime.c
+++ b/src/stubs/gettime.c
@@ -1,14 +1,10 @@
-/* $XFree86$ */
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "stubs.h"
-unsigned long
+weak unsigned long
GetTimeInMillis (void)
{
return 0;
}
-
-/* end of file */
diff --git a/src/stubs/initfshdl.c b/src/stubs/initfshdl.c
index 15a337a..faee9f6 100644
--- a/src/stubs/initfshdl.c
+++ b/src/stubs/initfshdl.c
@@ -1,15 +1,11 @@
-/* $XFree86: xc/lib/font/stubs/initfshdl.c,v 1.1 1999/01/11 05:13:20 dawes Exp $ */
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "stubs.h"
-int
+weak int
init_fs_handlers(FontPathElementPtr fpe,
BlockHandlerProcPtr block_handler)
{
return Successful;
}
-
-/* end of file */
diff --git a/src/stubs/regfpefunc.c b/src/stubs/regfpefunc.c
index d6fcf3b..67e43b3 100644
--- a/src/stubs/regfpefunc.c
+++ b/src/stubs/regfpefunc.c
@@ -1,11 +1,9 @@
-/* $XFree86: xc/lib/font/stubs/regfpefunc.c,v 1.1 1999/01/11 05:13:20 dawes Exp $ */
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "stubs.h"
-int
+weak int
RegisterFPEFunctions(NameCheckFunc name_func,
InitFpeFunc init_func,
FreeFpeFunc free_func,
@@ -24,5 +22,3 @@ RegisterFPEFunctions(NameCheckFunc name_func,
{
return 0;
}
-
-/* end of file */
diff --git a/src/stubs/rmfshdl.c b/src/stubs/rmfshdl.c
index ae0ab78..1f87744 100644
--- a/src/stubs/rmfshdl.c
+++ b/src/stubs/rmfshdl.c
@@ -1,15 +1,11 @@
-/* $XFree86: xc/lib/font/stubs/rmfshdl.c,v 1.1 1999/01/11 05:13:21 dawes Exp $ */
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "stubs.h"
-void
+weak void
remove_fs_handlers(FontPathElementPtr fpe,
BlockHandlerProcPtr blockHandler,
Bool all)
{
}
-
-/* end of file */
diff --git a/src/stubs/servclient.c b/src/stubs/servclient.c
index 25c853f..ae51621 100644
--- a/src/stubs/servclient.c
+++ b/src/stubs/servclient.c
@@ -1,3 +1,6 @@
-/* $XFree86$ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include "stubs.h"
-void *serverClient = 0;
+weak void *serverClient = 0;
diff --git a/src/stubs/setfntauth.c b/src/stubs/setfntauth.c
index 843f155..01d18b1 100644
--- a/src/stubs/setfntauth.c
+++ b/src/stubs/setfntauth.c
@@ -1,14 +1,10 @@
-/* $XFree86$ */
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "stubs.h"
-int
+weak int
set_font_authorizations(char **authorizations, int *authlen, ClientPtr client)
{
return 0;
}
-
-/* end of file */
diff --git a/src/stubs/stfntcfnt.c b/src/stubs/stfntcfnt.c
index c062677..bf88505 100644
--- a/src/stubs/stfntcfnt.c
+++ b/src/stubs/stfntcfnt.c
@@ -1,14 +1,10 @@
-/* $XFree86$ */
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "stubs.h"
-int
+weak int
StoreFontClientFont(FontPtr pfont, Font id)
{
return 0;
}
-
-/* end of file */
diff --git a/src/stubs/stubs.h b/src/stubs/stubs.h
index d687a77..41cde58 100644
--- a/src/stubs/stubs.h
+++ b/src/stubs/stubs.h
@@ -1,12 +1,9 @@
/* $XFree86: xc/lib/font/stubs/stubs.h,v 1.3 1999/12/15 01:14:36 robin Exp $ */
-/* This directory includes dummy entry for bdftopcf and mkfontdir */
-
#include <stdio.h>
#include <X11/fonts/fntfilst.h>
#include <X11/fonts/font.h>
-
#ifndef True
#define True (-1)
#endif
@@ -14,6 +11,13 @@
#define False (0)
#endif
+/* this probably works for Mach-O too, but probably not for PE */
+#if defined(__ELF__) && defined(__GNUC__) && (__GNUC__ >= 3)
+#define weak __attribute__((weak))
+#else
+#define weak
+#endif
+
extern FontPtr find_old_font ( FSID id );
extern int set_font_authorizations ( char **authorizations,
int *authlen,
diff --git a/src/stubs/xpstubs.c b/src/stubs/xpstubs.c
index 4449153..cb5d76d 100644
--- a/src/stubs/xpstubs.c
+++ b/src/stubs/xpstubs.c
@@ -1,24 +1,16 @@
-/* $XFree86$ */
-
-/*
- stub for XpClient* functions.
-*/
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "stubs.h"
-Bool
+weak Bool
XpClientIsBitmapClient(ClientPtr client)
{
return True;
}
-Bool
+weak Bool
XpClientIsPrintClient(ClientPtr client, FontPathElementPtr fpe)
{
return False;
}
-
-/* end of file */
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index f9010d6..bec93ee 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -1,5 +1,6 @@
INCLUDES = \
- -I${top_srcdir}/include
+ -I${top_srcdir}/include \
+ -I$(top_srcdir)/src/stubs
noinst_LTLIBRARIES = libutil.la
diff --git a/src/util/atom.c b/src/util/atom.c
index 942ea0d..e5fea46 100644
--- a/src/util/atom.c
+++ b/src/util/atom.c
@@ -37,6 +37,7 @@ in this Software without prior written authorization from The Open Group.
#include <config.h>
#endif
#include <X11/fonts/fontmisc.h>
+#include "stubs.h"
typedef struct _AtomList {
char *name;
@@ -145,7 +146,7 @@ NameEqual (const char *a, const char *b, int l)
return TRUE;
}
-Atom
+weak Atom
MakeAtom(char *string, unsigned len, int makeit)
{
AtomListPtr a;
@@ -218,13 +219,13 @@ MakeAtom(char *string, unsigned len, int makeit)
return a->atom;
}
-int
+weak int
ValidAtom(Atom atom)
{
return (atom != None) && (atom <= lastAtom);
}
-char *
+weak char *
NameForAtom(Atom atom)
{
if (atom != None && atom <= lastAtom)
diff --git a/src/util/miscutil.c b/src/util/miscutil.c
index 03b4d06..611f912 100644
--- a/src/util/miscutil.c
+++ b/src/util/miscutil.c
@@ -35,22 +35,22 @@ from The Open Group.
#include <X11/Xosdefs.h>
#include <stdlib.h>
#include <X11/fonts/fontmisc.h>
+#include "stubs.h"
#define XK_LATIN1
#include <X11/keysymdef.h>
-/* #include <X11/Xmu/CharSet.h> */
/* make sure everything initializes themselves at least once */
-long serverGeneration = 1;
+weak long serverGeneration = 1;
-void *
+weak void *
Xalloc (unsigned long m)
{
return malloc (m);
}
-void *
+weak void *
Xrealloc (void *n, unsigned long m)
{
if (!n)
@@ -59,20 +59,20 @@ Xrealloc (void *n, unsigned long m)
return realloc (n, m);
}
-void
+weak void
Xfree (void *n)
{
if (n)
free (n);
}
-void *
+weak void *
Xcalloc (unsigned long n)
{
return calloc (n, 1);
}
-void
+weak void
CopyISOLatin1Lowered (char *dst, char *src, int len)
{
register unsigned char *dest, *source;
@@ -93,7 +93,7 @@ CopyISOLatin1Lowered (char *dst, char *src, int len)
*dest = '\0';
}
-void
+weak void
register_fpe_functions ()
{
}