Hi, I see now that 135da56cc and a338e9611 introduced an `undefined reference to midisend' when using ALSA. (since I was using a macro for that function, which became redundant with commit 135da56cc and removed in a338e9611)
Furthermore, I have also attached my patch for a 'clean build' on Linux (glibc). For some reason _POSIX_C_SOURCE needs to be defined in order for getopt(3) to be included from unistd.h. A few typedefs were not defined before being used, and as mentioned earlier, u_char was not defined at all on my system. Also, "util.h" does not seem to be part of the repository, but I can't find any missing functionality without it. I have attached both patches. Regards, Johnny Oskarsson On Wed, Apr 06, 2016 at 09:08:49PM -0300, Henrique N. Lengler wrote: > On Wed, Apr 06, 2016 at 10:33:23PM +0200, Johnny Oskarsson wrote: > > Hi, > > First of all I would like to thank you for this! I use VMPK quite > > a lot and it is nice to see a "simpler" alternative without all the > > dependencies. > > Hi, > > Nice to hear. > > > > The biggest missing feature is ALSA support, which I can't do > > > since I have no linux box, but might be extremely simple task. > > > Once the support is added, the software can be quite useful, in > > > such a small piece of code. > > > > I added basic support for ALSA, which works on my machine at least. See > > attached patch. > > (fair warning: I haven't used the ALSA sequencer API before) > > > > There seems to be some BSD-specific things in your code (u_char, for > > instance) which I had to change to make svmidi compile, but I haven't > > included this in the patch since it would distract from the ALSA > > support itself. > > > > Cheers, > > > > Johnny > > So your patch looks fine, I applied it, did a simple change, and pointed in > TODO that it needs more testing, as the whole software do. > > By now, thanks for helping. > > -- > Regards, > > Henrique N. Lengler >
>From be80aa4574739b73fc8ab0c84538f9e60061260b Mon Sep 17 00:00:00 2001 From: Johnny Oskarsson <jos...@joskar.se> Date: Thu, 7 Apr 2016 02:56:15 +0200 Subject: [PATCH] Fix for building on Linux (glibc). --- Makefile | 2 +- main.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 005046a..2b916d5 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ SOUNDOBJ = sndio.o OBJ += $(SOUNDOBJ) LIBS = ${XLIBS} ${SOUNDLIBS} -CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${XFLAGS} ${SOUNDFLAGS} +CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${XFLAGS} ${SOUNDFLAGS} -D_POSIX_C_SOURCE=200112L BIN = svmidi diff --git a/main.c b/main.c index 2368c71..3f0bdb9 100644 --- a/main.c +++ b/main.c @@ -8,8 +8,10 @@ #include <X11/XKBlib.h> /* XkbSetDetectableAutoRepeat() */ #include <X11/extensions/Xdbe.h> /* double buffer */ +typedef unsigned int uint; +typedef unsigned long ulong; +typedef unsigned char u_char; #include "midi.h" -#include "util.h" /* future: implement alsa */ #ifdef ALSA @@ -42,9 +44,6 @@ typedef struct { char *name; } Instrument; -typedef unsigned int uint; -typedef unsigned long ulong; - #include "config.h" /* Xlib */ -- 2.4.6
>From 96383403c721630ec3c35b421c01d2a2699a969d Mon Sep 17 00:00:00 2001 From: Johnny Oskarsson <jos...@joskar.se> Date: Thu, 7 Apr 2016 02:52:53 +0200 Subject: [PATCH] Fix undefined reference to "midisend" when using ALSA --- alsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alsa.c b/alsa.c index 48ecc3d..0fdb488 100644 --- a/alsa.c +++ b/alsa.c @@ -24,7 +24,7 @@ midiopen(void) /* send message */ void -_midisend(unsigned char message[], size_t count) +midisend(unsigned char message[], size_t count) { snd_seq_event_t ev; -- 2.4.6