2 * ALSA lib - dynamic symbol versions
3 * Copyright (c) 2002 by Jaroslav Kysela <perex@perex.cz>
6 * This library is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef __ALSA_SYMBOLS_H
23 #define __ALSA_SYMBOLS_H
25 #if defined(PIC) && defined(VERSIONED_SYMBOLS) /* might be also configurable */
26 #define USE_VERSIONED_SYMBOLS
29 #define INTERNAL_CONCAT2_2(Pre, Post) Pre##Post
30 #define INTERNAL(Name) INTERNAL_CONCAT2_2(__, Name)
33 # define symbol_version(real, name, version) \
34 __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@" #version); \
35 __asm__ (".symver ." ASM_NAME(#real) ",." ASM_NAME(#name) "@" #version)
36 # define default_symbol_version(real, name, version) \
37 __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@@" #version); \
38 __asm__ (".symver ." ASM_NAME(#real) ",." ASM_NAME(#name) "@@" #version)
40 # define symbol_version(real, name, version) \
41 __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@" #version)
42 # define default_symbol_version(real, name, version) \
43 __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@@" #version)
46 #ifdef USE_VERSIONED_SYMBOLS
47 #define use_symbol_version(real, name, version) \
48 symbol_version(real, name, version)
49 #define use_default_symbol_version(real, name, version) \
50 default_symbol_version(real, name, version)
52 #define use_symbol_version(real, name, version) /* nothing */
54 #define use_default_symbol_version(real, name, version) \
55 __asm__ (".weak " ASM_NAME(#name)); \
56 __asm__ (".weak ." ASM_NAME(#name)); \
57 __asm__ (".set " ASM_NAME(#name) "," ASM_NAME(#real)); \
58 __asm__ (".set ." ASM_NAME(#name) ",." ASM_NAME(#real))
60 #if defined(__alpha__) || defined(__mips__)
61 #define use_default_symbol_version(real, name, version) \
62 __asm__ (".weak " ASM_NAME(#name)); \
63 __asm__ (ASM_NAME(#name) " = " ASM_NAME(#real))
65 #define use_default_symbol_version(real, name, version) \
66 __asm__ (".weak " ASM_NAME(#name)); \
67 __asm__ (".set " ASM_NAME(#name) "," ASM_NAME(#real))
72 #endif /* __ALSA_SYMBOLS_H */