FreeWRL/FreeX3D  3.0.0
system.h
1 /*********************************************************************
2  *
3  * FreeWRL plugin
4  *
5  *********************************************************************/
6 
7 /****************************************************************************
8  This file is part of the FreeWRL/FreeX3D Distribution.
9 
10  Copyright 2009 CRC Canada. (http://www.crc.gc.ca)
11 
12  FreeWRL/FreeX3D is free software: you can redistribute it and/or modify
13  it under the terms of the GNU Lesser Public License as published by
14  the Free Software Foundation, either version 3 of the License, or
15  (at your option) any later version.
16 
17  FreeWRL/FreeX3D is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  GNU General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with FreeWRL/FreeX3D. If not, see <http://www.gnu.org/licenses/>.
24 ****************************************************************************/
25 
26 
27 
28 #ifndef __FREEWRL_PLUGIN_SYSTEM_H__
29 #define __FREEWRL_PLUGIN_SYSTEM_H__
30 
31 
32 #if STDC_HEADERS
33 # include <stdio.h>
34 # include <stdlib.h>
35 # include <string.h>
36 #else
37 # if !HAVE_STRCHR
38 # define strchr index
39 # define strrchr rindex
40 # endif
41 char *strchr (), *strrchr ();
42 # if !HAVE_MEMCPY
43 # define memcpy(d, s, n) bcopy ((s), (d), (n))
44 # define memmove(d, s, n) bcopy ((s), (d), (n))
45 # endif
46 #endif
47 
48 #if HAVE_STDINT_H
49 # include <stdint.h>
50 #endif
51 
52 #if HAVE_STDBOOL_H
53 # include <stdbool.h>
54 #else
55 # if ! HAVE__BOOL
56 # ifdef __cplusplus
57 typedef bool _Bool;
58 # else
59 typedef unsigned char _Bool;
60 # endif
61 # endif
62 # define bool _Bool
63 # define false 0
64 # define true 1
65 # define __bool_true_false_are_defined 1
66 #endif
67 
68 #define BOOL _Bool
69 #define TRUE 1
70 #define FALSE 0
71 
72 #if HAVE_UNISTD_H
73 # include <sys/types.h>
74 # include <unistd.h>
75 #endif
76 
77 #if HAVE_ERRNO_H
78 # include <errno.h>
79 #endif
80 
81 #if HAVE_TIME_H
82 # include <time.h>
83 #endif
84 
85 #if HAVE_SYS_TIME_H
86 # include <sys/time.h>
87 #endif
88 
89 #if HAVE_SYS_WAIT_H
90 # include <sys/wait.h>
91 #endif
92 #ifndef WEXITSTATUS
93 # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
94 #endif
95 #ifndef WIFEXITED
96 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
97 #endif
98 
99 #if HAVE_FCNTL_H
100 # include <fcntl.h>
101 #endif
102 
103 #if HAVE_SYS_IPC_H
104 # include <sys/ipc.h>
105 #endif
106 
107 #if HAVE_SYS_SOCKET_H
108 # include <sys/socket.h>
109 #endif
110 
111 #ifndef HAVE_INT32
112 # define int32 int32_t
113 #endif
114 #ifndef HAVE_UINT32
115 # define uint32 uint32_t
116 #endif
117 #ifndef HAVE_INT16
118 # define int16 int16_t
119 #endif
120 #ifndef HAVE_UINT16
121 # define uint16 uint16_t
122 #endif
123 
124 #endif /* __FREEWRL_PLUGIN_SYSTEM_H__ */