Whamcloud - gitweb
LU-1821 build: fix build error about VLA at file scope
[fs/lustre-release.git] / libsysio / include / sysio-symbols.h
1 #if defined(HAVE_ASM_WEAK_DIRECTIVE) || defined(HAVE_ASM_WEAKEXT_DIRECTIVE)
2 #define HAVE_WEAK_SYMBOLS
3 #endif
4
5 #define STRINGOF(x) #x
6
7 /*
8  * Define alias, asym, as a strong alias for symbol, sym.
9  */
10 #define sysio_sym_strong_alias(sym, asym) \
11   extern __typeof(sym) asym __attribute__((alias(STRINGOF(sym))));
12
13 #ifdef HAVE_WEAK_SYMBOLS
14
15 /*
16  * Define alias, asym, as a strong alias for symbol, sym.
17  */
18 #define sysio_sym_weak_alias(sym, asym) \
19   extern __typeof(sym) asym __attribute__((weak, alias(STRINGOF(sym))));
20 #else /* !defined(HAVE_ASM_WEAK_DIRECTIVE) */
21
22 /*
23  * Weak symbols not supported. Make it a strong alias then.
24  */
25 #define sysio_sym_weak_alias(sym, asym) sysio_sym_strong_alias(sym, asym)
26 #endif