Allow users to define SDL_STDINC_NO_INLINES if they don't want the inline functions defined.
authorSam Lantinga <slouken@libsdl.org>
Thu, 13 Jun 2013 22:30:02 -0700
changeset 7308728e5f22a82f
parent 7307 5d6b7b9432d3
child 7309 eae894fafea0
child 7332 b53acf6ab70b
Allow users to define SDL_STDINC_NO_INLINES if they don't want the inline functions defined.
This is useful, for example, if the standard config defines HAVE_SETENV but you're building with C99 that doesn't include that feature.
include/SDL_stdinc.h
     1.1 --- a/include/SDL_stdinc.h	Thu Jun 13 22:10:10 2013 -0700
     1.2 +++ b/include/SDL_stdinc.h	Thu Jun 13 22:30:02 2013 -0700
     1.3 @@ -241,57 +241,62 @@
     1.4     couldn't if you had macros, you can link against a foreign build of SDL
     1.5     even if you configured differently, and you can drop the unconfigured SDL
     1.6     headers into a project without #defining HAVE_MALLOC (etc) and still link.
     1.7 +
     1.8 +   If you want to disable the inline functions and just use SDL's functions,
     1.9 +   you can define SDL_STDINC_NO_INLINES before including this file.
    1.10  */
    1.11  
    1.12  extern DECLSPEC void *SDLCALL SDL_malloc(size_t size);
    1.13 -#ifdef HAVE_MALLOC
    1.14 +#if defined(HAVE_MALLOC) && !defined(SDL_STDINC_NO_INLINES)
    1.15  SDL_FORCE_INLINE void *SDL_malloc_inline(size_t size) { return malloc(size); }
    1.16  #define SDL_malloc SDL_malloc_inline
    1.17  #endif
    1.18  
    1.19  extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size);
    1.20 -#ifdef HAVE_CALLOC
    1.21 +#if defined(HAVE_CALLOC) && !defined(SDL_STDINC_NO_INLINES)
    1.22  SDL_FORCE_INLINE void *SDL_calloc_inline(size_t nmemb, size_t size) { return calloc(nmemb, size); }
    1.23  #define SDL_calloc SDL_calloc_inline
    1.24  #endif
    1.25  
    1.26  extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size);
    1.27 -#ifdef HAVE_REALLOC
    1.28 +#if defined(HAVE_REALLOC) && !defined(SDL_STDINC_NO_INLINES)
    1.29  SDL_FORCE_INLINE void *SDL_realloc_inline(void *mem, size_t size) { return realloc(mem, size); }
    1.30  #define SDL_realloc SDL_realloc_inline
    1.31  #endif
    1.32  
    1.33  extern DECLSPEC void SDLCALL SDL_free(void *mem);
    1.34 -#ifdef HAVE_FREE
    1.35 +#if defined(HAVE_FREE) && !defined(SDL_STDINC_NO_INLINES)
    1.36  SDL_FORCE_INLINE void SDL_free_inline(void *mem) { free(mem); }
    1.37  #define SDL_free SDL_free_inline
    1.38  #endif
    1.39  
    1.40  extern DECLSPEC char *SDLCALL SDL_getenv(const char *name);
    1.41 -#ifdef HAVE_GETENV
    1.42 +#if defined(HAVE_GETENV) && !defined(SDL_STDINC_NO_INLINES)
    1.43  SDL_FORCE_INLINE char *SDL_getenv_inline(const char *name) { return getenv(name); }
    1.44  #define SDL_getenv SDL_getenv_inline
    1.45  #endif
    1.46  
    1.47  extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite);
    1.48 -#ifdef HAVE_SETENV
    1.49 +#if defined(HAVE_SETENV) && !defined(SDL_STDINC_NO_INLINES)
    1.50  SDL_FORCE_INLINE int SDL_setenv_inline(const char *name, const char *value, int overwrite) { return setenv(name, value, overwrite); }
    1.51  #define SDL_setenv SDL_setenv_inline
    1.52  #endif
    1.53  
    1.54  extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *));
    1.55 -#ifdef HAVE_QSORT
    1.56 +#if defined(HAVE_QSORT) && !defined(SDL_STDINC_NO_INLINES)
    1.57  SDL_FORCE_INLINE void SDL_qsort_inline(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *)) { qsort(base, nmemb, size, compare); }
    1.58  #define SDL_qsort SDL_qsort_inline
    1.59  #endif
    1.60  
    1.61  extern DECLSPEC int SDLCALL SDL_abs(int x);
    1.62 +#ifndef SDL_STDINC_NO_INLINES
    1.63  #ifdef HAVE_ABS
    1.64  SDL_FORCE_INLINE int SDL_abs_inline(int x) { return abs(x); }
    1.65  #else
    1.66  SDL_FORCE_INLINE int SDL_abs_inline(int x) { return ((x) < 0 ? -(x) : (x)); }
    1.67  #endif
    1.68  #define SDL_abs SDL_abs_inline
    1.69 +#endif /* !SDL_STDINC_NO_INLINES */
    1.70  
    1.71  /* !!! FIXME: these have side effects. You probably shouldn't use them. */
    1.72  /* !!! FIXME: Maybe we do forceinline functions of SDL_mini, SDL_minf, etc? */
    1.73 @@ -302,6 +307,7 @@
    1.74  extern DECLSPEC int SDLCALL SDL_isspace(int x);
    1.75  extern DECLSPEC int SDLCALL SDL_toupper(int x);
    1.76  extern DECLSPEC int SDLCALL SDL_tolower(int x);
    1.77 +#ifndef SDL_STDINC_NO_INLINES
    1.78  #ifdef HAVE_CTYPE_H
    1.79  SDL_FORCE_INLINE int SDL_isdigit_inline(int x) { return isdigit(x); }
    1.80  SDL_FORCE_INLINE int SDL_isspace_inline(int x) { return isspace(x); }
    1.81 @@ -317,9 +323,10 @@
    1.82  #define SDL_isspace SDL_isspace_inline
    1.83  #define SDL_toupper SDL_toupper_inline
    1.84  #define SDL_tolower SDL_tolower_inline
    1.85 +#endif /* !SDL_STDINC_NO_INLINES */
    1.86  
    1.87  extern DECLSPEC void *SDLCALL SDL_memset(void *dst, int c, size_t len);
    1.88 -#ifdef HAVE_MEMSET
    1.89 +#if defined(HAVE_MEMSET) && !defined(SDL_STDINC_NO_INLINES)
    1.90  SDL_FORCE_INLINE void *SDL_memset_inline(void *dst, int c, size_t len) { return memset(dst, c, len); }
    1.91  #define SDL_memset SDL_memset_inline
    1.92  #endif
    1.93 @@ -359,6 +366,7 @@
    1.94  
    1.95  
    1.96  extern DECLSPEC void *SDLCALL SDL_memcpy(void *dst, const void *src, size_t len);
    1.97 +#if !defined(SDL_STDINC_NO_INLINES)
    1.98  #if defined(__MACOSX__) && defined(HAVE_MEMCPY)
    1.99  SDL_FORCE_INLINE void *SDL_memcpy_inline(void *dst, const void *src, size_t len)
   1.100  {
   1.101 @@ -404,6 +412,7 @@
   1.102  }
   1.103  #define SDL_memcpy SDL_memcpy_inline
   1.104  #endif
   1.105 +#endif /* !SDL_STDINC_NO_INLINES */
   1.106  
   1.107  
   1.108  SDL_FORCE_INLINE void *SDL_memcpy4(void *dst, const void *src, size_t dwords)
   1.109 @@ -426,43 +435,43 @@
   1.110  }
   1.111  
   1.112  extern DECLSPEC void *SDLCALL SDL_memmove(void *dst, const void *src, size_t len);
   1.113 -#ifdef HAVE_MEMMOVE
   1.114 +#if defined(HAVE_MEMMOVE) && !defined(SDL_STDINC_NO_INLINES)
   1.115  SDL_FORCE_INLINE void *SDL_memmove_inline(void *dst, const void *src, size_t len) { return memmove(dst, src, len); }
   1.116  #define SDL_memmove SDL_memmove_inline
   1.117  #endif
   1.118  
   1.119  extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len);
   1.120 -#ifdef HAVE_MEMCMP
   1.121 +#if defined(HAVE_MEMCMP) && !defined(SDL_STDINC_NO_INLINES)
   1.122  SDL_FORCE_INLINE int SDL_memcmp_inline(const void *s1, const void *s2, size_t len) { return memcmp(s1, s2, len); }
   1.123  #define SDL_memcmp SDL_memcmp_inline
   1.124  #endif
   1.125  
   1.126  extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str);
   1.127 -#ifdef HAVE_STRLEN
   1.128 +#if defined(HAVE_STRLEN) && !defined(SDL_STDINC_NO_INLINES)
   1.129  SDL_FORCE_INLINE size_t SDL_strlen_inline(const char *str) { return strlen(str); }
   1.130  #define SDL_strlen SDL_strlen_inline
   1.131  #endif
   1.132  
   1.133  extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr);
   1.134 -#ifdef HAVE_WCSLEN
   1.135 +#if defined(HAVE_WCSLEN) && !defined(SDL_STDINC_NO_INLINES)
   1.136  SDL_FORCE_INLINE size_t SDL_wcslen_inline(const wchar_t *wstr) { return wcslen(wstr); }
   1.137  #define SDL_wcslen SDL_wcslen_inline
   1.138  #endif
   1.139  
   1.140  extern DECLSPEC size_t SDLCALL SDL_wcslcpy(wchar_t *dst, const wchar_t *src, size_t maxlen);
   1.141 -#ifdef HAVE_WCSLCPY
   1.142 +#if defined(HAVE_WCSLCPY) && !defined(SDL_STDINC_NO_INLINES)
   1.143  SDL_FORCE_INLINE size_t SDL_wcslcpy_inline(wchar_t *dst, const wchar_t *src, size_t maxlen) { return wcslcpy(dst, src, maxlen); }
   1.144  #define SDL_wcslcpy SDL_wcslcpy_inline
   1.145  #endif
   1.146  
   1.147  extern DECLSPEC size_t SDLCALL SDL_wcslcat(wchar_t *dst, const wchar_t *src, size_t maxlen);
   1.148 -#ifdef HAVE_WCSLCAT
   1.149 +#if defined(HAVE_WCSLCAT) && !defined(SDL_STDINC_NO_INLINES)
   1.150  SDL_FORCE_INLINE size_t SDL_wcslcat_inline(wchar_t *dst, const wchar_t *src, size_t maxlen) { return wcslcat(dst, src, maxlen); }
   1.151  #define SDL_wcslcat SDL_wcslcat_inline
   1.152  #endif
   1.153  
   1.154  extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen);
   1.155 -#ifdef HAVE_STRLCPY
   1.156 +#if defined(HAVE_STRLCPY) && !defined(SDL_STDINC_NO_INLINES)
   1.157  SDL_FORCE_INLINE size_t SDL_strlcpy_inline(char *dst, const char *src, size_t maxlen) { return strlcpy(dst, src, maxlen); }
   1.158  #define SDL_strlcpy SDL_strlcpy_inline
   1.159  #else
   1.160 @@ -471,36 +480,37 @@
   1.161  extern DECLSPEC size_t SDLCALL SDL_utf8strlcpy(char *dst, const char *src, size_t dst_bytes);
   1.162  
   1.163  extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen);
   1.164 -#ifdef HAVE_STRLCAT
   1.165 +#if defined(HAVE_STRLCAT) && !defined(SDL_STDINC_NO_INLINES)
   1.166  SDL_FORCE_INLINE size_t SDL_strlcat_inline(char *dst, const char *src, size_t maxlen) { return strlcat(dst, src, maxlen); }
   1.167  #define SDL_strlcat SDL_strlcat_inline
   1.168  #endif
   1.169  
   1.170  extern DECLSPEC char *SDLCALL SDL_strdup(const char *str);
   1.171 -#ifdef HAVE_STRDUP
   1.172 +#if defined(HAVE_STRDUP) && !defined(SDL_STDINC_NO_INLINES)
   1.173  SDL_FORCE_INLINE char *SDL_strdup_inline(const char *str) { return strdup(str); }
   1.174  #define SDL_strdup SDL_strdup_inline
   1.175  #endif
   1.176  
   1.177  extern DECLSPEC char *SDLCALL SDL_strrev(char *str);
   1.178 -#ifdef HAVE__STRREV
   1.179 +#if defined(HAVE__STRREV) && !defined(SDL_STDINC_NO_INLINES)
   1.180  SDL_FORCE_INLINE char *SDL_strrev_inline(char *str) { return _strrev(str); }
   1.181  #define SDL_strrev SDL_strrev_inline
   1.182  #endif
   1.183  
   1.184  extern DECLSPEC char *SDLCALL SDL_strupr(char *str);
   1.185 -#ifdef HAVE__STRUPR
   1.186 +#if defined(HAVE__STRUPR) && !defined(SDL_STDINC_NO_INLINES)
   1.187  SDL_FORCE_INLINE char *SDL_strupr_inline(char *str) { return _strupr(str); }
   1.188  #define SDL_strupr SDL_strupr_inline
   1.189  #endif
   1.190  
   1.191  extern DECLSPEC char *SDLCALL SDL_strlwr(char *str);
   1.192 -#ifdef HAVE__STRLWR
   1.193 +#if defined(HAVE__STRLWR) && !defined(SDL_STDINC_NO_INLINES)
   1.194  SDL_FORCE_INLINE char *SDL_strlwr_inline(char *str) { return _strlwr(str); }
   1.195  #define SDL_strlwr SDL_strlwr_inline
   1.196  #endif
   1.197  
   1.198  extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c);
   1.199 +#ifndef SDL_STDINC_NO_INLINES
   1.200  #ifdef HAVE_STRCHR
   1.201  SDL_FORCE_INLINE char *SDL_strchr_inline(const char *str, int c) { return SDL_const_cast(char*,strchr(str, c)); }
   1.202  #define SDL_strchr SDL_strchr_inline
   1.203 @@ -508,8 +518,10 @@
   1.204  SDL_FORCE_INLINE char *SDL_strchr_inline(const char *str, int c) { return SDL_const_cast(char*,index(str, c)); }
   1.205  #define SDL_strchr SDL_strchr_inline
   1.206  #endif
   1.207 +#endif /* !SDL_STDINC_NO_INLINES */
   1.208  
   1.209  extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c);
   1.210 +#ifndef SDL_STDINC_NO_INLINES
   1.211  #ifdef HAVE_STRRCHR
   1.212  SDL_FORCE_INLINE char *SDL_strrchr_inline(const char *str, int c) { return SDL_const_cast(char*,strrchr(str, c)); }
   1.213  #define SDL_strrchr SDL_strrchr_inline
   1.214 @@ -517,114 +529,124 @@
   1.215  SDL_FORCE_INLINE char *SDL_strrchr_inline(const char *str, int c) { return SDL_const_cast(char*,rindex(str, c)); }
   1.216  #define SDL_strrchr SDL_strrchr_inline
   1.217  #endif
   1.218 +#endif /* !SDL_STDINC_NO_INLINES */
   1.219  
   1.220  extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle);
   1.221 -#ifdef HAVE_STRSTR
   1.222 +#if defined(HAVE_STRSTR) && !defined(SDL_STDINC_NO_INLINES)
   1.223  SDL_FORCE_INLINE char *SDL_strstr_inline(const char *haystack, const char *needle) { return SDL_const_cast(char*,strstr(haystack, needle)); }
   1.224  #define SDL_strstr SDL_strstr_inline
   1.225  #endif
   1.226  
   1.227  extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix);
   1.228 -#ifdef HAVE__LTOA
   1.229 +#if defined(HAVE__LTOA) && !defined(SDL_STDINC_NO_INLINES)
   1.230  SDL_FORCE_INLINE char *SDL_ltoa_inline(long value, char *str, int radix) { return _ltoa(value, str, radix); }
   1.231  #define SDL_ltoa SDL_ltoa_inline
   1.232  #endif
   1.233  
   1.234  extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix);
   1.235 +#ifndef SDL_STDINC_NO_INLINES
   1.236  #ifdef HAVE_ITOA
   1.237  SDL_FORCE_INLINE char *SDL_itoa_inline(int value, char *str, int radix) { return itoa(value, str, radix); }
   1.238  #else
   1.239  SDL_FORCE_INLINE char *SDL_itoa_inline(int value, char *str, int radix) { return SDL_ltoa((long)value, str, radix); }
   1.240  #endif
   1.241  #define SDL_itoa SDL_itoa_inline
   1.242 +#endif /* !SDL_STDINC_NO_INLINES */
   1.243  
   1.244  extern DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *str, int radix);
   1.245 -#ifdef HAVE__ULTOA
   1.246 +#if defined(HAVE__ULTOA) && !defined(SDL_STDINC_NO_INLINES)
   1.247  SDL_FORCE_INLINE char *SDL_ultoa_inline(unsigned long value, char *str, int radix) { return _ultoa(value, str, radix); }
   1.248  #define SDL_ultoa SDL_ultoa_inline
   1.249  #endif
   1.250  
   1.251  extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix);
   1.252 +#ifndef SDL_STDINC_NO_INLINES
   1.253  #ifdef HAVE__UITOA
   1.254  SDL_FORCE_INLINE char *SDL_uitoa_inline(unsigned int value, char *str, int radix) { return _uitoa(value, str, radix); }
   1.255  #else
   1.256  SDL_FORCE_INLINE char *SDL_uitoa_inline(unsigned int value, char *str, int radix) { return SDL_ultoa((unsigned long)value, str, radix); }
   1.257  #endif
   1.258  #define SDL_uitoa SDL_uitoa_inline
   1.259 +#endif /* !SDL_STDINC_NO_INLINES */
   1.260  
   1.261  
   1.262  extern DECLSPEC long SDLCALL SDL_strtol(const char *str, char **endp, int base);
   1.263 -#ifdef HAVE_STRTOL
   1.264 +#if defined(HAVE_STRTOL) && !defined(SDL_STDINC_NO_INLINES)
   1.265  SDL_FORCE_INLINE long SDL_strtol_inline(const char *str, char **endp, int base) { return strtol(str, endp, base); }
   1.266  #define SDL_strtol SDL_strtol_inline
   1.267  #endif
   1.268  
   1.269  extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **endp, int base);
   1.270 -#ifdef HAVE_STRTOUL
   1.271 +#if defined(HAVE_STRTOUL) && !defined(SDL_STDINC_NO_INLINES)
   1.272  SDL_FORCE_INLINE unsigned long SDLCALL SDL_strtoul_inline(const char *str, char **endp, int base) { return strtoul(str, endp, base); }
   1.273  #define SDL_strtoul SDL_strtoul_inline
   1.274  #endif
   1.275  
   1.276  extern DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *str, int radix);
   1.277 -#ifdef HAVE__I64TOA
   1.278 +#if defined(HAVE__I64TOA) && !defined(SDL_STDINC_NO_INLINES)
   1.279  SDL_FORCE_INLINE char *SDL_lltoa_inline(Sint64 value, char *str, int radix) { return _i64toa(value, str, radix); }
   1.280  #define SDL_lltoa SDL_lltoa_inline
   1.281  #endif
   1.282  
   1.283  extern DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *str, int radix);
   1.284 -#ifdef HAVE__UI64TOA
   1.285 +#if defined(HAVE__UI64TOA) && !defined(SDL_STDINC_NO_INLINES)
   1.286  SDL_FORCE_INLINE char *SDL_ulltoa_inline(Uint64 value, char *str, int radix) { return _ui64toa(value, str, radix); }
   1.287  #define SDL_ulltoa SDL_ulltoa_inline
   1.288  #endif
   1.289  
   1.290  extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *str, char **endp, int base);
   1.291 -#ifdef HAVE_STRTOLL
   1.292 +#if defined(HAVE_STRTOLL) && !defined(SDL_STDINC_NO_INLINES)
   1.293  SDL_FORCE_INLINE Sint64 SDL_strtoll_inline(const char *str, char **endp, int base) { return strtoll(str, endp, base); }
   1.294  #define SDL_strtoll SDL_strtoll_inline
   1.295  #endif
   1.296  
   1.297  extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *str, char **endp, int base);
   1.298 -#ifdef HAVE_STRTOULL
   1.299 +#if defined(HAVE_STRTOULL) && !defined(SDL_STDINC_NO_INLINES)
   1.300  SDL_FORCE_INLINE Uint64 SDL_strtoull_inline(const char *str, char **endp, int base) { return strtoull(str, endp, base); }
   1.301  #define SDL_strtoull SDL_strtoull_inline
   1.302  #endif
   1.303  
   1.304  extern DECLSPEC double SDLCALL SDL_strtod(const char *str, char **endp);
   1.305 -#ifdef HAVE_STRTOD
   1.306 +#if defined(HAVE_STRTOD) && !defined(SDL_STDINC_NO_INLINES)
   1.307  SDL_FORCE_INLINE double SDL_strtod_inline(const char *str, char **endp) { return strtod(str, endp); }
   1.308  #define SDL_strtod SDL_strtod_inline
   1.309  #endif
   1.310  
   1.311  extern DECLSPEC int SDLCALL SDL_atoi(const char *str);
   1.312 +#ifndef SDL_STDINC_NO_INLINES
   1.313  #ifdef HAVE_ATOI
   1.314  SDL_FORCE_INLINE int SDL_atoi_inline(const char *str) { return atoi(str); }
   1.315  #else
   1.316  SDL_FORCE_INLINE int SDL_atoi_inline(const char *str) { return SDL_strtol(str, NULL, 0); }
   1.317  #endif
   1.318  #define SDL_atoi SDL_atoi_inline
   1.319 +#endif /* !SDL_STDINC_NO_INLINES */
   1.320  
   1.321  extern DECLSPEC double SDLCALL SDL_atof(const char *str);
   1.322 +#ifndef SDL_STDINC_NO_INLINES
   1.323  #ifdef HAVE_ATOF
   1.324  SDL_FORCE_INLINE double SDL_atof_inline(const char *str) { return (double) atof(str); }
   1.325  #else
   1.326  SDL_FORCE_INLINE double SDL_atof_inline(const char *str) { return SDL_strtod(str, NULL); }
   1.327  #endif
   1.328  #define SDL_atof SDL_atof_inline
   1.329 +#endif /* !SDL_STDINC_NO_INLINES */
   1.330  
   1.331  
   1.332  extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2);
   1.333 -#ifdef HAVE_STRCMP
   1.334 +#if defined(HAVE_STRCMP) && !defined(SDL_STDINC_NO_INLINES)
   1.335  SDL_FORCE_INLINE int SDL_strcmp_inline(const char *str1, const char *str2) { return strcmp(str1, str2); }
   1.336  #define SDL_strcmp SDL_strcmp_inline
   1.337  #endif
   1.338  
   1.339  extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen);
   1.340 -#ifdef HAVE_STRNCMP
   1.341 +#if defined(HAVE_STRNCMP) && !defined(SDL_STDINC_NO_INLINES)
   1.342  SDL_FORCE_INLINE int SDL_strncmp_inline(const char *str1, const char *str2, size_t maxlen) { return strncmp(str1, str2, maxlen); }
   1.343  #define SDL_strncmp SDL_strncmp_inline
   1.344  #endif
   1.345  
   1.346  extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
   1.347 +#ifndef SDL_STDINC_NO_INLINES
   1.348  #ifdef HAVE_STRCASECMP
   1.349  SDL_FORCE_INLINE int SDL_strcasecmp_inline(const char *str1, const char *str2) { return strcasecmp(str1, str2); }
   1.350  #define SDL_strcasecmp SDL_strcasecmp_inline
   1.351 @@ -632,8 +654,10 @@
   1.352  SDL_FORCE_INLINE int SDL_strcasecmp_inline(const char *str1, const char *str2) { return _stricmp(str1, str2); }
   1.353  #define SDL_strcasecmp SDL_strcasecmp_inline
   1.354  #endif
   1.355 +#endif /* !SDL_STDINC_NO_INLINES */
   1.356  
   1.357  extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len);
   1.358 +#ifndef SDL_STDINC_NO_INLINES
   1.359  #ifdef HAVE_STRNCASECMP
   1.360  SDL_FORCE_INLINE int SDL_strncasecmp_inline(const char *str1, const char *str2, size_t len) { return strncasecmp(str1, str2, len); }
   1.361  #define SDL_strncasecmp SDL_strncasecmp_inline
   1.362 @@ -641,6 +665,7 @@
   1.363  SDL_FORCE_INLINE int SDL_strncasecmp_inline(const char *str1, const char *str2, size_t len) { return _strnicmp(str1, str2, len); }
   1.364  #define SDL_strncasecmp SDL_strncasecmp_inline
   1.365  #endif
   1.366 +#endif /* !SDL_STDINC_NO_INLINES */
   1.367  
   1.368  /* Not doing SDL_*_inline functions for these, because of the varargs. */
   1.369  extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...);
   1.370 @@ -654,7 +679,7 @@
   1.371  #endif
   1.372  
   1.373  extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap);
   1.374 -#ifdef HAVE_VSNPRINTF
   1.375 +#if defined(HAVE_VSNPRINTF) && !defined(SDL_STDINC_NO_INLINES)
   1.376  SDL_FORCE_INLINE int SDL_vsnprintf_inline(char *text, size_t maxlen, const char *fmt, va_list ap) { return vsnprintf(text, maxlen, fmt, ap); }
   1.377  #define SDL_vsnprintf SDL_vsnprintf_inline
   1.378  #endif
   1.379 @@ -666,91 +691,97 @@
   1.380  #endif
   1.381  
   1.382  extern DECLSPEC double SDLCALL SDL_atan(double x);
   1.383 -#ifdef HAVE_ATAN
   1.384 +#if defined(HAVE_ATAN) && !defined(SDL_STDINC_NO_INLINES)
   1.385  SDL_FORCE_INLINE double SDL_atan_inline(double x) { return atan(x); }
   1.386  #define SDL_atan SDL_atan_inline
   1.387  #endif
   1.388  
   1.389  extern DECLSPEC double SDLCALL SDL_atan2(double x, double y);
   1.390 -#ifdef HAVE_ATAN2
   1.391 +#if defined(HAVE_ATAN2) && !defined(SDL_STDINC_NO_INLINES)
   1.392  SDL_FORCE_INLINE double SDL_atan2_inline(double x, double y) { return atan2(x, y); }
   1.393  #define SDL_atan2 SDL_atan2_inline
   1.394  #endif
   1.395  
   1.396  extern DECLSPEC double SDLCALL SDL_ceil(double x);
   1.397 +#ifndef SDL_STDINC_NO_INLINES
   1.398  #ifdef HAVE_CEIL
   1.399  SDL_FORCE_INLINE double SDL_ceil_inline(double x) { return ceil(x); }
   1.400  #else
   1.401  SDL_FORCE_INLINE double SDL_ceil_inline(double x) { return (double)(int)((x)+0.5); }
   1.402  #endif
   1.403  #define SDL_ceil SDL_ceil_inline
   1.404 +#endif /* !SDL_STDINC_NO_INLINES */
   1.405  
   1.406  extern DECLSPEC double SDLCALL SDL_copysign(double x, double y);
   1.407 -#ifdef HAVE_COPYSIGN
   1.408 +#if defined(HAVE_COPYSIGN) && !defined(SDL_STDINC_NO_INLINES)
   1.409  SDL_FORCE_INLINE double SDL_copysign_inline(double x, double y) { return copysign(x, y); }
   1.410  #define SDL_copysign SDL_copysign_inline
   1.411  #endif
   1.412  
   1.413  extern DECLSPEC double SDLCALL SDL_cos(double x);
   1.414 -#ifdef HAVE_COS
   1.415 +#if defined(HAVE_COS) && !defined(SDL_STDINC_NO_INLINES)
   1.416  SDL_FORCE_INLINE double SDL_cos_inline(double x) { return cos(x); }
   1.417  #define SDL_cos SDL_cos_inline
   1.418  #endif
   1.419  
   1.420  extern DECLSPEC float SDLCALL SDL_cosf(float x);
   1.421 +#ifndef SDL_STDINC_NO_INLINES
   1.422  #ifdef HAVE_COSF
   1.423  SDL_FORCE_INLINE float SDL_cosf_inline(float x) { return cosf(x); }
   1.424  #else
   1.425  SDL_FORCE_INLINE float SDL_cosf_inline(float x) { return (float)SDL_cos((double)x); }
   1.426  #endif
   1.427  #define SDL_cosf SDL_cosf_inline
   1.428 +#endif /* !SDL_STDINC_NO_INLINES */
   1.429  
   1.430  extern DECLSPEC double SDLCALL SDL_fabs(double x);
   1.431 -#ifdef HAVE_FABS
   1.432 +#if defined(HAVE_FABS) && !defined(SDL_STDINC_NO_INLINES)
   1.433  SDL_FORCE_INLINE double SDL_fabs_inline(double x) { return fabs(x); }
   1.434  #define SDL_fabs SDL_fabs_inline
   1.435  #endif
   1.436  
   1.437  extern DECLSPEC double SDLCALL SDL_floor(double x);
   1.438 -#ifdef HAVE_FLOOR
   1.439 +#if defined(HAVE_FLOOR) && !defined(SDL_STDINC_NO_INLINES)
   1.440  SDL_FORCE_INLINE double SDL_floor_inline(double x) { return floor(x); }
   1.441  #define SDL_floor SDL_floor_inline
   1.442  #endif
   1.443  
   1.444  extern DECLSPEC double SDLCALL SDL_log(double x);
   1.445 -#ifdef HAVE_LOG
   1.446 +#if defined(HAVE_LOG) && !defined(SDL_STDINC_NO_INLINES)
   1.447  SDL_FORCE_INLINE double SDL_log_inline(double x) { return log(x); }
   1.448  #define SDL_log SDL_log_inline
   1.449  #endif
   1.450  
   1.451  extern DECLSPEC double SDLCALL SDL_pow(double x, double y);
   1.452 -#ifdef HAVE_POW
   1.453 +#if defined(HAVE_POW) && !defined(SDL_STDINC_NO_INLINES)
   1.454  SDL_FORCE_INLINE double SDL_pow_inline(double x, double y) { return pow(x, y); }
   1.455  #define SDL_pow SDL_pow_inline
   1.456  #endif
   1.457  
   1.458  extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n);
   1.459 -#ifdef HAVE_SCALBN
   1.460 +#if defined(HAVE_SCALBN) && !defined(SDL_STDINC_NO_INLINES)
   1.461  SDL_FORCE_INLINE double SDL_scalbn_inline(double x, int n) { return scalbn(x, n); }
   1.462  #define SDL_scalbn SDL_scalbn_inline
   1.463  #endif
   1.464  
   1.465  extern DECLSPEC double SDLCALL SDL_sin(double x);
   1.466 -#ifdef HAVE_SIN
   1.467 +#if defined(HAVE_SIN) && !defined(SDL_STDINC_NO_INLINES)
   1.468  SDL_FORCE_INLINE double SDL_sin_inline(double x) { return sin(x); }
   1.469  #define SDL_sin SDL_sin_inline
   1.470  #endif
   1.471  
   1.472  extern DECLSPEC float SDLCALL SDL_sinf(float x);
   1.473 +#ifndef SDL_STDINC_NO_INLINES
   1.474  #ifdef HAVE_SINF
   1.475  SDL_FORCE_INLINE float SDL_sinf_inline(float x) { return sinf(x); }
   1.476  #else
   1.477  SDL_FORCE_INLINE float SDL_sinf_inline(float x) { return (float)SDL_sin((double)x); }
   1.478  #endif
   1.479  #define SDL_sinf SDL_sinf_inline
   1.480 +#endif /* !SDL_STDINC_NO_INLINES */
   1.481  
   1.482  extern DECLSPEC double SDLCALL SDL_sqrt(double x);
   1.483 -#ifdef HAVE_SQRT
   1.484 +#if defined(HAVE_SQRT) && !defined(SDL_STDINC_NO_INLINES)
   1.485  SDL_FORCE_INLINE double SDL_sqrt_inline(double x) { return sqrt(x); }
   1.486  #define SDL_sqrt SDL_sqrt_inline
   1.487  #endif