Fixed build errors on Mac OS X
authorSam Lantinga <slouken@libsdl.org>
Sat, 06 Jul 2013 00:06:44 -0700
changeset 7352de96caa46c09
parent 7351 668a3dc28361
child 7353 80e081e7538d
Fixed build errors on Mac OS X
src/libm/math_libm.h
src/stdlib/SDL_string.c
     1.1 --- a/src/libm/math_libm.h	Fri Jul 05 23:57:19 2013 -0700
     1.2 +++ b/src/libm/math_libm.h	Sat Jul 06 00:06:44 2013 -0700
     1.3 @@ -18,6 +18,7 @@
     1.4       misrepresented as being the original software.
     1.5    3. This notice may not be removed or altered from any source distribution.
     1.6  */
     1.7 +#include "SDL_config.h"
     1.8  
     1.9  /* Math routines from uClibc: http://www.uclibc.org */
    1.10  
     2.1 --- a/src/stdlib/SDL_string.c	Fri Jul 05 23:57:19 2013 -0700
     2.2 +++ b/src/stdlib/SDL_string.c	Sat Jul 06 00:06:44 2013 -0700
     2.3 @@ -389,7 +389,7 @@
     2.4  SDL_strlen(const char *string)
     2.5  {
     2.6  #if defined(HAVE_STRLEN)
     2.7 -    return strlen(str);
     2.8 +    return strlen(string);
     2.9  #else
    2.10      size_t len = 0;
    2.11      while (*string++) {
    2.12 @@ -403,7 +403,7 @@
    2.13  SDL_wcslen(const wchar_t * string)
    2.14  {
    2.15  #if defined(HAVE_WCSLEN)
    2.16 -    return wcslen(wstr);
    2.17 +    return wcslen(string);
    2.18  #else
    2.19      size_t len = 0;
    2.20      while (*string++) {
    2.21 @@ -511,7 +511,7 @@
    2.22  SDL_strdup(const char *string)
    2.23  {
    2.24  #if defined(HAVE_STRDUP)
    2.25 -    return strdup(str);
    2.26 +    return strdup(string);
    2.27  #else
    2.28      size_t len = SDL_strlen(string) + 1;
    2.29      char *newstr = SDL_malloc(len);
    2.30 @@ -575,9 +575,9 @@
    2.31  SDL_strchr(const char *string, int c)
    2.32  {
    2.33  #ifdef HAVE_STRCHR
    2.34 -    return SDL_const_cast(char*,strchr(str, c));
    2.35 +    return SDL_const_cast(char*,strchr(string, c));
    2.36  #elif defined(HAVE_INDEX)
    2.37 -    return SDL_const_cast(char*,index(str, c));
    2.38 +    return SDL_const_cast(char*,index(string, c));
    2.39  #else
    2.40      while (*string) {
    2.41          if (*string == c) {
    2.42 @@ -593,9 +593,9 @@
    2.43  SDL_strrchr(const char *string, int c)
    2.44  {
    2.45  #ifdef HAVE_STRRCHR
    2.46 -    return SDL_const_cast(char*,strrchr(str, c));
    2.47 +    return SDL_const_cast(char*,strrchr(string, c));
    2.48  #elif defined(HAVE_RINDEX)
    2.49 -    return SDL_const_cast(char*,rindex(str, c));
    2.50 +    return SDL_const_cast(char*,rindex(string, c));
    2.51  #else
    2.52      const char *bufp = string + SDL_strlen(string) - 1;
    2.53      while (bufp >= string) {
    2.54 @@ -793,7 +793,7 @@
    2.55  SDL_strtol(const char *string, char **endp, int base)
    2.56  {
    2.57  #if defined(HAVE_STRTOL)
    2.58 -    return strtol(str, endp, base);
    2.59 +    return strtol(string, endp, base);
    2.60  #else
    2.61      size_t len;
    2.62      long value;
    2.63 @@ -818,7 +818,7 @@
    2.64  SDL_strtoul(const char *string, char **endp, int base)
    2.65  {
    2.66  #if defined(HAVE_STRTOUL)
    2.67 -    return strtoul(str, endp, base);
    2.68 +    return strtoul(string, endp, base);
    2.69  #else
    2.70      size_t len;
    2.71      unsigned long value;
    2.72 @@ -843,7 +843,7 @@
    2.73  SDL_strtoll(const char *string, char **endp, int base)
    2.74  {
    2.75  #if defined(HAVE_STRTOLL)
    2.76 -    return strtoll(str, endp, base);
    2.77 +    return strtoll(string, endp, base);
    2.78  #else
    2.79      size_t len;
    2.80      Sint64 value;
    2.81 @@ -868,7 +868,7 @@
    2.82  SDL_strtoull(const char *string, char **endp, int base)
    2.83  {
    2.84  #if defined(HAVE_STRTOULL)
    2.85 -    return strtoull(str, endp, base);
    2.86 +    return strtoull(string, endp, base);
    2.87  #else
    2.88      size_t len;
    2.89      Uint64 value;
    2.90 @@ -893,7 +893,7 @@
    2.91  SDL_strtod(const char *string, char **endp)
    2.92  {
    2.93  #if defined(HAVE_STRTOD)
    2.94 -    return strtod(str, endp);
    2.95 +    return strtod(string, endp);
    2.96  #else
    2.97      size_t len;
    2.98      double value;
    2.99 @@ -970,9 +970,9 @@
   2.100  SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen)
   2.101  {
   2.102  #ifdef HAVE_STRNCASECMP
   2.103 -    return strncasecmp(str1, str2, len);
   2.104 +    return strncasecmp(str1, str2, maxlen);
   2.105  #elif defined(HAVE__STRNICMP)
   2.106 -    return _strnicmp(str1, str2, len);
   2.107 +    return _strnicmp(str1, str2, maxlen);
   2.108  #else
   2.109      char a = 0;
   2.110      char b = 0;