Commit bf697b90 authored by Guillem Jover's avatar Guillem Jover

Add symbol redirection support

We need this to be able to select different version symbols at
compile-time.
parent f1966385
......@@ -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__))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment