Remove redundant 'SDL_GetErrBuf' declaration
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
diff --git a/src/SDL_error.c b/src/SDL_error.c
index f3f481b..cc85074 100644
--- a/src/SDL_error.c
+++ b/src/SDL_error.c
@@ -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 */
diff --git a/src/thread/SDL_thread.c b/src/thread/SDL_thread.c
index f7eb4ee..c524776 100644
--- a/src/thread/SDL_thread.c
+++ b/src/thread/SDL_thread.c
@@ -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;
@@ -249,6 +254,7 @@ SDL_GetErrBuf(void)
SDL_TLSSet(tls_errbuf, errbuf, SDL_free);
}
return errbuf;
+#endif /* SDL_THREADS_DISABLED */
}