aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/gmidi.cpp13
1 files changed, 8 insertions, 5 deletions
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;
}