From 215a7da2a6584295ff9bfaa5e0c4de051d831d2c Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 22 Nov 2013 00:05:34 +0000 Subject: [PATCH] * gc.c: fix build failure on FreeBSD introduced by r43763. malloc_usable_size() is defined by malloc_np.h on FreeBSD. * configure.in: check malloc.h and malloc_np.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ configure.in | 2 ++ gc.c | 6 +++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3053e6d251..57394d6afe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Fri Nov 22 09:03:16 2013 NARUSE, Yui + + * gc.c: fix build failure on FreeBSD introduced by r43763. + malloc_usable_size() is defined by malloc_np.h on FreeBSD. + + * configure.in: check malloc.h and malloc_np.h. + Fri Nov 22 08:27:13 2013 Eric Hodel * lib/rubygems: Update to RubyGems master 50a8210. Important changes diff --git a/configure.in b/configure.in index 923843fe6f..5d86e14bd0 100644 --- a/configure.in +++ b/configure.in @@ -1091,6 +1091,8 @@ AC_CHECK_HEADERS( \ process.h \ sys/prctl.h \ atomic.h \ + malloc.h \ + malloc_np.h \ setjmpex.h ) diff --git a/gc.c b/gc.c index d34ff9c4de..0f111cdbf3 100644 --- a/gc.c +++ b/gc.c @@ -40,7 +40,11 @@ # define malloc_usable_size(a) _msize(a) # endif #else -# include +# ifdef HAVE_MALLOC_H +# include +# elif defined(HAVE_MALLOC_NP_H) +# include +# endif #endif #if /* is ASAN enabled? */ \