0
我試圖將OpenBSD make移植到Linux上,但是我被使用__only_inline宏弄糊塗了。這個宏來自/usr/include/sys/cdefs.h其如下定義它:搞清楚在BSD上使用的__only_inline C宏
/*
* __only_inline makes the compiler only use this function definition
* for inlining; references that can't be inlined will be left as
* external references instead of generating a local copy. The
* matching library should include a simple extern definition for
* the function to handle those references. c.f. ctype.h
*/
#ifdef __GNUC__
# if __GNUC_PREREQ__(4, 2)
#define __only_inline extern __inline __attribute__((__gnu_inline__))
# else
#define __only_inline extern __inline
# endif
#else
#define __only_inline static __inline
#endif
有人能解釋一下這個宏的目的是什麼?它在OpenBSD系統使用使targ.h: