diff --git a/include/libtorrent/buffer.hpp b/include/libtorrent/buffer.hpp index 9eb4b3fcc..2cd47238a 100644 --- a/include/libtorrent/buffer.hpp +++ b/include/libtorrent/buffer.hpp @@ -47,6 +47,8 @@ POSSIBILITY OF SUCH DAMAGE. #include #elif defined _MSC_VER #include +#elif defined __FreeBSD__ +#include #elif defined TORRENT_BSD #include #endif @@ -81,7 +83,7 @@ public: // the actual allocation may be larger than we requested. If so, let the // user take advantage of every single byte -#if defined __GLIBC__ +#if defined __GLIBC__ || defined __FreeBSD__ m_size = ::malloc_usable_size(m_begin); #elif defined _MSC_VER m_size = ::_msize(m_begin);