Codemesh Runtime v3 C++ API Reference  3.9.205
xmog-config.h
1 //
2 // Copyright (c) 1999-2020 by Codemesh, Inc.. ALL RIGHTS RESERVED.
3 //
4 
5 
6 
7 #ifndef XMOG_CONFIG_INC
8 #define XMOG_CONFIG_INC
9 
10 
11 #if defined(_AIX) || defined(__TOS_AIX__) || defined(__xlC__)
12 # define XMOG_AIX 1
13 # include "xmog-config-aix.h"
14 #else // AIX
15 # define XMOG_AIX 0
16 # endif // !AIX
17 
18 #if defined(hpux) || defined(__hpux) || defined(_HPUX_SOURCE)
19 # define XMOG_HPUX 1
20 # include "xmog-config-hpux.h"
21 #else // HPUX
22 # define XMOG_HPUX 0
23 # endif // !HPUX
24 
25 #if defined(__sgi) && defined(__mips)
26 # define XMOG_IRIX 1
27 # include "xmog-config-irix.h"
28 #else // IRIX
29 # define XMOG_IRIX 0
30 # endif // !IRIX
31 
32 #if defined(linux) || defined(__linux)
33 # define XMOG_LINUX 1
34 # include "xmog-config-linux.h"
35 #else // LINUX
36 # define XMOG_LINUX 0
37 # endif // !LINUX
38 
39 #if defined(__macos) || defined(DARWIN) || defined(__MACOSX__) || defined(__APPLE__)
40 # define XMOG_DARWIN 1
41 # include "xmog-config-darwin.h"
42 #else // DARWIN
43 # define XMOG_DARWIN 0
44 # endif // !DARWIN
45 
46 #if defined(sun) || defined(__sun__) || defined(__sun) || defined(__sunos) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
47 # define XMOG_SUNOS 1
48 # include "xmog-config-sunos.h"
49 #else // SUNOS
50 # define XMOG_SUNOS 0
51 # endif // !SUNOS
52 
53 #if defined(WIN32) || defined(WIN64) || defined(_WINDOWS) || defined(WINDOWS) || defined(_MSC_VER)
54 # define XMOG_WINDOWS 1
55 # include "xmog-config-windows.h"
56 #else // WINDOWS
57 # define XMOG_WINDOWS 0
58 #endif // !WINDOWS
59 
60 #if defined(__CYGWIN__)
61 # define XMOG_CYGWIN 1
62 # include "xmog-config-cygwin.h"
63 #else // CYGWIN
64 # define XMOG_CYGWIN 0
65 #endif // !CYGWIN
66 
67 #if defined(__MINGW32__)
68 # define XMOG_MINGW32 1
69 # include "xmog-config-windows-mingw.h"
70 #else // MINGW32
71 # define XMOG_MINGW32 0
72 #endif // !MINGW32
73 
74 // if we don't say that we want to use dummy JNI calls, we use real JNI
75 #if !defined(XMOG_DUMMY_JNI)
76 # define XMOG_DUMMY_JNI 0
77 #endif
78 
79 // if we don't say that we want to use external JNI definitions we don't
80 #if !defined(XMOG_USE_EXTERNAL_JNI_DEFINITIONS)
81 # define XMOG_USE_EXTERNAL_JNI_DEFINITIONS 0
82 #endif
83 
84 // if we don't say that we're not supporting JNI 1.1, we are supporting it
85 #if !defined(XMOG_SUPPORTS_JNI_11)
86 # define XMOG_SUPPORTS_JNI_11 1
87 #endif
88 
89 // if we don't say that we're building the runtime, we're not building the runtime
90 #if !defined(XMOG_BUILD_XMOG)
91 # define XMOG_BUILD_XMOG 0
92 #endif
93 
94 // if we don't say that we don't want legacy name support, we'll turn it on
95 #if !defined(XMOG_PRE_3_0_SUPPORT)
96 # define XMOG_PRE_3_0_SUPPORT 1
97 #endif
98 
99 // atomic pointer exchange class
100 #define XMOG_JOBJECT_HOLDER xmog_atomic_pointer
101 #define XMOG_JOBJECT_VALUE(x) (x.value())
102 #define XMOG_JOBJECT_XCHG(x,y) x = y
103 
104 // if we don't say that we're building a static library, we're not building a static library
105 #if !defined(XMOG_BUILD_STATIC_LIBS)
106 # define XMOG_BUILD_STATIC_LIBS 0
107 #endif
108 
109 // if we are building a static lib or if we're not building on Windows, we don't need to export anything
110 // otherwise, we base our definition on what whether we're building
111 // the runtime library or not
112 #if (XMOG_BUILD_STATIC_LIBS!=0 || (XMOG_WINDOWS!=1 && (!defined(__GNUC__) || __GNUC__ < 4 )))
113 # if !defined(XMOG_DECLSPEC)
114 # define XMOG_DECLSPEC
115 # endif
116 #elif !defined(XMOG_DECLSPEC)
117 # if (XMOG_BUILD_XMOG==1)
118 # if (XMOG_WINDOWS==1)
119 # define XMOG_DECLSPEC __declspec(dllexport)
120 # elif (__GNUC__ >= 4)
121 # define XMOG_DECLSPEC __attribute__((visibility("default")))
122 # endif
123 # else
124 # if (XMOG_WINDOWS==1)
125 # define XMOG_DECLSPEC __declspec(dllimport)
126 # else
127 # define XMOG_DECLSPEC
128 # endif
129 # endif
130 #endif
131 
132 //if we're not told not to load JVMs dynamically, we do it
133 #if !defined(XMOG_DYNAMICALLY_LOADS_JVM)
134 # define XMOG_DYNAMICALLY_LOADS_JVM 1
135 #endif
136 
137 //if we're not told not to publish the invocation interface, we do it
138 //unless we're linked statically with a JVM (in that case we would clash
139 //with the invocation interface entry points)
140 #if !defined(XMOG_PUBLISHES_INVOCATION_INTERFACE)
141 # if (XMOG_DYNAMICALLY_LOADS_JVM==0)
142 # define XMOG_PUBLISHES_INVOCATION_INTERFACE 0
143 # else
144 # define XMOG_PUBLISHES_INVOCATION_INTERFACE 1
145 # endif
146 #endif
147 
148 
149 //if we're not told not to publish the remote implementations, we do it
150 #if !defined(XMOG_IMPLEMENTS_REMOTE)
151 # define XMOG_IMPLEMENTS_REMOTE 1
152 #endif
153 
154 #if (XMOG_IMPLEMENTS_REMOTE==1)
155 
156 # if !defined(XMOG_IMPLEMENTS_REMOTE_CLIENT)
157 # define XMOG_IMPLEMENTS_REMOTE_CLIENT 1
158 # endif
159 
160 # if !defined(XMOG_IMPLEMENTS_REMOTE_SERVER)
161 # define XMOG_IMPLEMENTS_REMOTE_SERVER 1
162 # endif
163 
164 #else
165 
166 # define XMOG_IMPLEMENTS_REMOTE_CLIENT 0
167 # define XMOG_IMPLEMENTS_REMOTE_SERVER 0
168 
169 #endif
170 
171 #if (XMOG_IMPLEMENTS_REMOTE_CLIENT==1)
172 
173 # if !defined(XMOG_IMPLEMENTS_REMOTE_IPV4_CLIENT)
174 # define XMOG_IMPLEMENTS_REMOTE_IPV4_CLIENT 1
175 # endif
176 
177 # if !defined(XMOG_IMPLEMENTS_REMOTE_LSOCK_CLIENT)
178 # define XMOG_IMPLEMENTS_REMOTE_LSOCK_CLIENT 1
179 # endif
180 
181 # if !defined(XMOG_IMPLEMENTS_REMOTE_SHMEM_CLIENT)
182 # define XMOG_IMPLEMENTS_REMOTE_SHMEM_CLIENT 1
183 # endif
184 
185 # define XMOG_REMOTE_CLIENT_OPTIONS_INH , public xmog_remote_client_options
186 # define XMOG_REMOTE_CLIENT_OPTIONS_IMPL1(x) , xmog_remote_client_options( x )
187 # define XMOG_REMOTE_CLIENT_OPTIONS_IMPL2(x,y) , xmog_remote_client_options( x, y )
188 # define XMOG_REMOTE_CLIENT_OPTIONS_IMPL3(x,y,z) , xmog_remote_client_options( x, y, z )
189 # define XMOG_REMOTE_CLIENT_OPTIONS_IMPL4(x,y,z,u) , xmog_remote_client_options( x, y, z, u )
190 # define XMOG_REMOTE_CLIENT_OPTIONS_IMPL5(x,y,z,u,v) , xmog_remote_client_options( x, y, z, u, v )
191 
192 #else
193 
194 # define XMOG_IMPLEMENTS_REMOTE_IPV4_CLIENT 0
195 # define XMOG_IMPLEMENTS_REMOTE_SHMEM_CLIENT 0
196 # define XMOG_IMPLEMENTS_REMOTE_LSOCK_CLIENT 0
197 
198 # define XMOG_REMOTE_CLIENT_OPTIONS_INH
199 # define XMOG_REMOTE_CLIENT_OPTIONS_IMPL1
200 # define XMOG_REMOTE_CLIENT_OPTIONS_IMPL2
201 # define XMOG_REMOTE_CLIENT_OPTIONS_IMPL3
202 # define XMOG_REMOTE_CLIENT_OPTIONS_IMPL4
203 # define XMOG_REMOTE_CLIENT_OPTIONS_IMPL5
204 
205 #endif
206 
207 #if (XMOG_IMPLEMENTS_REMOTE_SERVER==1)
208 
209 # if !defined(XMOG_IMPLEMENTS_REMOTE_IPV4_SERVER)
210 # define XMOG_IMPLEMENTS_REMOTE_IPV4_SERVER 1
211 # endif
212 
213 # if !defined(XMOG_IMPLEMENTS_REMOTE_LSOCK_SERVER)
214 # define XMOG_IMPLEMENTS_REMOTE_LSOCK_SERVER 1
215 # endif
216 
217 # if !defined(XMOG_IMPLEMENTS_REMOTE_SHMEM_SERVER)
218 # define XMOG_IMPLEMENTS_REMOTE_SHMEM_SERVER 1
219 # endif
220 
221 # define XMOG_REMOTE_SERVER_OPTIONS_INH , public xmog_remote_server_options
222 # define XMOG_REMOTE_SERVER_OPTIONS_IMPL1(x) , xmog_remote_server_options( x )
223 # define XMOG_REMOTE_SERVER_OPTIONS_IMPL2(x,y) , xmog_remote_server_options( x, y )
224 # define XMOG_REMOTE_SERVER_OPTIONS_IMPL3(x,y,z) , xmog_remote_server_options( x, y, z )
225 # define XMOG_REMOTE_SERVER_OPTIONS_IMPL4(x,y,z,u) , xmog_remote_server_options( x, y, z, u )
226 # define XMOG_REMOTE_SERVER_OPTIONS_IMPL5(x,y,z,u,v) , xmog_remote_server_options( x, y, z, u, v )
227 
228 #else
229 
230 # define XMOG_IMPLEMENTS_REMOTE_IPV4_SERVER 0
231 # define XMOG_IMPLEMENTS_REMOTE_SHMEM_SERVER 0
232 # define XMOG_IMPLEMENTS_REMOTE_LSOCK_SERVER 0
233 
234 # define XMOG_REMOTE_SERVER_OPTIONS_INH
235 # define XMOG_REMOTE_SERVER_OPTIONS_IMPL1(x)
236 # define XMOG_REMOTE_SERVER_OPTIONS_IMPL2(x,y)
237 # define XMOG_REMOTE_SERVER_OPTIONS_IMPL3(x,y,z)
238 # define XMOG_REMOTE_SERVER_OPTIONS_IMPL4(x,y,z,u)
239 # define XMOG_REMOTE_SERVER_OPTIONS_IMPL5(x,y,z,u,v)
240 
241 #endif
242 
243 
244 //
245 // The global namespace token causes aCC to hiccup
246 // when defining a declared method such as int (::type::method)()
247 // ^^
248 //
249 #ifndef XMOG_IMPL_GLOBAL_NS
250 # define XMOG_IMPL_GLOBAL_NS ::
251 #endif
252 
256 typedef XMOG_THREAD_FUNC_RETURN (*XMOG_THREAD_FUNC)(void *);
257 
258 //
259 //
260 //
261 #if defined(LP64) || defined(_LP64) || defined(__LP64) || defined(__64BIT__) || defined(WIN64) || defined(_M_X64)
262 
263 # define JLONG_TO_PTR(t,x) (t*)(void*)(x)
264 # define JLONG_TO_VOID_PTR(x) (void*)(x)
265 # define JLONG_TO_FUNCPTR(t,x) (t)(void*)(x)
266 # define PTR_TO_JLONG(x) (jlong)(void*)(x)
267 
268 #else
269 
270 # define JLONG_TO_PTR(t,x) (t*)(void*)(jint)(x)
271 # define JLONG_TO_VOID_PTR(x) (void*)(jint)(x)
272 # define JLONG_TO_FUNCPTR(t,x) (t)(void*)(jint)(x)
273 # define PTR_TO_JLONG(x) (jlong)(jint)(void*)(x)
274 
275 #endif
276 
277 #endif /* XMOG_CONFIG_INC */

Copyright (c) 1999-2020 by Codemesh, Inc., ALL RIGHTS RESERVED.