include/SDL_stdinc.h
changeset 1379 c0a74f199ecf
parent 1368 533567cbb576
child 1381 8570e1f4b1f1
     1.1 --- a/include/SDL_stdinc.h	Sun Feb 19 23:38:57 2006 +0000
     1.2 +++ b/include/SDL_stdinc.h	Sun Feb 19 23:46:34 2006 +0000
     1.3 @@ -206,6 +206,9 @@
     1.4  #define SDL_abs(X)	((X) < 0 ? -(X) : (X))
     1.5  #endif
     1.6  
     1.7 +#define SDL_min(x, y)	(((x) < (y)) ? (x) : (y))
     1.8 +#define SDL_max(x, y)	(((x) > (y)) ? (x) : (y))
     1.9 +
    1.10  #if HAVE_CTYPE_H
    1.11  #define SDL_isdigit(X)  isdigit(X)
    1.12  #define SDL_isspace(X)  isspace(X)
    1.13 @@ -355,28 +358,16 @@
    1.14  extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string);
    1.15  #endif
    1.16  
    1.17 -#if HAVE_STRCPY
    1.18 -#define SDL_strcpy     strcpy
    1.19 +#if HAVE_STRLCPY
    1.20 +#define SDL_strlcpy     strlcpy
    1.21  #else
    1.22 -extern DECLSPEC char * SDLCALL SDL_strcpy(char *dst, const char *src);
    1.23 +extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen);
    1.24  #endif
    1.25  
    1.26 -#if HAVE_STRNCPY
    1.27 -#define SDL_strncpy     strncpy
    1.28 +#if HAVE_STRLCAT
    1.29 +#define SDL_strlcat    strlcat
    1.30  #else
    1.31 -extern DECLSPEC char * SDLCALL SDL_strncpy(char *dst, const char *src, size_t maxlen);
    1.32 -#endif
    1.33 -
    1.34 -#if HAVE_STRCAT
    1.35 -#define SDL_strcat     strcat
    1.36 -#else
    1.37 -#define SDL_strcat(dst, src)    (SDL_strcpy(dst+SDL_strlen(dst), src), dst)
    1.38 -#endif
    1.39 -
    1.40 -#if HAVE_STRNCAT
    1.41 -#define SDL_strncat    strncat
    1.42 -#else
    1.43 -#define SDL_strncat(dst, src, n) (SDL_strncpy(dst+SDL_strlen(dst), src, n), dst)
    1.44 +extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen);
    1.45  #endif
    1.46  
    1.47  #if HAVE_STRDUP