mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +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()
|
||||
{
|
||||
#ifdef HAVE_SYSTEM_MIDI
|
||||
#ifdef __linux__
|
||||
auto & sequencer = AlsaSequencer::Get();
|
||||
return sequencer.GetDevices();
|
||||
#elif _WIN32
|
||||
// TODO: move the weird stuff from music_midi_base.cpp here, or at least to this lib and call it here
|
||||
return {};
|
||||
#endif
|
||||
#else
|
||||
return {};
|
||||
#endif
|
||||
#if defined HAVE_SYSTEM_MIDI && defined __linux__
|
||||
auto &sequencer = AlsaSequencer::Get();
|
||||
return sequencer.GetDevices();
|
||||
#else // !HAVE_SYSTEM_MIDI || !__linux__
|
||||
static std::vector<MidiOutDevice> empty;
|
||||
return empty;
|
||||
#endif // HAVE_SYSTEM_MIDI && __linux__
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue