ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/selcall.h
Revision: 3.11
Committed: Sun Mar 6 01:13:17 2016 UTC (8 years, 2 months ago) by schorsch
Content type: text/plain
Branch: MAIN
CVS Tags: rad5R4, rad5R2, rad5R1, rad5R3, HEAD
Changes since 3.10: +3 -3 lines
Log Message:
Prepare for SCons build on Win32 and Win64

File Contents

# User Rev Content
1 schorsch 3.11 /* RCSid $Id: selcall.h,v 3.10 2003/07/14 22:23:59 schorsch 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 gregl 3.1
8 schorsch 3.9 #include <string.h>
9 gregl 3.1 #include <sys/types.h>
10 schorsch 3.11 #if defined(_WIN32) || defined(_WIN64)
11 schorsch 3.7 /*#include <winsock2.h>*/
12     #else
13     #include <sys/time.h>
14     #endif
15 gregl 3.1 #ifdef INCL_SEL_H
16     #include <sys/select.h>
17     #endif
18    
19     #ifndef FD_SETSIZE
20 schorsch 3.11 #if defined(_WIN32) || defined(_WIN64)
21 schorsch 3.7 #else
22     #include <sys/param.h>
23     #endif
24 gregl 3.1 #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 gregl 3.2 #define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p)))
34 gregl 3.3 #endif
35 schorsch 3.6
36 schorsch 3.10 #ifdef __cplusplus
37     extern "C" {
38     #endif
39    
40     /* nothing yet */
41 schorsch 3.6
42     #ifdef __cplusplus
43     }
44     #endif
45     #endif /* _RAD_SELCALL_H_ */