Remove redundant 'SDL_GetErrBuf' declaration
authorSylvain Becker <sylvain.becker@gmail.com>
Wed, 30 Oct 2019 17:35:40 +0100
changeset 13209f872396dcc58
parent 13208 4389d1796f6d
child 13210 802516cf7035
Remove redundant 'SDL_GetErrBuf' declaration
src/SDL_error.c
src/thread/SDL_thread.c
     1.1 --- a/src/SDL_error.c	Wed Oct 30 16:45:53 2019 +0100
     1.2 +++ b/src/SDL_error.c	Wed Oct 30 17:35:40 2019 +0100
     1.3 @@ -26,16 +26,6 @@
     1.4  #include "SDL_error.h"
     1.5  #include "SDL_error_c.h"
     1.6  
     1.7 -
     1.8 -/* Routine to get the thread-specific error variable */
     1.9 -#if SDL_THREADS_DISABLED
    1.10 -/* The default (non-thread-safe) global error variable */
    1.11 -static SDL_error SDL_global_error;
    1.12 -#define SDL_GetErrBuf() (&SDL_global_error)
    1.13 -#else
    1.14 -extern SDL_error *SDL_GetErrBuf(void);
    1.15 -#endif /* SDL_THREADS_DISABLED */
    1.16 -
    1.17  #define SDL_ERRBUFIZE   1024
    1.18  
    1.19  /* Private functions */
     2.1 --- a/src/thread/SDL_thread.c	Wed Oct 30 16:45:53 2019 +0100
     2.2 +++ b/src/thread/SDL_thread.c	Wed Oct 30 17:35:40 2019 +0100
     2.3 @@ -205,6 +205,11 @@
     2.4  SDL_error *
     2.5  SDL_GetErrBuf(void)
     2.6  {
     2.7 +#if SDL_THREADS_DISABLED
     2.8 +    /* Non-thread-safe global error variable */
     2.9 +    static SDL_error SDL_global_error;
    2.10 +    return &SDL_global_error;
    2.11 +#else
    2.12      static SDL_SpinLock tls_lock;
    2.13      static SDL_bool tls_being_created;
    2.14      static SDL_TLSID tls_errbuf;
    2.15 @@ -249,6 +254,7 @@
    2.16          SDL_TLSSet(tls_errbuf, errbuf, SDL_free);
    2.17      }
    2.18      return errbuf;
    2.19 +#endif /* SDL_THREADS_DISABLED */
    2.20  }
    2.21  
    2.22