Improve configure tests for ffsl
In particular: - ffsl always returns int, not long, on FreeBSD, Linux, and OSX. - Mute compiler warnings about rv being unused (and the potential for compilers optimizing out the call completely) by dumping the value with printf(3). Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
This commit is contained in:
parent
6e6164ae15
commit
72c1e59fd2
@ -928,7 +928,7 @@ AC_CACHE_CHECK([STATIC_PAGE_SHIFT],
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
]],
|
]],
|
||||||
[[
|
[[
|
||||||
long result;
|
int result;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -947,7 +947,7 @@ AC_CACHE_CHECK([STATIC_PAGE_SHIFT],
|
|||||||
if (f == NULL) {
|
if (f == NULL) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
fprintf(f, "%u\n", result);
|
fprintf(f, "%d\n", result);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -1092,11 +1092,13 @@ dnl Check for ffsl(3), and fail if not found. This function exists on all
|
|||||||
dnl platforms that jemalloc currently has a chance of functioning on without
|
dnl platforms that jemalloc currently has a chance of functioning on without
|
||||||
dnl modification.
|
dnl modification.
|
||||||
JE_COMPILABLE([a program using ffsl], [
|
JE_COMPILABLE([a program using ffsl], [
|
||||||
|
#include <stdio.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
], [
|
], [
|
||||||
{
|
{
|
||||||
int rv = ffsl(0x08);
|
int rv = ffsl(0x08);
|
||||||
|
printf("%d\n", rv);
|
||||||
}
|
}
|
||||||
], [je_cv_function_ffsl])
|
], [je_cv_function_ffsl])
|
||||||
if test "x${je_cv_function_ffsl}" != "xyes" ; then
|
if test "x${je_cv_function_ffsl}" != "xyes" ; then
|
||||||
|
Loading…
Reference in New Issue
Block a user