mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-22 01:11:49 +00:00
- fixed crash during enumeration of MIDI devices
libraries/zmusic/zmusic/configuration.cpp:109:9: warning: returning reference to local temporary object [-Wreturn-stack-address]
This commit is contained in:
parent
ea1b8de405
commit
f2bacd5faf
1 changed files with 7 additions and 11 deletions
|
@ -97,17 +97,13 @@ int ZMusic_EnumerateMidiDevices()
|
||||||
|
|
||||||
const std::vector<MidiOutDevice> &ZMusic_GetMidiDevices()
|
const std::vector<MidiOutDevice> &ZMusic_GetMidiDevices()
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SYSTEM_MIDI
|
#if defined HAVE_SYSTEM_MIDI && defined __linux__
|
||||||
#ifdef __linux__
|
|
||||||
auto &sequencer = AlsaSequencer::Get();
|
auto &sequencer = AlsaSequencer::Get();
|
||||||
return sequencer.GetDevices();
|
return sequencer.GetDevices();
|
||||||
#elif _WIN32
|
#else // !HAVE_SYSTEM_MIDI || !__linux__
|
||||||
// TODO: move the weird stuff from music_midi_base.cpp here, or at least to this lib and call it here
|
static std::vector<MidiOutDevice> empty;
|
||||||
return {};
|
return empty;
|
||||||
#endif
|
#endif // HAVE_SYSTEM_MIDI && __linux__
|
||||||
#else
|
|
||||||
return {};
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue