forkfd: Fix build with uClibc <= 0.9.33

That version of uClibc has neither pipe2 nor eventfd.

There were two problems with our detection. First, it checked for glibc
incorrectly, so the comparison was always true as
	__GLIBC__ << 16 = 0x20000

Second, we needed to check for uClibc's version.

Task-number: QTBUG-47337
Change-Id: Ib306f8f647014b399b87ffff13f3023b7f8d6d4a
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
This commit is contained in:
Thiago Macieira 2015-07-21 09:12:40 -07:00
parent ce87d82d4a
commit 5cc734e0a3

View File

@ -44,11 +44,13 @@
#include <unistd.h>
#ifdef __linux__
# if (defined(__GLIBC__) && (__GLIBC__ << 16) + __GLIBC_MINOR__ >= 0x207) || defined(__BIONIC__)
# if defined(__BIONIC__) || (defined(__GLIBC__) && (__GLIBC__ << 8) + __GLIBC_MINOR__ >= 0x207 && \
(!defined(__UCLIBC__) || ((__UCLIBC_MAJOR__ << 16) + (__UCLIBC_MINOR__ << 8) + __UCLIBC_SUBLEVEL__ > 0x921)))
# include <sys/eventfd.h>
# define HAVE_EVENTFD 1
# endif
# if (defined(__GLIBC__) && (__GLIBC__ << 16) + __GLIBC_MINOR__ >= 0x209) || defined(__BIONIC__)
# if defined(__BIONIC__) || (defined(__GLIBC__) && (__GLIBC__ << 8) + __GLIBC_MINOR__ >= 0x209 && \
(!defined(__UCLIBC__) || ((__UCLIBC_MAJOR__ << 16) + (__UCLIBC_MINOR__ << 8) + __UCLIBC_SUBLEVEL__ > 0x921)))
# define HAVE_PIPE2 1
# endif
#endif