Fix FreeBSD compilation (#1184)

This commit is contained in:
Cacodemon345 2020-09-21 00:47:05 +06:00 committed by GitHub
parent 8a4b686881
commit 4374b8017e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -43,7 +43,11 @@
#elif defined(__solaris__) || defined(__OpenBSD__) || defined(__DragonFly__)
#define _msize(p) (*((size_t*)(p)-1))
#elif !defined(_WIN32)
#ifdef __FreeBSD__
#include <malloc_np.h>
#else
#include <malloc.h>
#endif
#define _msize(p) malloc_usable_size(p) // from glibc/FreeBSD
#endif