mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-24 22:03:07 +00:00
detect false failure of strerror_r
See tikv/jemallocator#108. In a summary, test on `strerror_r` can fail due to reasons other than `strerror_r` itself, so add an additional test to determine the failure is expected. Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
This commit is contained in:
10
configure.ac
10
configure.ac
@@ -2835,9 +2835,19 @@ JE_COMPILABLE([strerror_r returns char with gnu source], [
|
|||||||
char *error = strerror_r(EINVAL, buffer, 100);
|
char *error = strerror_r(EINVAL, buffer, 100);
|
||||||
printf("%s\n", error);
|
printf("%s\n", error);
|
||||||
], [je_cv_strerror_r_returns_char_with_gnu_source])
|
], [je_cv_strerror_r_returns_char_with_gnu_source])
|
||||||
|
if test "x${je_cv_strerror_r_returns_char_with_gnu_source}" = "xno" ; then
|
||||||
|
JE_COMPILABLE([strerror_r header only], [
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
], [], [je_cv_strerror_r_header_pass])
|
||||||
|
fi
|
||||||
JE_CFLAGS_RESTORE()
|
JE_CFLAGS_RESTORE()
|
||||||
if test "x${je_cv_strerror_r_returns_char_with_gnu_source}" = "xyes" ; then
|
if test "x${je_cv_strerror_r_returns_char_with_gnu_source}" = "xyes" ; then
|
||||||
AC_DEFINE([JEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE], [ ], [ ])
|
AC_DEFINE([JEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE], [ ], [ ])
|
||||||
|
elif test "x${je_cv_strerror_r_header_pass}" = "xno" ; then
|
||||||
|
AC_MSG_ERROR([cannot determine return type of strerror_r])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl ============================================================================
|
dnl ============================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user