sdl12-compat: SDL_atoi() before SDL2-2.0.17 is non-compliant.

From 36a09e450a007c86ed0f91812fbbba0d783be120 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Fri, 15 Oct 2021 18:56:40 +0300
Subject: [PATCH] SDL_atoi() before SDL2-2.0.17 is non-compliant.

---
 src/SDL12_compat.c | 7 +++++++
 src/SDL20_syms.h   | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index e9e12b4..8e553fc 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -972,6 +972,13 @@ static EventQueueType *EventQueueAvailable = NULL;
 /* This is a KEYDOWN event which is being held for a follow-up TEXTINPUT */
 static SDL12_Event PendingKeydownEvent;
 
+/* SDL_atoi() before SDL2-2.0.17 is non-compliant */
+static SDL_INLINE int SDLCALL
+SDL20_atoi(const char *str)
+{
+    return SDL20_strtol(str, NULL, 10);
+}
+
 /* Obviously we can't use SDL_LoadObject() to load SDL2.  :)  */
 static char loaderror[256];
 #if defined(_WIN32)
diff --git a/src/SDL20_syms.h b/src/SDL20_syms.h
index 343ce43..417e325 100644
--- a/src/SDL20_syms.h
+++ b/src/SDL20_syms.h
@@ -296,7 +296,7 @@ SDL20_SYM_PASSTHROUGH(int,iconv_close,(SDL_iconv_t a),(a),return)
 SDL20_SYM_PASSTHROUGH(size_t,iconv,(SDL_iconv_t a, const char **b, size_t *c, char **d, size_t *e),(a,b,c,d,e),return)
 SDL20_SYM_PASSTHROUGH(char *,iconv_string,(const char *a, const char *b, const char *c, size_t d),(a,b,c,d),return)
 SDL20_SYM(int,setenv,(const char *a, const char *b, int c),(a,b,c),return)
-SDL20_SYM(int,atoi,(const char *a),(a),return)
+
 #ifdef __WATCOMC__ /* Watcom builds are broken with SDL math functions. */
 #ifndef SDL12_MATH
 #include <math.h>