aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Brown2002-03-14 12:14:22 +0000
committerJames Brown2002-03-14 12:14:22 +0000
commit7ba12f5f97f427e9d9999b01c215edaae7a932ac (patch)
treef63874fcaeca4c56c8f0192eebfd23a49eaa0220
parentd6f2760dffa51c57d8c75aaa6e5a2a72a0762698 (diff)
downloadscummvm-rg350-7ba12f5f97f427e9d9999b01c215edaae7a932ac.tar.gz
scummvm-rg350-7ba12f5f97f427e9d9999b01c215edaae7a932ac.tar.bz2
scummvm-rg350-7ba12f5f97f427e9d9999b01c215edaae7a932ac.zip
Fix some possible problems with new gmidi.cpp compiling on Mac Carbon..
svn-id: r3746
-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;
}