mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-08 11:02:24 +01:00
Add symbol redirection support
We need this to be able to select different version symbols at compile-time.
This commit is contained in:
parent
f1966385b3
commit
bf697b900c
@ -76,6 +76,9 @@
|
||||
#define _SYS_CDEFS_H
|
||||
#endif
|
||||
|
||||
#define LIBBSD_CONCAT(x, y) x ## y
|
||||
#define LIBBSD_STRING(x) #x
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define LIBBSD_GCC_VERSION (__GNUC__ << 8 | __GNUC_MINOR__)
|
||||
#else
|
||||
@ -90,6 +93,12 @@
|
||||
#define LIBBSD_DEPRECATED(x)
|
||||
#endif
|
||||
|
||||
#if LIBBSD_GCC_VERSION >= 0x0200
|
||||
#define LIBBSD_REDIRECT(name, proto, alias) name proto __asm__(LIBBSD_ASMNAME(#alias))
|
||||
#endif
|
||||
#define LIBBSD_ASMNAME(cname) LIBBSD_ASMNAME_PREFIX(__USER_LABEL_PREFIX__, cname)
|
||||
#define LIBBSD_ASMNAME_PREFIX(prefix, cname) LIBBSD_STRING(prefix) cname
|
||||
|
||||
#ifndef __dead2
|
||||
# if LIBBSD_GCC_VERSION >= 0x0207
|
||||
# define __dead2 __attribute__((__noreturn__))
|
||||
|
Loading…
Reference in New Issue
Block a user