From 36ef11202b7e4345f2402d8ea9cf6395ac857081 Mon Sep 17 00:00:00 2001 From: Nedko Arnaudov Date: Sun, 2 Oct 2011 02:30:46 +0300 Subject: [PATCH] alsapid: make it work again c62134ca6ed44cee0157919ba56431eba2142fc7 broke alsapid --- alsapid/alsapid.h | 4 ++-- alsapid/helper.c | 7 +++---- alsapid/lib.c | 9 ++++++--- wscript | 9 ++++++++- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/alsapid/alsapid.h b/alsapid/alsapid.h index d5afbb0e..0e818e1d 100644 --- a/alsapid/alsapid.h +++ b/alsapid/alsapid.h @@ -2,7 +2,7 @@ /* * LADI Session Handler (ladish) * - * Copyright (C) 2010 Nedko Arnaudov + * Copyright (C) 2010, 2011 Nedko Arnaudov * ************************************************************************** * This file contains interface to alsapid functionality @@ -27,7 +27,7 @@ #ifndef ALSAPID_H__0A27F284_7538_4791_8023_0FBED929EAF3__INCLUDED #define ALSAPID_H__0A27F284_7538_4791_8023_0FBED929EAF3__INCLUDED -#include +#include "../common.h" void alsapid_compose_src_link(int alsa_client_id, char * buffer); void alsapid_compose_dst_link(char * buffer); diff --git a/alsapid/helper.c b/alsapid/helper.c index cd3760a7..9bffcb12 100644 --- a/alsapid/helper.c +++ b/alsapid/helper.c @@ -2,7 +2,7 @@ /* * LADI Session Handler (ladish) * - * Copyright (C) 2010 Nedko Arnaudov + * Copyright (C) 2010, 2011 Nedko Arnaudov * ************************************************************************** * This file contains alsapid helper functionality @@ -24,7 +24,8 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE +#include "alsapid.h" + #include /* GNU basename() */ #include @@ -33,8 +34,6 @@ #include #include -#include "alsapid.h" - void alsapid_compose_src_link(int alsa_client_id, char * buffer) { sprintf(buffer, "/tmp/alsapid-%lld-%d", (long long)getuid(), alsa_client_id); diff --git a/alsapid/lib.c b/alsapid/lib.c index 802f13fe..e9622b96 100644 --- a/alsapid/lib.c +++ b/alsapid/lib.c @@ -24,15 +24,13 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE +#include "alsapid.h" #include #include #include #include -#include "alsapid.h" - #define API_VERSION "ALSA_0.9" // gcc -g -shared -Wl,--version-script=asound.versions -o libasound.so -fPIC -ldl -Wall -Werror lib.c helper.c @@ -88,6 +86,7 @@ static int (* real_snd_seq_close)(snd_seq_t * handle); } #if 0 +LADISH_PUBLIC int snd_seq_open(snd_seq_t ** handle, const char * name, int streams, int mode) { int ret; @@ -106,6 +105,7 @@ int snd_seq_open(snd_seq_t ** handle, const char * name, int streams, int mode) } #endif +LADISH_PUBLIC int snd_seq_set_client_name(snd_seq_t * seq, const char * name) { int ret; @@ -127,6 +127,7 @@ int snd_seq_set_client_name(snd_seq_t * seq, const char * name) return ret; } +LADISH_PUBLIC int snd_seq_close(snd_seq_t * handle) { CHECK_FUNC(snd_seq_close); @@ -138,6 +139,7 @@ int snd_seq_close(snd_seq_t * handle) } #if 0 +LADISH_PUBLIC int snd_seq_create_port(snd_seq_t * handle, snd_seq_port_info_t * info) { int ret; @@ -151,6 +153,7 @@ int snd_seq_create_port(snd_seq_t * handle, snd_seq_port_info_t * info) return ret; } +LADISH_PUBLIC int snd_seq_create_simple_port(snd_seq_t * seq, const char * name, unsigned int caps, unsigned int type) { int ret; diff --git a/wscript b/wscript index 8b4a03f9..e83be4b2 100644 --- a/wscript +++ b/wscript @@ -462,7 +462,14 @@ def build(bld): ##################################################### # alsapid - bld.shlib(source = [os.path.join("alsapid", 'lib.c'), os.path.join("alsapid", "helper.c")], target = 'alsapid', uselib = 'DL') + alsapid = bld.shlib(source = [], features = 'c cshlib', includes = [bld.path.get_bld()]) + alsapid.uselib = 'DL' + alsapid.target = 'alsapid' + for source in [ + 'lib.c', + 'helper.c', + ]: + alsapid.source.append(os.path.join("alsapid", source)) ##################################################### # liblash