From 7ba12f5f97f427e9d9999b01c215edaae7a932ac Mon Sep 17 00:00:00 2001 From: James Brown Date: Thu, 14 Mar 2002 12:14:22 +0000 Subject: Fix some possible problems with new gmidi.cpp compiling on Mac Carbon.. svn-id: r3746 --- sound/gmidi.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'sound') diff --git a/sound/gmidi.cpp b/sound/gmidi.cpp index d84ec943cd..ba9cddd34c 100644 --- a/sound/gmidi.cpp +++ b/sound/gmidi.cpp @@ -112,7 +112,8 @@ void MidiDriver::midiInitSeq() { } int MidiDriver::open_sequencer_device() { - int device; + int device = 0; +#if !define(__APPLE__CW) // No getenv support on Apple Carbon char *device_name = getenv("SCUMMVM_MIDI"); if (device_name != NULL) { device = (open((device_name), O_RDWR, 0)); @@ -128,14 +129,16 @@ int MidiDriver::open_sequencer_device() { if (device < 0) error("Cannot open /dev/null to dump midi output"); } +#endif return device; } /*********** Timidity */ int MidiDriver::connect_to_timidity(int port) { + int s = 0; +#if !define(__APPLE__CW) // No socket support on Apple Carbon struct hostent *serverhost; - struct sockaddr_in sadd; - int s; + struct sockaddr_in sadd; serverhost = gethostbyname("localhost"); if (serverhost == NULL) @@ -150,8 +153,8 @@ int MidiDriver::connect_to_timidity(int port) { error("Could not open Timidity socket"); if (connect(s, (struct sockaddr *) &sadd, sizeof(struct sockaddr_in)) < 0) - error("Could not connect to Timidity server"); - + error("Could not connect to Timidity server"); +#endif return s; } -- cgit v1.2.3