Index: lib/sanitizer_common/sanitizer_platform_limits_posix.cc =================================================================== --- lib/sanitizer_common/sanitizer_platform_limits_posix.cc +++ lib/sanitizer_common/sanitizer_platform_limits_posix.cc @@ -16,6 +16,16 @@ #include "sanitizer_platform.h" #if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_MAC +#if SANITIZER_FREEBSD +# include +# if __FreeBSD_version <= 1000707 || \ + (__FreeBSD_version >= 1100000 && __FreeBSD_version <= 1100013) +# define SANITIZER_FREEBSD_RTENTRY 1 +# else +# define SANITIZER_FREEBSD_RTENTRY 0 +# endif +#endif + #include #include #include @@ -23,7 +33,14 @@ #include #include #include +#if SANITIZER_FREEBSD_RTENTRY +#define _WANT_RTENTRY // to declare 'rtentry' structure +#include +#endif #include +#if SANITIZER_FREEBSD_RTENTRY +#undef _WANT_RTENTRY +#endif #include #include #include @@ -358,7 +375,9 @@ unsigned struct_midi_info_sz = sizeof(struct midi_info); unsigned struct_mtget_sz = sizeof(struct mtget); unsigned struct_mtop_sz = sizeof(struct mtop); +#if SANITIZER_FREEBSD && SANITIZER_FREEBSD_RTENTRY unsigned struct_rtentry_sz = sizeof(struct rtentry); +#endif unsigned struct_sbi_instrument_sz = sizeof(struct sbi_instrument); unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec); unsigned struct_synth_info_sz = sizeof(struct synth_info); @@ -639,8 +658,10 @@ #if SANITIZER_LINUX || SANITIZER_FREEBSD unsigned IOCTL_MTIOCGET = MTIOCGET; unsigned IOCTL_MTIOCTOP = MTIOCTOP; +#if SANITIZER_FREEBSD_RTENTRY unsigned IOCTL_SIOCADDRT = SIOCADDRT; unsigned IOCTL_SIOCDELRT = SIOCDELRT; +#endif unsigned IOCTL_SNDCTL_DSP_GETBLKSIZE = SNDCTL_DSP_GETBLKSIZE; unsigned IOCTL_SNDCTL_DSP_GETFMTS = SNDCTL_DSP_GETFMTS; unsigned IOCTL_SNDCTL_DSP_NONBLOCK = SNDCTL_DSP_NONBLOCK;