From b871b1898d390a6de478cfc795f0675ff2b25878 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 21 Oct 2017 18:07:24 +0100 Subject: [PATCH] OpenBSD build fix. - No timidity user defined parameters supported. - Shared libraries versioning policy differs on OpenBSD. --- src/sound/mididevices/music_timiditypp_mididevice.cpp | 10 ++++++++++ src/sound/oalsound.cpp | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/sound/mididevices/music_timiditypp_mididevice.cpp b/src/sound/mididevices/music_timiditypp_mididevice.cpp index 335265326e..b0ce41eade 100644 --- a/src/sound/mididevices/music_timiditypp_mididevice.cpp +++ b/src/sound/mididevices/music_timiditypp_mididevice.cpp @@ -48,7 +48,9 @@ #include #include +#ifndef __OpenBSD__ #include +#endif #include #include @@ -533,7 +535,9 @@ bool TimidityPPMIDIDevice::LaunchTimidity () } int forkres; +#ifndef __OpenBSD__ wordexp_t words; +#endif glob_t glb; // Get timidity executable path @@ -541,8 +545,10 @@ bool TimidityPPMIDIDevice::LaunchTimidity () glob(ExeName.GetChars(), 0, NULL, &glb); if(glb.gl_pathc != 0) exename = glb.gl_pathv[0]; +#ifndef __OpenBSD__ // Get user-defined extra args wordexp(timidity_extargs, &words, WRDE_NOCMD); +#endif std::string chorusarg = std::string("-EFchorus=") + *timidity_chorus; std::string reverbarg = std::string("-EFreverb=") + *timidity_reverb; @@ -557,8 +563,10 @@ bool TimidityPPMIDIDevice::LaunchTimidity () std::vector arglist; arglist.push_back(exename); +#ifndef __OpenBSD__ for(size_t i = 0;i < words.we_wordc;i++) arglist.push_back(words.we_wordv[i]); +#endif if(**timidity_config != '\0') { arglist.push_back("-c"); @@ -611,7 +619,9 @@ bool TimidityPPMIDIDevice::LaunchTimidity () }*/ } +#ifndef __OpenBSD__ wordfree(&words); +#endif globfree (&glb); return ChildProcess != -1; #endif // _WIN32 diff --git a/src/sound/oalsound.cpp b/src/sound/oalsound.cpp index 683f25ae73..b9b0a1b104 100644 --- a/src/sound/oalsound.cpp +++ b/src/sound/oalsound.cpp @@ -72,6 +72,8 @@ CVAR (String, snd_alresampler, "Default", CVAR_ARCHIVE|CVAR_GLOBALCONFIG) #define OPENALLIB "openal32.dll" #elif defined(__APPLE__) #define OPENALLIB "OpenAL.framework/OpenAL" +#elif defined(__OpenBSD__) +#define OPENALLIB "libopenal.so" #else #define OPENALLIB "libopenal.so.1" #endif