include string.h for FD_ZERO in sys/select.h

* sys/select.h was not self contained before, this fixes #9327
* index is defined as a function in string.h, fixed resulting name
  collision in glut_shapes.c
This commit is contained in:
Jérôme Duval
2012-12-28 18:30:03 +01:00
parent d917edcecd
commit 00e7904406
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -43,6 +43,9 @@ typedef struct fd_set {
#define _FD_BITSINDEX(fd) ((fd) / NFDBITS)
#define _FD_BIT(fd) (1L << ((fd) % NFDBITS))
// FD_ZERO uses memset
#include <string.h>
#define FD_ZERO(set) memset((set), 0, sizeof(fd_set))
#define FD_SET(fd, set) ((set)->bits[_FD_BITSINDEX(fd)] |= _FD_BIT(fd))
#define FD_CLR(fd, set) ((set)->bits[_FD_BITSINDEX(fd)] &= ~_FD_BIT(fd))