| 1 |
/*
|
| 2 |
* File: localdecls.h
|
| 3 |
*
|
| 4 |
* Copyright 1999-2004 Gentoo Foundation
|
| 5 |
* Distributed under the terms of the GNU General Public License v2
|
| 6 |
* $Header$
|
| 7 |
*/
|
| 8 |
|
| 9 |
#ifndef __LOCALDECLS_H__
|
| 10 |
#define __LOCALDECLS_H__
|
| 11 |
|
| 12 |
/* take care of broken ld loading */
|
| 13 |
#if defined(__GLIBC__) && !defined(__UCLIBC__)
|
| 14 |
|
| 15 |
# if __GLIBC__ <= 2 && __GLIBC_MINOR__ <= 2
|
| 16 |
# define BROKEN_RTLD_NEXT
|
| 17 |
# define LIBC 5
|
| 18 |
# endif
|
| 19 |
|
| 20 |
# if !defined(BROKEN_RTLD_NEXT)
|
| 21 |
# if defined(__mips__)
|
| 22 |
# define BROKEN_RTLD_NEXT
|
| 23 |
# endif
|
| 24 |
# endif
|
| 25 |
|
| 26 |
#else
|
| 27 |
|
| 28 |
#if 0
|
| 29 |
# if defined(__FreeBSD__)
|
| 30 |
# define BROKEN_RTLD_NEXT
|
| 31 |
# endif
|
| 32 |
#endif
|
| 33 |
|
| 34 |
#endif
|
| 35 |
|
| 36 |
#define GLIBC_MINOR __GLIBC_MINOR__
|
| 37 |
|
| 38 |
#ifdef PATH_MAX
|
| 39 |
# define SB_PATH_MAX PATH_MAX * 2
|
| 40 |
# if (SB_PATH_MAX >= INT_MAX) || (SB_PATH_MAX < PATH_MAX)
|
| 41 |
# undef SB_PATH_MAX
|
| 42 |
# define SB_PATH_MAX PATH_MAX + 25
|
| 43 |
# if (SB_PATH_MAX >= INT_MAX) || (SB_PATH_MAX < PATH_MAX)
|
| 44 |
# error SB_PATH_MAX too big!
|
| 45 |
# endif
|
| 46 |
# endif
|
| 47 |
#else
|
| 48 |
# error PATH_MAX not defined!
|
| 49 |
#endif
|
| 50 |
|
| 51 |
#if !HAVE_DLVSYM
|
| 52 |
# define dlvsym(_lib, _sym, _ver) dlsym(_lib, _sym)
|
| 53 |
#endif
|
| 54 |
|
| 55 |
#if HAVE_DLVSYM
|
| 56 |
/* Taken from glibc */
|
| 57 |
# define symbol_version(_real, _name, _version) \
|
| 58 |
__asm__ (".symver " #_real "," #_name "@" #_version)
|
| 59 |
# define default_symbol_version(_real, _name, _version) \
|
| 60 |
__asm__ (".symver " #_real "," #_name "@@" #_version)
|
| 61 |
#endif
|
| 62 |
|
| 63 |
/* Taken from glibc */
|
| 64 |
# define strong_alias(_name, _aliasname) \
|
| 65 |
extern __typeof (_name) _aliasname __attribute__ ((alias (#_name)));
|
| 66 |
# define weak_alias(_name, _aliasname) \
|
| 67 |
extern __typeof (_name) _aliasname __attribute__ ((weak, alias (#_name)));
|
| 68 |
|
| 69 |
|
| 70 |
#endif
|