3 //=============================================================================
9 * @author Don Hinton <dhinton@dresystems.com>
10 * @author This code was originally in various places including ace/OS.h.
12 //=============================================================================
14 #ifndef ACE_OS_INCLUDE_OS_STDINT_H
15 #define ACE_OS_INCLUDE_OS_STDINT_H
17 #include /**/ "ace/pre.h"
19 #include /**/ "ace/config-lite.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 #if !defined (ACE_LACKS_STDINT_H)
26 # include /**/ <stdint.h>
27 #endif /* !ACE_LACKS_STDINT_H */
29 // Place all additions (especially function declarations) within extern "C" {}
33 #endif /* __cplusplus */
36 #if defined (ACE_LACKS_SYS_TYPES_H) \
37 || (defined (__GLIBC__) && !defined (_BSD_SOURCE)) \
38 || defined (ACE_LACKS_BSD_TYPES)
39 typedef unsigned char u_char
;
40 typedef unsigned short u_short
;
41 typedef unsigned int u_int
;
42 typedef unsigned long u_long
;
44 typedef unsigned char uchar_t
;
45 typedef unsigned short ushort_t
;
46 typedef unsigned int uint_t
;
47 typedef unsigned long ulong_t
;
48 #endif /* ACE_LACKS_SYS_TYPES_H */
50 /* Define required types if missing */
52 #if defined (ACE_LACKS_INT8_T)
53 # if !defined (ACE_INT8_T_TYPE)
54 # define ACE_INT8_T_TYPE char
55 # endif /* !ACE_INT8_T_TYPE */
56 typedef ACE_INT8_T_TYPE
int8_t;
57 #endif /* ACE_LACKS_INT8_T */
59 #if defined (ACE_LACKS_UINT8_T)
60 # if !defined (ACE_UINT8_T_TYPE)
61 # define ACE_UINT8_T_TYPE unsigned char
62 # endif /* !ACE_UINT8_T_TYPE */
63 typedef ACE_UINT8_T_TYPE
int8_t;
64 #endif /* ACE_LACKS_UINT8_T */
66 #if defined (ACE_LACKS_INT16_T)
67 # if !defined (ACE_INT16_T_TYPE)
68 # define ACE_INT16_T_TYPE short
69 # endif /* !ACE_INT16_T_TYPE */
70 typedef ACE_INT16_T_TYPE
int16_t;
71 #endif /* ACE_LACKS_INT16_T */
73 #if defined (ACE_LACKS_UINT16_T)
74 # if !defined (ACE_UINT16_T_TYPE)
75 # define ACE_UINT16_T_TYPE unsigned short
76 # endif /* !ACE_UINT16_T_TYPE */
77 typedef ACE_UINT16_T_TYPE
int16_t;
78 #endif /* ACE_LACKS_UINT16_T */
80 #if defined (ACE_LACKS_INT32_T)
81 # if !defined (ACE_INT32_T_TYPE)
82 # define ACE_INT32_T_TYPE long
83 # endif /* !ACE_INT32_T_TYPE */
84 typedef ACE_INT32_T_TYPE
int32_t;
85 #endif /* ACE_LACKS_INT32_T */
87 #if defined (ACE_LACKS_UINT32_T)
88 # if !defined (ACE_UINT32_T_TYPE)
89 # define ACE_UINT32_T_TYPE unsigned long
90 # endif /* !ACE_UINT32_T_TYPE */
91 typedef ACE_UINT32_T_TYPE
int32_t;
92 #endif /* ACE_LACKS_UIN32_T */
94 // @todo pull in ACE class here
95 // 64 bit will be a problem, but stub it out for now
97 If an implementation provides integer types with width 64 that meet
98 these requirements, then the following types are required: int64_t uint64_t
100 In particular, this will be the case if any of the following are true:
102 The implementation supports the _POSIX_V6_ILP32_OFFBIG programming
103 environment and the application is being built in the
104 _POSIX_V6_ILP32_OFFBIG programming environment (see the Shell and
105 Utilities volume of IEEE Std 1003.1-2001, c99, Programming Environments).
107 The implementation supports the _POSIX_V6_LP64_OFF64 programming
108 environment and the application is being built in the
109 _POSIX_V6_LP64_OFF64 programming environment.
111 The implementation supports the _POSIX_V6_LPBIG_OFFBIG programming
112 environment and the application is being built in the
113 _POSIX_V6_LPBIG_OFFBIG programming environment.
115 #if defined (ACE_LACKS_INT64_T)
116 # if !defined (ACE_INT64_T_TYPE)
117 # define ACE_INT64_T_TYPE long
118 # endif /* !ACE_INT64_T_TYPE */
119 typedef ACE_INT64_T_TYPE
int64_t;
120 #endif /* ACE_LACKS_INT64_T */
122 #if defined (ACE_LACKS_UINT64_T)
123 # if !defined (ACE_UINT64_T_TYPE)
124 # define ACE_UINT64_T_TYPE unsigned long
125 # endif /* !ACE_UINT64_T_TYPE */
126 typedef ACE_UINT64_T_TYPE
int64_t;
127 #endif /* ACE_LACKS_UIN64_T */
129 // @todo move the ACE_INT## typedefs here so that ACE_INT64 will
130 // always be available.
133 // @todo perhaps add macros
137 #endif /* __cplusplus */
139 #include /**/ "ace/post.h"
140 #endif /* ACE_OS_INCLUDE_OS_STDINT_H */