diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-09-24 09:45:57 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-09-24 09:47:39 -0700 |
commit | 200c891ed4a3d364aebdb18ed116ebbfd8101afe (patch) | |
tree | 2bdf6845bb799a9e7f890bbeb358284b3b1b1cd8 | |
parent | 7e29b1d29c6d7cbabe1bad536f7b8f644bffcd4f (diff) |
Remove weak symbol setup from Atom code
Not needed here, since this isn't a library and there is no
other source of these functions we link against.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | atom.c | 16 | ||||
-rw-r--r-- | stubs.h | 81 |
3 files changed, 2 insertions, 96 deletions
diff --git a/Makefile.am b/Makefile.am index 6affafd..18d48f8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -51,7 +51,6 @@ bdftopcf_SOURCES = \ pcf.h \ pcfwrite.c \ private.c \ - stubs.h \ utilbitmap.c \ bdftopcf.c @@ -34,7 +34,6 @@ in this Software without prior written authorization from The Open Group. #include <config.h> #endif #include "fontmisc.h" -#include "stubs.h" typedef struct _AtomList { char *name; @@ -140,11 +139,7 @@ NameEqual(const char *a, const char *b, int l) return TRUE; } -#ifdef __SUNPRO_C -#pragma weak MakeAtom -#endif - -weak Atom +Atom MakeAtom(const char *string, unsigned len, int makeit) { AtomListPtr a; @@ -152,8 +147,6 @@ MakeAtom(const char *string, unsigned len, int makeit) int h = 0; int r; - OVERRIDE_SYMBOL(MakeAtom, string, len, makeit); - hash = Hash(string, len); if (hashTable) { h = hash & hashMask; @@ -212,14 +205,9 @@ MakeAtom(const char *string, unsigned len, int makeit) return a->atom; } -#ifdef __SUNPRO_C -#pragma weak NameForAtom -#endif - -weak char * +char * NameForAtom(Atom atom) { - OVERRIDE_SYMBOL(NameForAtom, atom); if (atom != None && atom <= lastAtom) return reverseMap[atom]->name; return NULL; diff --git a/stubs.h b/stubs.h deleted file mode 100644 index e88e459..0000000 --- a/stubs.h +++ /dev/null @@ -1,81 +0,0 @@ -#include <stdio.h> -#include "fntfilst.h" -#include "font.h" - -#ifndef True -#define True (-1) -#endif -#ifndef False -#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 -#ifndef __SUNPRO_C /* Sun compilers use #pragma weak in .c files instead */ -#define NO_WEAK_SYMBOLS -#endif -#endif - -#if defined(NO_WEAK_SYMBOLS) && defined(PIC) -#include <stdarg.h> -extern int _font_init_stubs(void); - -#define OVERRIDE_DATA(sym) \ - _font_init_stubs(); \ - if (__ptr_##sym && __ptr_##sym != &sym) \ - sym = *__ptr_##sym -#define OVERRIDE_SYMBOL(sym,...) \ - _font_init_stubs(); \ - if (__##sym && __##sym != sym) \ - return (*__##sym)(__VA_ARGS__) -#define OVERRIDE_VA_SYMBOL(sym,f) \ - va_list _args; \ - _font_init_stubs(); \ - va_start(_args, f); \ - if (__##sym) \ - (*__##sym)(f, _args); \ - va_end(_args) - -extern int (*__client_auth_generation)(ClientPtr); -extern Bool (*__ClientSignal)(ClientPtr); -extern void (*__DeleteFontClientID)(Font); -extern void (*__VErrorF)(const char *, va_list); -extern FontPtr (*__find_old_font)(FSID); -extern FontResolutionPtr(*__GetClientResolutions) (int *); -extern int (*__GetDefaultPointSize)(void); -extern Font (*__GetNewFontClientID)(void); -extern unsigned long (*__GetTimeInMillis)(void); -extern int (*__init_fs_handlers)(FontPathElementPtr, BlockHandlerProcPtr); -extern int (*__RegisterFPEFunctions)(NameCheckFunc, InitFpeFunc, FreeFpeFunc, - ResetFpeFunc, OpenFontFunc, CloseFontFunc, - ListFontsFunc, StartLfwiFunc, NextLfwiFunc, - WakeupFpeFunc, ClientDiedFunc, - LoadGlyphsFunc, StartLaFunc, NextLaFunc, - SetPathFunc); -extern void (*__remove_fs_handlers)(FontPathElementPtr, BlockHandlerProcPtr, - Bool); -extern void **__ptr_serverClient; -extern int (*__set_font_authorizations)(char **, int *, ClientPtr); -extern int (*__StoreFontClientFont)(FontPtr, Font); -extern Atom (*__MakeAtom)(const char *, unsigned, int); -extern char *(*__NameForAtom)(Atom); -extern unsigned long *__ptr_serverGeneration; -extern void (*__register_fpe_functions)(void); -#else /* NO_WEAK_SYMBOLS && PIC */ -#define OVERRIDE_DATA(sym) -#define OVERRIDE_SYMBOL(sym,...) -#define OVERRIDE_VA_SYMBOL(sym,f) -#endif - -extern FontPtr find_old_font(FSID id); -extern int set_font_authorizations(char **authorizations, - int *authlen, ClientPtr client); - -extern unsigned long GetTimeInMillis(void); - -extern void ErrorF(const char *format, ...); - -/* end of file */ |