include/SDL_stdinc.h
changeset 7059 cd194e03c1da
parent 7057 c1563f514b5b
child 7076 1666f7a7494e
child 8460 f483e8bdae3c
--- a/include/SDL_stdinc.h	Fri Apr 05 16:34:59 2013 -0400
+++ b/include/SDL_stdinc.h	Mon Apr 08 18:37:50 2013 -0400
@@ -502,7 +502,13 @@
 
 extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c);
 #ifdef HAVE_STRCHR
-SDL_FORCE_INLINE char *SDL_strchr_inline(const char *str, int c) { return (char*)strchr(str, c); }
+SDL_FORCE_INLINE char *SDL_strchr_inline(const char *str, int c) {
+#ifdef __cplusplus
+return const_cast<char*>(strchr(str, c));
+#else
+return (char*)strchr(str, c);
+#endif
+}
 #define SDL_strchr SDL_strchr_inline
 #elif defined(HAVE_INDEX)  /* !!! FIXME: is there anywhere that has this but not strchr? */
 SDL_FORCE_INLINE char *SDL_strchr_inline(const char *str, int c) { return index(str, c); }
@@ -532,7 +538,13 @@
 
 extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle);
 #ifdef HAVE_STRSTR
-SDL_FORCE_INLINE char *SDL_strstr_inline(const char *haystack, const char *needle) { return (char*)strstr(haystack, needle); }
+SDL_FORCE_INLINE char *SDL_strstr_inline(const char *haystack, const char *needle) {
+#ifdef __cplusplus
+return const_cast<char*>(strstr(haystack, needle));
+#else
+return (char*)strstr(haystack, needle);
+#endif
+}
 #define SDL_strstr SDL_strstr_inline
 #endif