|Re: [hatari-devel] Can't build Hatari on Mac if PortMidi is not installed|
[ Thread Index |
| More lists.tuxfamily.org/hatari-devel Archives
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Can't build Hatari on Mac if PortMidi is not installed
- From: Chris Jenkins <cdpjenkins@xxxxxxxxx>
- Date: Tue, 24 May 2022 21:50:04 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=QJkKMLb59XDdTyeOcQ1HN8nAZqWwkSPQTZZScXMiwiQ=; b=pJMEL7XeLMLtprjnyhoZu2ELohniSU1C/wY7nOwBNL6VTVOmjBIl8LTv6uAUrGXZqE Gt2K/Xbxyrk12vA0+V3r/+NwC4AZ0FmMfIYtYwnYMoFASMBENQlx3y0hvyXaZkoL5XRH i6D1i7hrPv3EuC2ZIKoyapisvPSSuebwdng7f9g37t1gD6saLriBk1sr5tILlgQYi3Gj cu1989n9CF+XntP5kwlzDFwjTgzoxVMJpUBQ0Brgs07HtvhFuVJEOMA75NZPYzR9QHzP u0RY2+9D2Q1ovBE4+sw04rhWxrknQNGxGiDLFH0xKLjXLVbx1qsuehqB/Kq3VycBWMpx /oeg==
Nicolas, many thanks for merging the patch. The master branch builds and works ok on my Mac without PortMidi :-)
Eero, I like the idea of dummy functions in midi.h when PortMidi is not enabled. (I haven't coded C professionally for 15 years or so at this point and whenever I go back to it, the #ifdefs make me feel bad!) I can't promise to do any more work on Hatari but I do hope to become a bit more familiar with the code now that I have it building on a couple of machines. I'll see if I can understand how the SDL GUI works as well.
Thanks for reporting the issue!
On 23.5.2022 19.49, Chris Jenkins wrote:
> I tried to build Hatari on my Mac (which does not have the PortMidi
> library) and found that the build was failing with the following:
> /Users/cdpj/GitProjects/hatari/src/gui-osx/PrefsController.m:575:21: error:
> implicit declaration of function 'Midi_Host_GetPortName' is invalid in C99
> while ((portName = Midi_Host_GetPortName(portName, +1, true)))
> It turns out that the function Midi_Host_GetPortName is not built at all if
> PortMidi is not found on the machine
I seem to have broken that 1/2 year ago with this midi.c change:
This shows what PortMidi midi.c support code initially looked like in 2017:
> but that the Mac UI code that calls it
> _*is*_ built (and fails because the function definition doesn't exist).
This shows all the places where PortMidi support was integrated to OSX
> Attached is my initial attempt to fix it. Note that this is my first
> attempt to contribute code to Hatari so I'm unsure whether I've done the
> right thing. In particular, I'm not sure if it's ok to #ifdef out parts of
> the UI initialisation code, or precisely how much to #ifdef out. I'm
> interested in any feedback on the approach.
I'm not sure what's the best place to put the ifdefs:
* Ifdef out just calls to non-existing midi.c functions, like you did
* Ifdef all PortMidi related code out of OSX GUI code, not just calls to
* Add ifdefs back to inside of the midi.c functions
* Provide separate dummy functions in midi.h when PortMidi is not
enabled (like Linux kernel project does to minimize places where ifdefs
My preference would there to be MIDI device support without PortMidi
also in the OSX GUI, not just in the SDL GUI.
I mean, MIDI devices are used also for other things than MIDI events,
like debug output and networking. PortMidi does not work for those
use-cases, for that one needs to be able to specify a file name instead,
when PortMidi support is not enabled.
(Among other things, this doc includes examples of how to forward Hatari
MIDI device data over internet: