strong_alias、weak_alias
在阅读glibc源码的时候,遇见了几个没见过的宏
因为我比较好奇,所以特地去找了一下有关这些宏的定义(主要也是想多学一点)
在include/libc-symbols.h
中,有我想要了解的两个宏:strong_alias、weak_aliasd的定义
#ifndef __ASSEMBLER__
/* GCC understands weak symbols and aliases; use its interface where
possible, instead of embedded assembly language. */
/* Define ALIASNAME as a strong alias for NAME. */
#define strong_alias(name, aliasname) _strong_alias(name, aliasname)
#define _strong_alias(name, aliasname) \
extern __typeof (name) aliasname __attribute__ ((alias (#name))) \
__attribute_copy__ (name);
/* Define ALIASNAME as a weak alias for NAME.
If weak aliases are not available, this defines a strong alias. */
#define weak_alias(name, aliasname) _weak_alias (name, aliasname)
#define _weak_alias(name, aliasname)