audio: Patched to compile on C89 compilers.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 10 Aug 2016 14:14:14 -0400
changeset 10277230c0df1e152
parent 10276 470698f90685
child 10278 1e7b4cfe8451
audio: Patched to compile on C89 compilers.
src/audio/SDL_audio.c
     1.1 --- a/src/audio/SDL_audio.c	Wed Aug 10 14:13:48 2016 -0400
     1.2 +++ b/src/audio/SDL_audio.c	Wed Aug 10 14:14:14 2016 -0400
     1.3 @@ -1362,6 +1362,10 @@
     1.4      /* Start the audio thread if necessary */
     1.5      if (!current_audio.impl.ProvidesOwnCallbackThread) {
     1.6          /* Start the audio thread */
     1.7 +        /* !!! FIXME: we don't force the audio thread stack size here if it calls into user code, but maybe we should? */
     1.8 +        /* buffer queueing callback only needs a few bytes, so make the stack tiny. */
     1.9 +        const size_t stacksize = is_internal_thread ? 64 * 1024 : 0;
    1.10 +        char threadname[64];
    1.11  
    1.12          /* Allocate a fake audio buffer; only used by our internal threads. */
    1.13          Uint32 stream_len = (device->convert.needed) ? device->convert.len_cvt : 0;
    1.14 @@ -1377,12 +1381,8 @@
    1.15              return 0;
    1.16          }
    1.17  
    1.18 -        /* !!! FIXME: we don't force the audio thread stack size here because it calls into user code, but maybe we should? */
    1.19 -        /* buffer queueing callback only needs a few bytes, so make the stack tiny. */
    1.20 -        char name[64];
    1.21 -        const size_t stacksize = is_internal_thread ? 64 * 1024 : 0;
    1.22 -        SDL_snprintf(name, sizeof (name), "SDLAudioDev%d", (int) device->id);
    1.23 -        device->thread = SDL_CreateThreadInternal(iscapture ? SDL_CaptureAudio : SDL_RunAudio, name, stacksize, device);
    1.24 +        SDL_snprintf(threadname, sizeof (threadname), "SDLAudioDev%d", (int) device->id);
    1.25 +        device->thread = SDL_CreateThreadInternal(iscapture ? SDL_CaptureAudio : SDL_RunAudio, threadname, stacksize, device);
    1.26  
    1.27          if (device->thread == NULL) {
    1.28              SDL_CloseAudioDevice(device->id);