Skip to content

Commit

Permalink
added SDL_strtokr() as a replacement for POSIX strtok_r (bug #4046.)
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Nov 20, 2019
1 parent ce8411c commit eb8f14b
Show file tree
Hide file tree
Showing 28 changed files with 161 additions and 7 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -763,7 +763,7 @@ if(LIBC)
wcslen wcscmp
strlen _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa
_ultoa strtol strtoul strtoll strtod atoi atof strcmp strncmp
_stricmp _strnicmp sscanf
_stricmp _strnicmp strtok_s sscanf
acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf
copysign copysignf cos cosf exp expf fabs fabsf floor floorf fmod fmodf
log logf log10 log10f pow powf scalbn scalbnf sin sinf sqrt sqrtf tan tanf)
Expand Down Expand Up @@ -797,7 +797,7 @@ if(LIBC)
foreach(_FN
strtod malloc calloc realloc free getenv setenv putenv unsetenv
qsort abs bcopy memset memcpy memmove memcmp strlen strlcpy strlcat
_strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa
_strrev _strupr _strlwr strchr strrchr strstr strtok_r itoa _ltoa
_uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull
atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp
vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp
Expand Down
4 changes: 2 additions & 2 deletions Makefile.os2
@@ -1,4 +1,4 @@
# Open Watcom makefile to build SDL2.dll for OS/2:
# Open Watcom makefile to build SDL2.dll for OS/2
# wmake -f Makefile.os2

LIBNAME = SDL2
Expand Down Expand Up @@ -33,7 +33,7 @@ MSRCS= e_atan2.c e_exp.c e_fmod.c e_log10.c e_log.c e_pow.c e_rem_pio2.c e_sqrt.
s_atan.c s_copysign.c s_cos.c s_fabs.c s_floor.c s_scalbn.c s_sin.c s_tan.c

SRCS = SDL.c SDL_assert.c SDL_error.c SDL_log.c SDL_dataqueue.c SDL_hints.c
SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_qsort.c SDL_stdlib.c SDL_string.c
SRCS+= SDL_getenv.c SDL_iconv.c SDL_malloc.c SDL_qsort.c SDL_stdlib.c SDL_string.c SDL_strtokr.c
SRCS+= SDL_cpuinfo.c SDL_atomic.c SDL_spinlock.c SDL_thread.c SDL_timer.c
SRCS+= SDL_rwops.c SDL_power.c
SRCS+= SDL_audio.c SDL_audiocvt.c SDL_audiodev.c SDL_audiotypecvt.c SDL_mixer.c SDL_wave.c
Expand Down
3 changes: 2 additions & 1 deletion Makefile.psp
Expand Up @@ -50,6 +50,7 @@ OBJS= src/SDL.o \
src/stdlib/SDL_qsort.o \
src/stdlib/SDL_stdlib.o \
src/stdlib/SDL_string.o \
src/stdlib/SDL_strtokr.o \
src/thread/SDL_thread.o \
src/thread/generic/SDL_systls.o \
src/thread/psp/SDL_syssem.o \
Expand Down Expand Up @@ -78,7 +79,7 @@ OBJS= src/SDL.o \
src/video/psp/SDL_pspevents.o \
src/video/psp/SDL_pspvideo.o \
src/video/psp/SDL_pspgl.o \
src/video/psp/SDL_pspmouse.o \
src/video/psp/SDL_pspmouse.o

INCDIR = ./include
CFLAGS = -g -O2 -G0 -Wall -D__PSP__ -DHAVE_OPENGL
Expand Down
1 change: 1 addition & 0 deletions VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj
Expand Up @@ -285,6 +285,7 @@
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c" />
<ClCompile Include="..\..\src\thread\generic\SDL_syssem.c" />
<ClCompile Include="..\..\src\thread\SDL_thread.c" />
<ClCompile Include="..\..\src\thread\stdcpp\SDL_syscond.cpp" />
Expand Down
3 changes: 3 additions & 0 deletions VisualC-WinRT/UWP_VS2015/SDL-UWP.vcxproj.filters
Expand Up @@ -626,6 +626,9 @@
<ClCompile Include="..\..\src\stdlib\SDL_string.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\thread\generic\SDL_syssem.c">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down
1 change: 1 addition & 0 deletions VisualC-WinRT/WinPhone81_VS2013/SDL-WinPhone81.vcxproj
Expand Up @@ -251,6 +251,7 @@
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c" />
<ClCompile Include="..\..\src\thread\generic\SDL_syscond.c" />
<ClCompile Include="..\..\src\thread\SDL_thread.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_sysmutex.c" />
Expand Down
Expand Up @@ -593,6 +593,9 @@
<ClCompile Include="..\..\src\stdlib\SDL_string.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\thread\SDL_thread.c">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down
1 change: 1 addition & 0 deletions VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj
Expand Up @@ -283,6 +283,7 @@
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c" />
<ClCompile Include="..\..\src\thread\generic\SDL_syscond.c" />
<ClCompile Include="..\..\src\thread\SDL_thread.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_sysmutex.c" />
Expand Down
3 changes: 3 additions & 0 deletions VisualC-WinRT/WinRT81_VS2013/SDL-WinRT81.vcxproj.filters
Expand Up @@ -611,6 +611,9 @@
<ClCompile Include="..\..\src\stdlib\SDL_string.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\src\thread\SDL_thread.c">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down
1 change: 1 addition & 0 deletions VisualC/SDL/SDL.vcxproj
Expand Up @@ -484,6 +484,7 @@
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c" />
<ClCompile Include="..\..\src\thread\generic\SDL_syscond.c" />
<ClCompile Include="..\..\src\thread\SDL_thread.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_sysmutex.c" />
Expand Down
1 change: 1 addition & 0 deletions VisualC/SDL/SDL.vcxproj.filters
Expand Up @@ -426,6 +426,7 @@
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c" />
<ClCompile Include="..\..\src\thread\generic\SDL_syscond.c" />
<ClCompile Include="..\..\src\thread\SDL_thread.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_sysmutex.c" />
Expand Down
10 changes: 10 additions & 0 deletions Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
Expand Up @@ -355,6 +355,10 @@
56ED04E1118A8EE200A56AA6 /* SDL_power.c in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E0118A8EE200A56AA6 /* SDL_power.c */; };
56ED04E3118A8EFD00A56AA6 /* SDL_syspower.m in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */; };
56F9D5601DF73BA400C15B5D /* SDL_dataqueue.c in Sources */ = {isa = PBXBuildFile; fileRef = 566726431DF72CF5001DD3DB /* SDL_dataqueue.c */; };
63CC93C723849391002A5C54 /* SDL_strtokr.c in Sources */ = {isa = PBXBuildFile; fileRef = 63CC93C623849391002A5C54 /* SDL_strtokr.c */; };
63CC93C823849391002A5C54 /* SDL_strtokr.c in Sources */ = {isa = PBXBuildFile; fileRef = 63CC93C623849391002A5C54 /* SDL_strtokr.c */; };
63CC93C923849391002A5C54 /* SDL_strtokr.c in Sources */ = {isa = PBXBuildFile; fileRef = 63CC93C623849391002A5C54 /* SDL_strtokr.c */; };
63CC93CA23849391002A5C54 /* SDL_strtokr.c in Sources */ = {isa = PBXBuildFile; fileRef = 63CC93C623849391002A5C54 /* SDL_strtokr.c */; };
93CB792313FC5E5200BD3E05 /* SDL_uikitviewcontroller.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CB792213FC5E5200BD3E05 /* SDL_uikitviewcontroller.h */; };
93CB792613FC5F5300BD3E05 /* SDL_uikitviewcontroller.m in Sources */ = {isa = PBXBuildFile; fileRef = 93CB792513FC5F5300BD3E05 /* SDL_uikitviewcontroller.m */; };
A704172E20F7E74800A82227 /* controller_type.h in Headers */ = {isa = PBXBuildFile; fileRef = A704172D20F7E74800A82227 /* controller_type.h */; };
Expand Down Expand Up @@ -963,6 +967,7 @@
56EA86FA13E9EC2B002E47EB /* SDL_coreaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_coreaudio.h; sourceTree = "<group>"; };
56ED04E0118A8EE200A56AA6 /* SDL_power.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_power.c; sourceTree = "<group>"; };
56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_syspower.m; sourceTree = "<group>"; };
63CC93C623849391002A5C54 /* SDL_strtokr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_strtokr.c; sourceTree = "<group>"; };
93CB792213FC5E5200BD3E05 /* SDL_uikitviewcontroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_uikitviewcontroller.h; sourceTree = "<group>"; };
93CB792513FC5F5300BD3E05 /* SDL_uikitviewcontroller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_uikitviewcontroller.m; sourceTree = "<group>"; };
A704172D20F7E74800A82227 /* controller_type.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = controller_type.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1491,6 +1496,7 @@
FD3F4A6F0DEA620800C5B771 /* stdlib */ = {
isa = PBXGroup;
children = (
63CC93C623849391002A5C54 /* SDL_strtokr.c */,
FD3F4A700DEA620800C5B771 /* SDL_getenv.c */,
FD3F4A710DEA620800C5B771 /* SDL_iconv.c */,
FD3F4A720DEA620800C5B771 /* SDL_malloc.c */,
Expand Down Expand Up @@ -2568,6 +2574,7 @@
52ED1E56222889500061FCE0 /* SDL_gamecontroller.c in Sources */,
52ED1E57222889500061FCE0 /* SDL_systls.c in Sources */,
52ED1E58222889500061FCE0 /* SDL_sysfilesystem.m in Sources */,
63CC93C823849391002A5C54 /* SDL_strtokr.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -2696,6 +2703,7 @@
F3E3C7452241389A007D243C /* SDL_gamecontroller.c in Sources */,
F3E3C7462241389A007D243C /* SDL_systls.c in Sources */,
F3E3C7472241389A007D243C /* SDL_sysfilesystem.m in Sources */,
63CC93CA23849391002A5C54 /* SDL_strtokr.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -2822,6 +2830,7 @@
FAB598BD1BB5C31600BE72C5 /* SDL_hints.c in Sources */,
FAB598BE1BB5C31600BE72C5 /* SDL_log.c in Sources */,
FAB598BF1BB5C31600BE72C5 /* SDL.c in Sources */,
63CC93C923849391002A5C54 /* SDL_strtokr.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -2942,6 +2951,7 @@
AA0AD06216647BBB00CE5896 /* SDL_gamecontroller.c in Sources */,
AA0F8495178D5F1A00823F9D /* SDL_systls.c in Sources */,
56C181E217C44D7A00406AE3 /* SDL_sysfilesystem.m in Sources */,
63CC93C723849391002A5C54 /* SDL_strtokr.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
8 changes: 8 additions & 0 deletions Xcode/SDL/SDL.xcodeproj/project.pbxproj
Expand Up @@ -456,6 +456,9 @@
5C2EF6FE1FC9EE65003F5197 /* SDL_egl.c in Sources */ = {isa = PBXBuildFile; fileRef = 5C2EF6F51FC9EE35003F5197 /* SDL_egl.c */; };
5C2EF6FF1FC9EE65003F5197 /* SDL_rect_c.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C2EF6F41FC9EE34003F5197 /* SDL_rect_c.h */; };
5C2EF7011FC9EF10003F5197 /* SDL_egl.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C2EF7001FC9EF0F003F5197 /* SDL_egl.h */; };
63994BE7238492D000F9C268 /* SDL_strtokr.c in Sources */ = {isa = PBXBuildFile; fileRef = 63994BE6238492D000F9C268 /* SDL_strtokr.c */; };
63994BE8238492D000F9C268 /* SDL_strtokr.c in Sources */ = {isa = PBXBuildFile; fileRef = 63994BE6238492D000F9C268 /* SDL_strtokr.c */; };
63994BE9238492D000F9C268 /* SDL_strtokr.c in Sources */ = {isa = PBXBuildFile; fileRef = 63994BE6238492D000F9C268 /* SDL_strtokr.c */; };
A704170920F09A9800A82227 /* hid.c in Sources */ = {isa = PBXBuildFile; fileRef = A704170820F09A9800A82227 /* hid.c */; };
A704170A20F09A9800A82227 /* hid.c in Sources */ = {isa = PBXBuildFile; fileRef = A704170820F09A9800A82227 /* hid.c */; };
A704170B20F09A9800A82227 /* hid.c in Sources */ = {isa = PBXBuildFile; fileRef = A704170820F09A9800A82227 /* hid.c */; };
Expand Down Expand Up @@ -1152,6 +1155,7 @@
5C2EF6F51FC9EE35003F5197 /* SDL_egl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_egl.c; sourceTree = "<group>"; };
5C2EF6F61FC9EE35003F5197 /* SDL_egl_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_egl_c.h; sourceTree = "<group>"; };
5C2EF7001FC9EF0F003F5197 /* SDL_egl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_egl.h; sourceTree = "<group>"; };
63994BE6238492D000F9C268 /* SDL_strtokr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_strtokr.c; sourceTree = "<group>"; };
A704170820F09A9800A82227 /* hid.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hid.c; sourceTree = "<group>"; };
A704170D20F09AC800A82227 /* SDL_hidapijoystick.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapijoystick.c; sourceTree = "<group>"; };
A704170E20F09AC800A82227 /* SDL_hidapijoystick_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_hidapijoystick_c.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1636,6 +1640,7 @@
04BDFE5D12E6671700899322 /* stdlib */ = {
isa = PBXGroup;
children = (
63994BE6238492D000F9C268 /* SDL_strtokr.c */,
04BDFE5E12E6671700899322 /* SDL_getenv.c */,
04BDFE5F12E6671700899322 /* SDL_iconv.c */,
04BDFE6012E6671700899322 /* SDL_malloc.c */,
Expand Down Expand Up @@ -2812,6 +2817,7 @@
AA0F8491178D5ECC00823F9D /* SDL_systls.c in Sources */,
D55A1B82179F262300625D7C /* SDL_cocoamousetap.m in Sources */,
567E2F1C17C44BB2005F1892 /* SDL_sysfilesystem.m in Sources */,
63994BE7238492D000F9C268 /* SDL_strtokr.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -2950,6 +2956,7 @@
AA0F8492178D5ECC00823F9D /* SDL_systls.c in Sources */,
D55A1B84179F263600625D7C /* SDL_cocoamousetap.m in Sources */,
DB0F490817CA5292008798C5 /* SDL_sysfilesystem.m in Sources */,
63994BE8238492D000F9C268 /* SDL_strtokr.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -3088,6 +3095,7 @@
AA0F8493178D5ECC00823F9D /* SDL_systls.c in Sources */,
D55A1B83179F263500625D7C /* SDL_cocoamousetap.m in Sources */,
DB0F490A17CA5293008798C5 /* SDL_sysfilesystem.m in Sources */,
63994BE9238492D000F9C268 /* SDL_strtokr.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
2 changes: 1 addition & 1 deletion configure
Expand Up @@ -16978,7 +16978,7 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi

for ac_func in malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove wcslen wcscmp strlen strlcpy strlcat _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval poll _Exit
for ac_func in malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove wcslen wcscmp strlen strlcpy strlcat _strrev _strupr _strlwr strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval poll _Exit
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -335,7 +335,7 @@ if test x$enable_libc = xyes; then
AC_DEFINE(HAVE_MPROTECT, 1, [ ])
]),
)
AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove wcslen wcscmp strlen strlcpy strlcat _strrev _strupr _strlwr strchr strrchr strstr itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval poll _Exit)
AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv qsort abs bcopy memset memcpy memmove wcslen wcscmp strlen strlcpy strlcat _strrev _strupr _strlwr strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval poll _Exit)

AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
AC_CHECK_FUNCS(acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf copysign copysignf cos cosf exp expf fabs fabsf floor floorf fmod fmodf log logf log10 log10f pow powf scalbn scalbnf sin sinf sqrt sqrtf tan tanf)
Expand Down
2 changes: 2 additions & 0 deletions include/SDL_config.h.cmake
Expand Up @@ -108,6 +108,8 @@
#cmakedefine HAVE_STRCHR 1
#cmakedefine HAVE_STRRCHR 1
#cmakedefine HAVE_STRSTR 1
#cmakedefine HAVE_STRTOK_R 1
#cmakedefine HAVE_STRTOK_S 1
#cmakedefine HAVE_ITOA 1
#cmakedefine HAVE__LTOA 1
#cmakedefine HAVE__UITOA 1
Expand Down
2 changes: 2 additions & 0 deletions include/SDL_config.h.in
Expand Up @@ -111,6 +111,8 @@
#undef HAVE_STRCHR
#undef HAVE_STRRCHR
#undef HAVE_STRSTR
#undef HAVE_STRTOK_R
#undef HAVE_STRTOK_S
#undef HAVE_ITOA
#undef HAVE__LTOA
#undef HAVE__UITOA
Expand Down
1 change: 1 addition & 0 deletions include/SDL_config_android.h
Expand Up @@ -71,6 +71,7 @@
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOK_R 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
Expand Down
1 change: 1 addition & 0 deletions include/SDL_config_iphoneos.h
Expand Up @@ -71,6 +71,7 @@
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOK_R 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
Expand Down
1 change: 1 addition & 0 deletions include/SDL_config_macosx.h
Expand Up @@ -74,6 +74,7 @@
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOK_R 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
Expand Down
1 change: 1 addition & 0 deletions include/SDL_config_os2.h
Expand Up @@ -110,6 +110,7 @@
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
/* #undef HAVE_STRTOK_R */
#define HAVE_ITOA 1
#define HAVE__LTOA 1
#define HAVE__ULTOA 1
Expand Down
4 changes: 4 additions & 0 deletions include/SDL_config_windows.h
Expand Up @@ -117,6 +117,10 @@ typedef unsigned int uintptr_t;
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
/* #undef HAVE_STRTOK_R */
#if defined(_MSC_VER)
#define HAVE_STRTOK_S 1
#endif
/* These functions have security warnings, so we won't use them */
/* #undef HAVE__LTOA */
/* #undef HAVE__ULTOA */
Expand Down
1 change: 1 addition & 0 deletions include/SDL_config_winrt.h
Expand Up @@ -130,6 +130,7 @@ typedef unsigned int uintptr_t;
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOK_S 1
//#define HAVE_ITOA 1 // TODO, WinRT: consider using _itoa_s instead
//#define HAVE__LTOA 1 // TODO, WinRT: consider using _ltoa_s instead
//#define HAVE__ULTOA 1 // TODO, WinRT: consider using _ultoa_s instead
Expand Down
1 change: 1 addition & 0 deletions include/SDL_config_wiz.h
Expand Up @@ -67,6 +67,7 @@
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOK_R 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
Expand Down
2 changes: 2 additions & 0 deletions include/SDL_stdinc.h
Expand Up @@ -470,6 +470,7 @@ extern DECLSPEC char *SDLCALL SDL_strlwr(char *str);
extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c);
extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c);
extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle);
extern DECLSPEC char *SDLCALL SDL_strtokr(char *s1, const char *s2, char **saveptr);
extern DECLSPEC size_t SDLCALL SDL_utf8strlen(const char *str);

extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix);
Expand Down Expand Up @@ -584,6 +585,7 @@ extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode,
#define SDL_strchr strchr
#define SDL_strrchr strrchr
#define SDL_strstr strstr
#define SDL_strtokr strtok_r
#define SDL_strcmp strcmp
#define SDL_strncmp strncmp
#define SDL_strcasecmp strcasecmp
Expand Down
1 change: 1 addition & 0 deletions src/dynapi/SDL_dynapi_overrides.h
Expand Up @@ -728,3 +728,4 @@
#define SDL_Metal_DestroyView SDL_Metal_DestroyView_REAL
#define SDL_LockTextureToSurface SDL_LockTextureToSurface_REAL
#define SDL_HasARMSIMD SDL_HasARMSIMD_REAL
#define SDL_strtokr SDL_strtokr_REAL
1 change: 1 addition & 0 deletions src/dynapi/SDL_dynapi_procs.h
Expand Up @@ -784,3 +784,4 @@ SDL_DYNAPI_PROC(SDL_MetalView,SDL_Metal_CreateView,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_Metal_DestroyView,(SDL_MetalView a),(a),)
SDL_DYNAPI_PROC(int,SDL_LockTextureToSurface,(SDL_Texture *a, const SDL_Rect *b, SDL_Surface **c),(a,b,c),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_HasARMSIMD,(void),(),return)
SDL_DYNAPI_PROC(char*,SDL_strtokr,(char *a, const char *b, char **c),(a,b,c),return)

0 comments on commit eb8f14b

Please sign in to comment.