Skip to content

Commit 738cc67

Browse files
committed
Fix compiling jemalloc with MSVC 2022
Signed-off-by: roblabla <[email protected]>
1 parent 52b27b4 commit 738cc67

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

jemalloc-sys/configure/configure

+20-5
Original file line numberDiff line numberDiff line change
@@ -8615,7 +8615,21 @@ _ACEOF
86158615

86168616

86178617

8618-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing log" >&5
8618+
8619+
# On MSVC, log is an intrinsic that doesn't require libm. However,
8620+
# AC_SEARCH_LIBS does not successfully detect this, as it will try to compile
8621+
# a program using the wrong signature for log. Newer versions of MSVC CL detects
8622+
# this and rejects the program with the following messages.
8623+
#
8624+
# conftest.c(40): warning C4391: 'char log()': incorrect return type for intrinsic function, expected 'double'
8625+
# conftest.c(44): error C2168: 'log': too few actual parameters for intrinsic function
8626+
#
8627+
# Since log is always available on MSVC (it's been around since the dawn of
8628+
# time), we simply always assume it's there if MSVC is detected.
8629+
if test "x$je_cv_msvc" = "xyes" ; then
8630+
LM=
8631+
else
8632+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing log" >&5
86198633
$as_echo_n "checking for library containing log... " >&6; }
86208634
if ${ac_cv_search_log+:} false; then :
86218635
$as_echo_n "(cached) " >&6
@@ -8673,10 +8687,11 @@ else
86738687
as_fn_error $? "Missing math functions" "$LINENO" 5
86748688
fi
86758689

8676-
if test "x$ac_cv_search_log" != "xnone required" ; then
8677-
LM="$ac_cv_search_log"
8678-
else
8679-
LM=
8690+
if test "x$ac_cv_search_log" != "xnone required" ; then
8691+
LM="$ac_cv_search_log"
8692+
else
8693+
LM=
8694+
fi
86808695
fi
86818696

86828697

jemalloc-sys/jemalloc

0 commit comments

Comments
 (0)