ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/selcall.h
Revision: 3.10
Committed: Mon Jul 14 22:23:59 2003 UTC (20 years, 8 months ago) by schorsch
Content type: text/plain
Branch: MAIN
CVS Tags: rad4R2P2, rad5R0, rad3R7P2, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R6, rad3R6P1, rad3R8, rad3R9, rad4R2P1
Changes since 3.9: +6 -4 lines
Log Message:
Instrumented headers against multiple inclusion and for use from C++.
Moved includes in headers out of "C" scope.

File Contents

# Content
1 /* RCSid $Id: selcall.h,v 3.9 2003/06/30 14:59:11 schorsch Exp $ */
2 /*
3 * header file for select call compatibility
4 */
5 #ifndef _RAD_SELCALL_H_
6 #define _RAD_SELCALL_H_
7
8 #include <string.h>
9 #include <sys/types.h>
10 #ifdef _WIN32
11 /*#include <winsock2.h>*/
12 #else
13 #include <sys/time.h>
14 #endif
15 #ifdef INCL_SEL_H
16 #include <sys/select.h>
17 #endif
18
19 #ifndef FD_SETSIZE
20 #ifdef _WIN32
21 #else
22 #include <sys/param.h>
23 #endif
24 #define FD_SETSIZE NOFILE /* maximum # select file descriptors */
25 #endif
26 #ifndef FD_SET
27 #ifndef NFDBITS
28 #define NFDBITS (8*sizeof(int)) /* number of bits per fd_mask */
29 #endif
30 #define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
31 #define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
32 #define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
33 #define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p)))
34 #endif
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 /* nothing yet */
41
42 #ifdef __cplusplus
43 }
44 #endif
45 #endif /* _RAD_SELCALL_H_ */