mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:51:53 +03:00
lib: use Curl_str_* instead of strtok_r()
Helps avoid extra mallocs. Gets rid of the private strtok_r implementation. Closes #16360
This commit is contained in:
parent
076444ec46
commit
676de7f580
26 changed files with 102 additions and 397 deletions
|
|
@ -184,40 +184,6 @@ AC_DEFUN([CURL_CHECK_NEED_REENTRANT_STRERROR_R], [
|
|||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_NEED_REENTRANT_STRTOK_R
|
||||
dnl -------------------------------------------------
|
||||
dnl Checks if the preprocessor _REENTRANT definition
|
||||
dnl makes function strtok_r compiler visible.
|
||||
|
||||
AC_DEFUN([CURL_CHECK_NEED_REENTRANT_STRTOK_R], [
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_FUNC_LINK_TRY([strtok_r])
|
||||
],[
|
||||
tmp_strtok_r="yes"
|
||||
],[
|
||||
tmp_strtok_r="no"
|
||||
])
|
||||
if test "$tmp_strtok_r" = "yes"; then
|
||||
AC_EGREP_CPP([strtok_r],[
|
||||
#include <sys/types.h>
|
||||
#include <string.h>
|
||||
],[
|
||||
tmp_strtok_r="proto_declared"
|
||||
],[
|
||||
AC_EGREP_CPP([strtok_r],[
|
||||
#define _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <string.h>
|
||||
],[
|
||||
tmp_strtok_r="proto_needs_reentrant"
|
||||
tmp_need_reentrant="yes"
|
||||
])
|
||||
])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl CURL_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R
|
||||
dnl -------------------------------------------------
|
||||
dnl Checks if the preprocessor _REENTRANT definition
|
||||
|
|
@ -300,9 +266,6 @@ AC_DEFUN([CURL_CHECK_NEED_REENTRANT_FUNCTIONS_R], [
|
|||
if test "$tmp_need_reentrant" = "no"; then
|
||||
CURL_CHECK_NEED_REENTRANT_STRERROR_R
|
||||
fi
|
||||
if test "$tmp_need_reentrant" = "no"; then
|
||||
CURL_CHECK_NEED_REENTRANT_STRTOK_R
|
||||
fi
|
||||
if test "$tmp_need_reentrant" = "no"; then
|
||||
CURL_CHECK_NEED_REENTRANT_GETHOSTBYNAME_R
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue