Commit aae92d27 authored by David Carlier's avatar David Carlier Committed by Facebook Github Bot

FreeBSD build fix proposal. (#1281)

Summary:
- __cxa_get_globals signature closer of the libcxxabi.
- malloc.h exists now on FreeBSD but prevents stdlib.h inclusion if __STDC__.
Pull Request resolved: https://github.com/facebook/folly/pull/1281

Reviewed By: Orvid

Differential Revision: D19140640

Pulled By: yfeldblum

fbshipit-source-id: 525014b5a367b8d8e95cf10e3e779cd7f0647bd5
parent 8aedb408
......@@ -28,7 +28,7 @@ struct __cxa_eh_globals;
extern "C" __cxa_eh_globals* __cxa_get_globals() noexcept;
#else
// Signature mismatch with FreeBSD case
extern "C" __cxa_eh_globals* __cxa_get_globals();
extern "C" __cxa_eh_globals* __cxa_get_globals(void);
#endif
} // namespace __cxxabiv1
#elif defined(FOLLY_FORCE_EXCEPTION_COUNT_USE_STD) || defined(_MSC_VER)
......
......@@ -45,9 +45,12 @@
// for malloc_usable_size
// NOTE: FreeBSD 9 doesn't have malloc.h. Its definitions
// are found in stdlib.h.
// However FreeBSD 11 and so does have it.
#if !defined(__FreeBSD__)
#if __has_include(<malloc.h>)
#include <malloc.h>
#endif
#endif
#include <cassert>
#include <cstddef>
......
......@@ -30,9 +30,11 @@
// malloc_usable_size, and that's what we should be using.
#include <jemalloc/jemalloc.h> // @manual
#else
#if !defined(__FreeBSD__)
#if __has_include(<malloc.h>)
#include <malloc.h>
#endif
#endif
#if defined(__APPLE__) && !defined(FOLLY_HAVE_MALLOC_USABLE_SIZE)
// MacOS doesn't have malloc_usable_size()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment