mirror of https://github.com/xemu-project/xemu.git
sdl: Print out SDL_GetError message when subsystem init fails
This commit is contained in:
parent
f24bcb8bc7
commit
fdd7875051
|
@ -2601,7 +2601,10 @@ void mcpx_apu_init(PCIBus *bus, int devfn, MemoryRegion *ram)
|
|||
.userdata = d,
|
||||
};
|
||||
|
||||
assert(SDL_Init(SDL_INIT_AUDIO) >= 0);
|
||||
if (SDL_Init(SDL_INIT_AUDIO) < 0) {
|
||||
fprintf(stderr, "Failed to initialize SDL audio subsystem: %s\n", SDL_GetError());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
SDL_AudioDeviceID sdl_audio_dev;
|
||||
sdl_audio_dev = SDL_OpenAudioDevice(NULL, 0, &sdl_audio_spec, NULL, 0);
|
||||
|
|
|
@ -63,12 +63,12 @@ void xemu_input_init(void)
|
|||
SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");
|
||||
|
||||
if (SDL_Init(SDL_INIT_GAMECONTROLLER) < 0) {
|
||||
fprintf(stderr, "Failed to initialize SDL gamecontroller subsystem\n");
|
||||
fprintf(stderr, "Failed to initialize SDL gamecontroller subsystem: %s\n", SDL_GetError());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (SDL_Init(SDL_INIT_HAPTIC) < 0) {
|
||||
fprintf(stderr, "Failed to initialize SDL haptic subsystem\n");
|
||||
fprintf(stderr, "Failed to initialize SDL haptic subsystem: %s\n", SDL_GetError());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue