ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/selcall.h
Revision: 3.9
Committed: Mon Jun 30 14:59:11 2003 UTC (20 years, 10 months ago) by schorsch
Content type: text/plain
Branch: MAIN
Changes since 3.8: +2 -5 lines
Log Message:
Replaced most outdated BSD function calls with their posix equivalents, and cleaned up a few other platform dependencies.

File Contents

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