backported fixes from rtxon
[dosdemo] / src / music.c
index 8af6154..11b9c44 100644 (file)
@@ -1,5 +1,7 @@
 #include <stdlib.h>
 #include "music.h"
+
+#ifndef NO_MUSIC
 #include "mikmod.h"
 
 #ifdef __WATCOMC__
@@ -68,7 +70,7 @@ int music_open(const char *fname)
                return -1;
        }
 #else
-       if(!(mod = ML_LoadFN((const signed char*)fname))) {
+       if(!(mod = ML_LoadFN((char*)fname))) {
                fprintf(stderr, "failed to load music: %s: %s\n", fname, myerr);
                return -1;
        }
@@ -150,3 +152,28 @@ static void MikMod_RegisterAllLoaders(void)
        ML_RegisterLoader(&load_xm);
 }
 #endif
+
+#else  /* NO_MUSIC */
+
+int music_open(const char *fname)
+{
+       return 0;
+}
+
+void music_close(void)
+{
+}
+
+void music_play(void)
+{
+}
+
+void music_stop(void)
+{
+}
+
+void music_update(void)
+{
+}
+
+#endif