OSDN Git Service

pcm: rate: Add capability to pass configuration node to plugins
[android-x86/external-alsa-lib.git] / include / alsa-symbols.h
1 /*
2  *  ALSA lib - dynamic symbol versions
3  *  Copyright (c) 2002 by Jaroslav Kysela <perex@perex.cz>
4  *
5  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 #ifndef __ALSA_SYMBOLS_H
23 #define __ALSA_SYMBOLS_H
24
25 #if defined(PIC) && defined(VERSIONED_SYMBOLS) /* might be also configurable */
26 #define USE_VERSIONED_SYMBOLS
27 #endif
28
29 #define INTERNAL_CONCAT2_2(Pre, Post) Pre##Post
30 #define INTERNAL(Name) INTERNAL_CONCAT2_2(__, Name)
31
32 #ifdef __powerpc64__
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)
39 #else
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)
44 #endif
45
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)
51 #else
52 #define use_symbol_version(real, name, version) /* nothing */
53 #ifdef __powerpc64__
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))
59 #else
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))
64 #else
65 #define use_default_symbol_version(real, name, version) \
66         __asm__ (".weak " ASM_NAME(#name)); \
67         __asm__ (".set " ASM_NAME(#name) "," ASM_NAME(#real))
68 #endif
69 #endif
70 #endif
71
72 #endif /* __ALSA_SYMBOLS_H */