Fix support for clang

Clang doesn't have the externally_visible attribute.

Fixes:
 alsa-lib//src/pcm/pcm.c:1503:1: error: unknown attribute 'externally_visible' ignored [-Werror,-Wunknown-attributes]
 EXPORT_SYMBOL snd_pcm_sframes_t INTERNAL(snd_pcm_forward)(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
 ^
 alsa-lib/include/alsa-symbols.h:37:60: note: expanded from macro 'EXPORT_SYMBOL'
 #define EXPORT_SYMBOL __attribute__((visibility("default"),externally_visible))
                                                            ^

 ...
 fatal error: too many errors emitted, stopping now [-ferror-limit=]
 20 errors generated.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
This commit is contained in:
Chih-Wei Huang 2021-06-14 12:41:11 +08:00
parent dc2382e762
commit 123bf1dabb

View file

@ -34,7 +34,11 @@
#define default_symbol_version(real, name, version) \ #define default_symbol_version(real, name, version) \
__asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@@" #version) __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@@" #version)
#ifdef __clang__
#define EXPORT_SYMBOL __attribute__((visibility("default")))
#else
#define EXPORT_SYMBOL __attribute__((visibility("default"),externally_visible)) #define EXPORT_SYMBOL __attribute__((visibility("default"),externally_visible))
#endif
#ifdef USE_VERSIONED_SYMBOLS #ifdef USE_VERSIONED_SYMBOLS
#define use_symbol_version(real, name, version) \ #define use_symbol_version(real, name, version) \