2008-01-14 10:35:22 +05:30
|
|
|
/*
|
2007-12-14 19:42:38 +05:30
|
|
|
* Written by Mike Frysinger
|
2008-01-14 10:35:22 +05:30
|
|
|
* Placed in the Public Domain
|
2007-04-13 19:48:38 +05:30
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _HIDDEN_VISIBILITY_H_
|
|
|
|
#define _HIDDEN_VISIBILITY_H_
|
|
|
|
|
|
|
|
#if defined(__ELF__) && defined(__GNUC__)
|
|
|
|
# define __hidden_asmname(name) __hidden_asmname1 (__USER_LABEL_PREFIX__, name)
|
|
|
|
# define __hidden_asmname1(prefix, name) __hidden_asmname2(prefix, name)
|
|
|
|
# define __hidden_asmname2(prefix, name) #prefix name
|
|
|
|
# define __hidden_proto(name, internal) \
|
|
|
|
extern __typeof (name) name __asm__ (__hidden_asmname (#internal)) \
|
|
|
|
__attribute__ ((visibility ("hidden")));
|
|
|
|
# define __hidden_ver(local, internal, name) \
|
|
|
|
extern __typeof (name) __EI_##name __asm__(__hidden_asmname (#internal)); \
|
|
|
|
extern __typeof (name) __EI_##name __attribute__((alias (__hidden_asmname1 (,#local))))
|
|
|
|
# define hidden_proto(name) __hidden_proto(name, __RC_##name)
|
|
|
|
# define hidden_def(name) __hidden_ver(__RC_##name, name, name);
|
|
|
|
#else
|
|
|
|
# define hidden_proto(name)
|
|
|
|
# define hidden_def(name)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|