diff --git a/nsprpub/pr/include/md/_freebsd.h b/nsprpub/pr/include/md/_freebsd.h index de4cf99ee07..5be48dbced4 100644 --- a/nsprpub/pr/include/md/_freebsd.h +++ b/nsprpub/pr/include/md/_freebsd.h @@ -37,7 +37,9 @@ #include "prthread.h" -#include +#if __FreeBSD__ >= 2 +#include /* for __FreeBSD_version */ +#endif #include #define PR_LINKER_ARCH "freebsd" @@ -66,16 +68,23 @@ #define _PR_HAVE_SOCKADDR_LEN #define _PR_STAT_HAS_ST_ATIMESPEC #define _PR_NO_LARGE_FILES -#if ( __FreeBSD_version >= 220000 ) && ( __FreeBSD_version < 400008 ) -#if !defined(_PR_PTHREADS) + +#if defined(_PR_PTHREADS) +#if __FreeBSD_version >= 400008 /* - * libc_r doesn't have poll(). Although libc has poll(), it is not - * thread-safe so we can't use it in the pthreads version. + * libc_r before this version of FreeBSD doesn't have poll(). + * Although libc has poll(), it is not thread-safe so we can't + * use it in the pthreads version. */ #define _PR_POLL_AVAILABLE +#endif +#else +#if __FreeBSD_version >= 300000 +#define _PR_POLL_AVAILABLE #define _PR_USE_POLL #endif #endif + #define _PR_HAVE_SYSV_SEMAPHORES #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY