Skip to content

Commit

Permalink
Fix compiling jemalloc with MSVC 2022
Browse files Browse the repository at this point in the history
  • Loading branch information
roblabla committed Sep 23, 2024
1 parent d2461b3 commit 5bd1578
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
25 changes: 20 additions & 5 deletions jemalloc-sys/configure/configure
Original file line number Diff line number Diff line change
Expand Up @@ -8615,7 +8615,21 @@ _ACEOF



{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing log" >&5

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

if test "x$ac_cv_search_log" != "xnone required" ; then
LM="$ac_cv_search_log"
else
LM=
if test "x$ac_cv_search_log" != "xnone required" ; then
LM="$ac_cv_search_log"
else
LM=
fi
fi


Expand Down
2 changes: 1 addition & 1 deletion jemalloc-sys/jemalloc
Submodule jemalloc updated 1 files
+19 −4 configure.ac

0 comments on commit 5bd1578

Please sign in to comment.