include/SDL_stdinc.h
changeset 7059 cd194e03c1da
parent 7057 c1563f514b5b
child 7076 1666f7a7494e
child 8460 f483e8bdae3c
equal deleted inserted replaced
7058:64a2c8c882e1 7059:cd194e03c1da
   500 #define SDL_strlwr SDL_strlwr_inline
   500 #define SDL_strlwr SDL_strlwr_inline
   501 #endif
   501 #endif
   502 
   502 
   503 extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c);
   503 extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c);
   504 #ifdef HAVE_STRCHR
   504 #ifdef HAVE_STRCHR
   505 SDL_FORCE_INLINE char *SDL_strchr_inline(const char *str, int c) { return (char*)strchr(str, c); }
   505 SDL_FORCE_INLINE char *SDL_strchr_inline(const char *str, int c) {
       
   506 #ifdef __cplusplus
       
   507 return const_cast<char*>(strchr(str, c));
       
   508 #else
       
   509 return (char*)strchr(str, c);
       
   510 #endif
       
   511 }
   506 #define SDL_strchr SDL_strchr_inline
   512 #define SDL_strchr SDL_strchr_inline
   507 #elif defined(HAVE_INDEX)  /* !!! FIXME: is there anywhere that has this but not strchr? */
   513 #elif defined(HAVE_INDEX)  /* !!! FIXME: is there anywhere that has this but not strchr? */
   508 SDL_FORCE_INLINE char *SDL_strchr_inline(const char *str, int c) { return index(str, c); }
   514 SDL_FORCE_INLINE char *SDL_strchr_inline(const char *str, int c) { return index(str, c); }
   509 #define SDL_strchr SDL_strchr_inline
   515 #define SDL_strchr SDL_strchr_inline
   510 #endif
   516 #endif
   530 #define SDL_strrchr SDL_strrchr_inline
   536 #define SDL_strrchr SDL_strrchr_inline
   531 #endif
   537 #endif
   532 
   538 
   533 extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle);
   539 extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle);
   534 #ifdef HAVE_STRSTR
   540 #ifdef HAVE_STRSTR
   535 SDL_FORCE_INLINE char *SDL_strstr_inline(const char *haystack, const char *needle) { return (char*)strstr(haystack, needle); }
   541 SDL_FORCE_INLINE char *SDL_strstr_inline(const char *haystack, const char *needle) {
       
   542 #ifdef __cplusplus
       
   543 return const_cast<char*>(strstr(haystack, needle));
       
   544 #else
       
   545 return (char*)strstr(haystack, needle);
       
   546 #endif
       
   547 }
   536 #define SDL_strstr SDL_strstr_inline
   548 #define SDL_strstr SDL_strstr_inline
   537 #endif
   549 #endif
   538 
   550 
   539 extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix);
   551 extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix);
   540 #ifdef HAVE__LTOA
   552 #ifdef HAVE__LTOA