Fix OS X 10.5 problem where FD_ISSET() argument isn't const
This commit is contained in:
@@ -218,6 +218,20 @@ int pipefd[2];
|
|||||||
AC_MSG_RESULT([yes])],
|
AC_MSG_RESULT([yes])],
|
||||||
[AC_MSG_RESULT([no])])
|
[AC_MSG_RESULT([no])])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether FD_ISSET() argument is const])
|
||||||
|
AC_LANG_PUSH(C++)
|
||||||
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/select.h>
|
||||||
|
class T {
|
||||||
|
public:
|
||||||
|
fd_set fds;
|
||||||
|
bool Fun( void ) const { return FD_ISSET( 0, &fds ); } };]],
|
||||||
|
[[T x; return x.Fun();]])],
|
||||||
|
[AC_DEFINE([FD_ISSET_IS_CONST], [1],
|
||||||
|
[Define if FD_ISSET() fd_set argument is const.])
|
||||||
|
AC_MSG_RESULT([yes])],
|
||||||
|
[AC_MSG_RESULT([no])])
|
||||||
|
AC_LANG_POP(C++)
|
||||||
|
|
||||||
AC_CHECK_DECLS([__builtin_bswap64, __builtin_ctz])
|
AC_CHECK_DECLS([__builtin_bswap64, __builtin_ctz])
|
||||||
|
|
||||||
AC_CHECK_DECL([mach_absolute_time],
|
AC_CHECK_DECL([mach_absolute_time],
|
||||||
|
|||||||
+8
-2
@@ -127,12 +127,18 @@ public:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool read( int fd ) const
|
bool read( int fd )
|
||||||
|
#if FD_ISSET_IS_CONST
|
||||||
|
const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
return FD_ISSET( fd, &read_fds );
|
return FD_ISSET( fd, &read_fds );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool error( int fd ) const
|
bool error( int fd )
|
||||||
|
#if FD_ISSET_IS_CONST
|
||||||
|
const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
return FD_ISSET( fd, &error_fds );
|
return FD_ISSET( fd, &error_fds );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user