Skip to content

Commit 55017b0

Browse files
committed
alsamixer: add support for new log handler (alsa-lib 1.2.15)
Signed-off-by: Jaroslav Kysela <[email protected]>
1 parent 862ba9c commit 55017b0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

alsamixer/mainloop.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,26 @@
3434

3535
static WINDOW *curses_initialized;
3636

37+
#if SND_LIB_VER(1, 2, 15) < SND_LIB_VERSION
3738
static void black_hole_error_handler(const char *file ATTRIBUTE_UNUSED,
3839
int line ATTRIBUTE_UNUSED,
3940
const char *function ATTRIBUTE_UNUSED,
4041
int err ATTRIBUTE_UNUSED,
4142
const char *fmt ATTRIBUTE_UNUSED, ...)
4243
{
4344
}
45+
#else
46+
static void black_hole_log_handler(int prio ATTRIBUTE_UNUSED,
47+
int interface ATTRIBUTE_UNUSED,
48+
const char *file ATTRIBUTE_UNUSED,
49+
int line ATTRIBUTE_UNUSED,
50+
const char *function ATTRIBUTE_UNUSED,
51+
int errcode ATTRIBUTE_UNUSED,
52+
const char *fmt ATTRIBUTE_UNUSED,
53+
va_list arg ATTRIBUTE_UNUSED)
54+
{
55+
}
56+
#endif
4457

4558
void initialize_curses(bool use_color, bool use_mouse)
4659
{
@@ -55,7 +68,11 @@ void initialize_curses(bool use_color, bool use_mouse)
5568
if (use_mouse)
5669
mousemask(ALL_MOUSE_EVENTS, NULL);
5770

71+
#if SND_LIB_VER(1, 2, 15) < SND_LIB_VERSION
5872
snd_lib_error_set_handler(black_hole_error_handler);
73+
#else
74+
snd_lib_log_set_handler(black_hole_log_handler);
75+
#endif
5976
}
6077

6178
void app_shutdown(void)

0 commit comments

Comments
 (0)