OSDN Git Service

3bf29f93bd1647c94b6001663f683f752c219714
[android-x86/external-alsa-lib.git] / include / local.h
1 /*
2  *  ALSA lib - local header file
3  *  Copyright (c) 2000 by Abramo Bagnara <abramo@alsa-project.org>
4  *
5  *
6  *   This library is free software; you can redistribute it and/or modify
7  *   it under the terms of the GNU Library General Public License as
8  *   published by the Free Software Foundation; either version 2 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 Library General Public License for more details.
15  *
16  *   You should have received a copy of the GNU Library General Public
17  *   License along with this library; if not, write to the Free Software
18  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  *
20  */
21
22 #ifndef __LOCAL_H
23 #define __LOCAL_H
24
25 #ifndef DATADIR
26 #define DATADIR "/usr/share"
27 #endif
28
29 #define _snd_config_iterator list_head
30 #define _snd_interval sndrv_interval
31 #define _snd_pcm_info sndrv_pcm_info
32 #define _snd_pcm_hw_params sndrv_pcm_hw_params
33 #define _snd_pcm_sw_params sndrv_pcm_sw_params
34 #define _snd_pcm_status sndrv_pcm_status
35
36 #define _snd_ctl_card_info sndrv_ctl_card_info
37 #define _snd_ctl_elem_id sndrv_ctl_elem_id
38 #define _snd_ctl_elem_list sndrv_ctl_elem_list
39 #define _snd_ctl_elem_info sndrv_ctl_elem_info
40 #define _snd_ctl_elem_value sndrv_ctl_elem_value
41 #define _snd_ctl_event sndrv_ctl_event
42
43 #define _snd_rawmidi_info sndrv_rawmidi_info
44 #define _snd_rawmidi_params sndrv_rawmidi_params
45 #define _snd_rawmidi_status sndrv_rawmidi_status
46
47 #define _snd_hwdep_info sndrv_hwdep_info
48
49 #include "asoundlib.h"
50
51 typedef enum _snd_set_mode {
52         SND_CHANGE,
53         SND_TRY,
54         SND_TEST,
55 } snd_set_mode_t;
56
57 size_t page_align(size_t size);
58 size_t page_size(void);
59
60 #define HAVE_GNU_LD
61 #define HAVE_ELF
62 #define HAVE_ASM_PREVIOUS_DIRECTIVE
63
64 /* Stolen from libc-symbols.h in GNU glibc */
65
66 /* When a reference to SYMBOL is encountered, the linker will emit a
67    warning message MSG.  */
68 #ifdef HAVE_GNU_LD
69 # ifdef HAVE_ELF
70
71 /* We want the .gnu.warning.SYMBOL section to be unallocated.  */
72 #  ifdef HAVE_ASM_PREVIOUS_DIRECTIVE
73 #   define __make_section_unallocated(section_string)   \
74   asm (".section " section_string "\n\t.previous");
75 #  elif defined HAVE_ASM_POPSECTION_DIRECTIVE
76 #   define __make_section_unallocated(section_string)   \
77   asm (".pushsection " section_string "\n\t.popsection");
78 #  else
79 #   define __make_section_unallocated(section_string)
80 #  endif
81
82 /* Tacking on "\n\t#" to the section name makes gcc put it's bogus
83    section attributes on what looks like a comment to the assembler.  */
84 #  ifdef HAVE_SECTION_QUOTES
85 #   define link_warning(symbol, msg) \
86   __make_section_unallocated (".gnu.warning." #symbol) \
87   static const char __evoke_link_warning_##symbol[]     \
88     __attribute__ ((section (".gnu.warning." #symbol "\"\n\t#\""))) = msg;
89 #  else
90 #   define link_warning(symbol, msg) \
91   __make_section_unallocated (".gnu.warning." #symbol) \
92   static const char __evoke_link_warning_##symbol[]     \
93     __attribute__ ((section (".gnu.warning." #symbol "\n\t#"))) = msg;
94 #  endif
95 # else
96 #  define link_warning(symbol, msg)             \
97   asm (".stabs \"" msg "\",30,0,0,0\n\t"        \
98        ".stabs \"" __SYMBOL_PREFIX #symbol "\",1,0,0,0\n");
99 # endif
100 #else
101 /* We will never be heard; they will all die horribly.  */
102 # define link_warning(symbol, msg)
103 #endif
104
105 #endif