diff --git a/config.d/compiling.m4 b/config.d/compiling.m4 index 75f1fd13b..f9fa50942 100644 --- a/config.d/compiling.m4 +++ b/config.d/compiling.m4 @@ -56,7 +56,7 @@ if test "x$GCC" = xyes; then shift args="$*" AC_MSG_CHECKING(for gcc version) - CCVER="gcc `$CC --version | grep '[[0-9]]\.[[0-9]]' | sed -e 's/.*(GCC)//' -e 's/[[^0-9]]*\([[0-9.]]*\).*/\1/'`" + CCVER="gcc `$CC --version | grep '[[0-9]]\.[[0-9]]' | sed -e 's/.*([[^)]]*)//' -e 's/[[^0-9]]*\([[0-9.]]*\).*/\1/'`" set $CCVER save_IFS="$IFS" IFS="." @@ -341,7 +341,7 @@ if test "x$leave_cflags_alone" != xyes; then [[bool flag = true;]], [[return flag ? 1 : 0]])], [], - [QF_CC_OPTION_TEST(-std=gnu23,[],QF_CC_OPTION(-std=gnu2x))] + [QF_CC_OPTION_TEST(-std=gnu23,QF_CC_OPTION(-std=gnu23),QF_CC_OPTION(-std=gnu2x))] ) fi AC_MSG_CHECKING([for c23]) diff --git a/config.d/header_files.m4 b/config.d/header_files.m4 index 93513dc8c..c8133457d 100644 --- a/config.d/header_files.m4 +++ b/config.d/header_files.m4 @@ -37,16 +37,16 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "fnmatch.h"]], [[int (*foo)() = fn ]) AC_MSG_CHECKING(for strnlen in string.h) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "string.h"]], [[int (*foo)() = strnlen;]])],[AC_DEFINE(HAVE_STRNLEN_PROTO, 1, Define this if strnlen is prototyped in string.h) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "string.h"]], [[size_t (*foo)(const char *, size_t) = strnlen;]])],[AC_DEFINE(HAVE_STRNLEN_PROTO, 1, Define this if strnlen is prototyped in string.h) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no) ]) AC_MSG_CHECKING(for strndup in string.h) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "string.h"]], [[int (*foo)() = strndup;]])],[AC_DEFINE(HAVE_STRNDUP_PROTO, 1, Define this if strndup is prototyped in string.h) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "string.h"]], [[char *(*foo)(const char *, size_t) = strndup;]])],[AC_DEFINE(HAVE_STRNDUP_PROTO, 1, Define this if strndup is prototyped in string.h) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no) ]) AC_MSG_CHECKING(for strcasestr in string.h) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "string.h"]], [[int (*foo)() = strcasestr;]])],[AC_DEFINE(HAVE_STRCASESTR_PROTO, 1, Define this if strcasestr is prototyped in string.h) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "string.h"]], [[char *(*foo)(const char *, const char *) = strcasestr;]])],[AC_DEFINE(HAVE_STRCASESTR_PROTO, 1, Define this if strcasestr is prototyped in string.h) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no) ]) diff --git a/include/compat.h b/include/compat.h index 07c871667..f1d608a50 100644 --- a/include/compat.h +++ b/include/compat.h @@ -96,7 +96,7 @@ size_t strnlen (const char *str, size_t len); #endif #ifdef HAVE_STRNDUP # ifndef HAVE_STRNDUP_PROTO -size_t strndup (const char *str, size_t len); +char *strndup (const char *str, size_t len); # endif #else # define strndup Q_strndup