Navigation Menu

Skip to content

Commit

Permalink
Remove redundant 'SDL_GetErrBuf' declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
1bsyl committed Oct 30, 2019
1 parent 9e509e4 commit 81cdd50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/SDL_error.c
Expand Up @@ -26,16 +26,6 @@
#include "SDL_error.h"
#include "SDL_error_c.h"


/* Routine to get the thread-specific error variable */
#if SDL_THREADS_DISABLED
/* The default (non-thread-safe) global error variable */
static SDL_error SDL_global_error;
#define SDL_GetErrBuf() (&SDL_global_error)
#else
extern SDL_error *SDL_GetErrBuf(void);
#endif /* SDL_THREADS_DISABLED */

#define SDL_ERRBUFIZE 1024

/* Private functions */
Expand Down
6 changes: 6 additions & 0 deletions src/thread/SDL_thread.c
Expand Up @@ -205,6 +205,11 @@ SDL_Generic_SetTLSData(SDL_TLSData *storage)
SDL_error *
SDL_GetErrBuf(void)
{
#if SDL_THREADS_DISABLED
/* Non-thread-safe global error variable */
static SDL_error SDL_global_error;
return &SDL_global_error;
#else
static SDL_SpinLock tls_lock;
static SDL_bool tls_being_created;
static SDL_TLSID tls_errbuf;
Expand Down Expand Up @@ -249,6 +254,7 @@ SDL_GetErrBuf(void)
SDL_TLSSet(tls_errbuf, errbuf, SDL_free);
}
return errbuf;
#endif /* SDL_THREADS_DISABLED */
}


Expand Down

0 comments on commit 81cdd50

Please sign in to comment.