This source file includes following definitions.
- htonl
- ntohl
- htons
- ntohs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 #ifndef OPAL_CONFIG_H
35 #error "opal_config_bottom.h should only be included from opal_config.h"
36 #endif
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53 #ifndef OMPI_BUILDING
54 #define OMPI_BUILDING 1
55 #endif
56
57
58
59
60
61
62
63 #ifndef HAVE_UNISTD_H
64 #define YY_NO_UNISTD_H
65 #endif
66
67
68
69
70
71
72
73
74
75
76
77
78
79 #undef BEGIN_C_DECLS
80 #undef END_C_DECLS
81 #if defined(c_plusplus) || defined(__cplusplus)
82 # define BEGIN_C_DECLS extern "C" {
83 # define END_C_DECLS }
84 #else
85 #define BEGIN_C_DECLS
86 #define END_C_DECLS
87 #endif
88
89
90
91
92
93 #if OPAL_HAVE_ATTRIBUTE_ALIGNED
94 # define __opal_attribute_aligned__(a) __attribute__((__aligned__(a)))
95 # define __opal_attribute_aligned_max__ __attribute__((__aligned__))
96 #else
97 # define __opal_attribute_aligned__(a)
98 # define __opal_attribute_aligned_max__
99 #endif
100
101 #if OPAL_HAVE_ATTRIBUTE_ALWAYS_INLINE
102 # define __opal_attribute_always_inline__ __attribute__((__always_inline__))
103 #else
104 # define __opal_attribute_always_inline__
105 #endif
106
107 #if OPAL_HAVE_ATTRIBUTE_COLD
108 # define __opal_attribute_cold__ __attribute__((__cold__))
109 #else
110 # define __opal_attribute_cold__
111 #endif
112
113 #if OPAL_HAVE_ATTRIBUTE_CONST
114 # define __opal_attribute_const__ __attribute__((__const__))
115 #else
116 # define __opal_attribute_const__
117 #endif
118
119 #if OPAL_HAVE_ATTRIBUTE_DEPRECATED
120 # define __opal_attribute_deprecated__ __attribute__((__deprecated__))
121 #else
122 # define __opal_attribute_deprecated__
123 #endif
124
125 #if OPAL_HAVE_ATTRIBUTE_FORMAT
126 # define __opal_attribute_format__(a,b,c) __attribute__((__format__(a, b, c)))
127 #else
128 # define __opal_attribute_format__(a,b,c)
129 #endif
130
131
132 #if OPAL_HAVE_ATTRIBUTE_FORMAT_FUNCPTR
133 # define __opal_attribute_format_funcptr__(a,b,c) __attribute__((__format__(a, b, c)))
134 #else
135 # define __opal_attribute_format_funcptr__(a,b,c)
136 #endif
137
138 #if OPAL_HAVE_ATTRIBUTE_HOT
139 # define __opal_attribute_hot__ __attribute__((__hot__))
140 #else
141 # define __opal_attribute_hot__
142 #endif
143
144 #if OPAL_HAVE_ATTRIBUTE_MALLOC
145 # define __opal_attribute_malloc__ __attribute__((__malloc__))
146 #else
147 # define __opal_attribute_malloc__
148 #endif
149
150 #if OPAL_HAVE_ATTRIBUTE_MAY_ALIAS
151 # define __opal_attribute_may_alias__ __attribute__((__may_alias__))
152 #else
153 # define __opal_attribute_may_alias__
154 #endif
155
156 #if OPAL_HAVE_ATTRIBUTE_NO_INSTRUMENT_FUNCTION
157 # define __opal_attribute_no_instrument_function__ __attribute__((__no_instrument_function__))
158 #else
159 # define __opal_attribute_no_instrument_function__
160 #endif
161
162 #if OPAL_HAVE_ATTRIBUTE_NOINLINE
163 # define __opal_attribute_noinline__ __attribute__((__noinline__))
164 #else
165 # define __opal_attribute_noinline__
166 #endif
167
168 #if OPAL_HAVE_ATTRIBUTE_NONNULL
169 # define __opal_attribute_nonnull__(a) __attribute__((__nonnull__(a)))
170 # define __opal_attribute_nonnull_all__ __attribute__((__nonnull__))
171 #else
172 # define __opal_attribute_nonnull__(a)
173 # define __opal_attribute_nonnull_all__
174 #endif
175
176 #if OPAL_HAVE_ATTRIBUTE_NORETURN
177 # define __opal_attribute_noreturn__ __attribute__((__noreturn__))
178 #else
179 # define __opal_attribute_noreturn__
180 #endif
181
182
183 #if OPAL_HAVE_ATTRIBUTE_NORETURN_FUNCPTR
184 # define __opal_attribute_noreturn_funcptr__ __attribute__((__noreturn__))
185 #else
186 # define __opal_attribute_noreturn_funcptr__
187 #endif
188
189 #if OPAL_HAVE_ATTRIBUTE_PACKED
190 # define __opal_attribute_packed__ __attribute__((__packed__))
191 #else
192 # define __opal_attribute_packed__
193 #endif
194
195 #if OPAL_HAVE_ATTRIBUTE_PURE
196 # define __opal_attribute_pure__ __attribute__((__pure__))
197 #else
198 # define __opal_attribute_pure__
199 #endif
200
201 #if OPAL_HAVE_ATTRIBUTE_SENTINEL
202 # define __opal_attribute_sentinel__ __attribute__((__sentinel__))
203 #else
204 # define __opal_attribute_sentinel__
205 #endif
206
207 #if OPAL_HAVE_ATTRIBUTE_UNUSED
208 # define __opal_attribute_unused__ __attribute__((__unused__))
209 #else
210 # define __opal_attribute_unused__
211 #endif
212
213 #if OPAL_HAVE_ATTRIBUTE_VISIBILITY
214 # define __opal_attribute_visibility__(a) __attribute__((__visibility__(a)))
215 #else
216 # define __opal_attribute_visibility__(a)
217 #endif
218
219 #if OPAL_HAVE_ATTRIBUTE_WARN_UNUSED_RESULT
220 # define __opal_attribute_warn_unused_result__ __attribute__((__warn_unused_result__))
221 #else
222 # define __opal_attribute_warn_unused_result__
223 #endif
224
225 #if OPAL_HAVE_ATTRIBUTE_WEAK_ALIAS
226 # define __opal_attribute_weak_alias__(a) __attribute__((__weak__, __alias__(a)))
227 #else
228 # define __opal_attribute_weak_alias__(a)
229 #endif
230
231 #if OPAL_HAVE_ATTRIBUTE_DESTRUCTOR
232 # define __opal_attribute_destructor__ __attribute__((__destructor__))
233 #else
234 # define __opal_attribute_destructor__
235 #endif
236
237 #if OPAL_HAVE_ATTRIBUTE_OPTNONE
238 # define __opal_attribute_optnone__ __attribute__((__optnone__))
239 #else
240 # define __opal_attribute_optnone__
241 #endif
242
243 #if OPAL_HAVE_ATTRIBUTE_EXTENSION
244 # define __opal_attribute_extension__ __extension__
245 #else
246 # define __opal_attribute_extension__
247 #endif
248
249 # if OPAL_C_HAVE_VISIBILITY
250 # define OPAL_DECLSPEC __opal_attribute_visibility__("default")
251 # define OPAL_MODULE_DECLSPEC __opal_attribute_visibility__("default")
252 # else
253 # define OPAL_DECLSPEC
254 # define OPAL_MODULE_DECLSPEC
255 # endif
256
257 #if !defined(__STDC_LIMIT_MACROS) && (defined(c_plusplus) || defined (__cplusplus))
258
259
260
261 #define __STDC_LIMIT_MACROS
262 #endif
263 #include "opal_stdint.h"
264
265
266
267
268
269
270
271
272 #if OMPI_BUILDING
273
274
275
276
277 #include <limits.h>
278 #ifdef HAVE_SYS_PARAM_H
279 #include <sys/param.h>
280 #endif
281 #if defined(PATH_MAX)
282 #define OPAL_PATH_MAX (PATH_MAX + 1)
283 #elif defined(_POSIX_PATH_MAX)
284 #define OPAL_PATH_MAX (_POSIX_PATH_MAX + 1)
285 #else
286 #define OPAL_PATH_MAX 256
287 #endif
288
289
290
291
292 #define OPAL_PATH_SEP "/"
293 #define OPAL_ENV_SEP ':'
294
295 #if defined(MAXHOSTNAMELEN)
296 #define OPAL_MAXHOSTNAMELEN (MAXHOSTNAMELEN + 1)
297 #elif defined(HOST_NAME_MAX)
298 #define OPAL_MAXHOSTNAMELEN (HOST_NAME_MAX + 1)
299 #else
300
301 #define OPAL_MAXHOSTNAMELEN (255 + 1)
302 #endif
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323 #if OPAL_ENABLE_MEM_DEBUG && !defined(OPAL_DISABLE_ENABLE_MEM_DEBUG)
324
325
326
327
328
329
330 # include "opal/util/malloc.h"
331 # if defined(malloc)
332 # undef malloc
333 # endif
334 # define malloc(size) opal_malloc((size), __FILE__, __LINE__)
335 # if defined(calloc)
336 # undef calloc
337 # endif
338 # define calloc(nmembers, size) opal_calloc((nmembers), (size), __FILE__, __LINE__)
339 # if defined(realloc)
340 # undef realloc
341 # endif
342 # define realloc(ptr, size) opal_realloc((ptr), (size), __FILE__, __LINE__)
343 # if defined(free)
344 # undef free
345 # endif
346 # define free(ptr) opal_free((ptr), __FILE__, __LINE__)
347
348
349
350
351 # include <string.h>
352 # define OPAL_DEBUG_ZERO(obj) memset(&(obj), 0, sizeof(obj))
353 #else
354 # define OPAL_DEBUG_ZERO(obj)
355 #endif
356
357
358
359
360 #if !defined(HAVE_VASPRINTF) || !defined(HAVE_VSNPRINTF)
361 #include <stdarg.h>
362 #include <stdlib.h>
363 #endif
364
365 #if !defined(HAVE_ASPRINTF) || !defined(HAVE_SNPRINTF) || !defined(HAVE_VASPRINTF) || !defined(HAVE_VSNPRINTF)
366 #include "opal/util/printf.h"
367 #endif
368
369 #ifndef HAVE_ASPRINTF
370 # define asprintf opal_asprintf
371 #endif
372
373 #ifndef HAVE_SNPRINTF
374 # define snprintf opal_snprintf
375 #endif
376
377 #ifndef HAVE_VASPRINTF
378 # define vasprintf opal_vasprintf
379 #endif
380
381 #ifndef HAVE_VSNPRINTF
382 # define vsnprintf opal_vsnprintf
383 #endif
384
385
386
387
388
389 #if OPAL_HAVE_BROKEN_QSORT
390 #ifdef qsort
391 #undef qsort
392 #endif
393
394 #include "opal/util/qsort.h"
395 #define qsort opal_qsort
396 #endif
397
398
399
400
401
402
403
404
405 #if !defined(HAVE_UNIX_BYTESWAP)
406 static inline uint32_t htonl(uint32_t hostvar) { return hostvar; }
407 static inline uint32_t ntohl(uint32_t netvar) { return netvar; }
408 static inline uint16_t htons(uint16_t hostvar) { return hostvar; }
409 static inline uint16_t ntohs(uint16_t netvar) { return netvar; }
410 #endif
411
412
413
414
415
416
417
418
419 #if defined(HAVE_DECL___FUNC__) && !HAVE_DECL___FUNC__
420 #define __func__ __FILE__
421 #endif
422
423 #define IOVBASE_TYPE void
424
425
426 #include <stdbool.h>
427
428
429
430
431
432 # define OPAL_INT_TO_BOOL(VALUE) (bool)(VALUE)
433
434
435
436
437
438
439 #if OPAL_ENABLE_IPV6 && defined(HAVE_STRUCT_SOCKADDR_IN6)
440 #define OPAL_ENABLE_IPV6 1
441 #else
442 #define OPAL_ENABLE_IPV6 0
443 #endif
444
445 #if !defined(HAVE_STRUCT_SOCKADDR_STORAGE) && defined(HAVE_STRUCT_SOCKADDR_IN)
446 #define sockaddr_storage sockaddr
447 #define ss_family sa_family
448 #endif
449
450
451
452 #if !defined(HAVE_STRUCT_SOCKADDR_IN6) && defined(HAVE_STRUCT_SOCKADDR_IN)
453 #define sockaddr_in6 sockaddr_in
454 #define sin6_len sin_len
455 #define sin6_family sin_family
456 #define sin6_port sin_port
457 #define sin6_addr sin_addr
458 #endif
459
460 #if !HAVE_DECL_AF_UNSPEC
461 #define AF_UNSPEC 0
462 #endif
463 #if !HAVE_DECL_PF_UNSPEC
464 #define PF_UNSPEC 0
465 #endif
466 #if !HAVE_DECL_AF_INET6
467 #define AF_INET6 AF_UNSPEC
468 #endif
469 #if !HAVE_DECL_PF_INET6
470 #define PF_INET6 PF_UNSPEC
471 #endif
472
473 #if defined(__APPLE__) && defined(HAVE_INTTYPES_H)
474
475
476
477
478
479
480
481 #include <inttypes.h>
482 #if defined(__PRI_64_LENGTH_MODIFIER__)
483 #undef __PRI_64_LENGTH_MODIFIER__
484 #define __PRI_64_LENGTH_MODIFIER__ "ll"
485 #endif
486 #if defined(__SCN_64_LENGTH_MODIFIER__)
487 #undef __SCN_64_LENGTH_MODIFIER__
488 #define __SCN_64_LENGTH_MODIFIER__ "ll"
489 #endif
490 #endif
491
492 #ifdef MCS_VXWORKS
493
494
495
496 #ifdef HAVE_IOLIB_H
497
498 #include <ioLib.h>
499 #endif
500 #ifdef HAVE_SOCKLIB_H
501
502 #include <sockLib.h>
503 #endif
504 #ifdef HAVE_HOSTLIB_H
505
506 #include <hostLib.h>
507 #endif
508 #endif
509
510
511
512
513
514 #if defined(c_plusplus) || defined(__cplusplus)
515 #undef restrict
516 #define restrict
517 #endif
518
519 #else
520
521
522
523
524
525
526
527
528
529
530 #undef PACKAGE_BUGREPORT
531 #undef PACKAGE_NAME
532 #undef PACKAGE_STRING
533 #undef PACKAGE_TARNAME
534 #undef PACKAGE_VERSION
535 #undef PACKAGE_URL
536 #undef HAVE_CONFIG_H
537
538 #endif