[hatari-devel] Can't build Hatari on Mac if PortMidi is not installed

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi all,

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 [-Werror,-Wimplicit-function-declaration]
        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 but that the Mac UI code that calls it _is_ built (and fails because the function definition doesn't exist).

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.

Cheers,
Chris



Attachment: 0001-Don-t-add-MIDI-ports-to-Mac-GUI-if-building-without-.patch
Description: Binary data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/