bpo-28667: Fix a compile warning on FreeBSD when compare with FD_SETSIZE. (#501) (#3190)

FreeBSD is the only platforms with unsigned FD_SETSIZE.

(cherry picked from commit 783d0c1a1c)
This commit is contained in:
Victor Stinner 2017-08-23 00:58:43 +02:00 committed by GitHub
parent 8e572491b5
commit cb7fdf69ec
2 changed files with 5 additions and 5 deletions

View file

@ -39,7 +39,7 @@ PyAPI_DATA(PyTypeObject) PyStdPrinter_Type;
/* A routine to check if a file descriptor can be select()-ed. */
#ifdef HAVE_SELECT
#define _PyIsSelectable_fd(FD) (((FD) >= 0) && ((FD) < FD_SETSIZE))
#define _PyIsSelectable_fd(FD) ((unsigned int)(FD) < (unsigned int)FD_SETSIZE)
#else
#define _PyIsSelectable_fd(FD) (1)
#endif /* HAVE_SELECT */