summaryrefslogtreecommitdiff
path: root/ace/os_include/stdint.h
blob: a3f95240e9314ebb9682efaa857b5ce8fb02505c (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// -*- C++ -*-

//=============================================================================
/**
 *  @file    stdint.h
 *
 *  integer types
 *
 *  $Id$
 *
 *  @author Don Hinton <dhinton@ieee.org>
 *  @author This code was originally in various places including ace/OS.h.
 */
//=============================================================================

#ifndef ACE_OS_INCLUDE_STDINT_H
#define ACE_OS_INCLUDE_STDINT_H

#include "ace/pre.h"

#include "ace/config-all.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#if !defined (ACE_LACKS_STDINT_H)
# include /**/ <stdint.h>
#endif /* !ACE_LACKS_STDINT_H */


/* Define required types if missing */

#if defined (ACE_LACKS_INT8_T)
# if !defined (ACE_INT8_T_TYPE)
#  define ACE_INT8_T_TYPE char
# endif /* !ACE_INT8_T_TYPE */
typedef ACE_INT8_T_TYPE int8_t;
#endif /* ACE_LACKS_INT8_T */

#if defined (ACE_LACKS_UINT8_T)
# if !defined (ACE_UINT8_T_TYPE)
#  define ACE_UINT8_T_TYPE unsigned char
# endif /* !ACE_UINT8_T_TYPE */
typedef ACE_UINT8_T_TYPE int8_t;
#endif /* ACE_LACKS_UINT8_T */

#if defined (ACE_LACKS_INT16_T)
# if !defined (ACE_INT16_T_TYPE)
#  define ACE_INT16_T_TYPE short
# endif /* !ACE_INT16_T_TYPE */
typedef ACE_INT16_T_TYPE int16_t;
#endif /* ACE_LACKS_INT16_T */

#if defined (ACE_LACKS_UINT16_T)
# if !defined (ACE_UINT16_T_TYPE)
#  define ACE_UINT16_T_TYPE unsigned short
# endif /* !ACE_UINT16_T_TYPE */
typedef ACE_UINT16_T_TYPE int16_t;
#endif /* ACE_LACKS_UINT16_T */

#if defined (ACE_LACKS_INT32_T)
# if !defined (ACE_INT32_T_TYPE)
#  define ACE_INT32_T_TYPE long
# endif /* !ACE_INT32_T_TYPE */
typedef ACE_INT32_T_TYPE int32_t;
#endif /* ACE_LACKS_INT32_T */

#if defined (ACE_LACKS_UINT32_T)
# if !defined (ACE_UINT32_T_TYPE)
#  define ACE_UINT32_T_TYPE unsigned long
# endif /* !ACE_UINT32_T_TYPE */
typedef ACE_UINT32_T_TYPE int32_t;
#endif /* ACE_LACKS_UIN32_T */

// @todo pull in ACE class here
// 64 bit will be a problem, but stub it out for now
/*
If an implementation provides integer types with width 64 that meet 
these requirements, then the following types are required: int64_t uint64_t

In particular, this will be the case if any of the following are true:

The implementation supports the _POSIX_V6_ILP32_OFFBIG programming 
environment and the application is being built in the 
_POSIX_V6_ILP32_OFFBIG programming environment (see the Shell and 
Utilities volume of IEEE Std 1003.1-2001, c99, Programming Environments).

The implementation supports the _POSIX_V6_LP64_OFF64 programming 
environment and the application is being built in the 
_POSIX_V6_LP64_OFF64 programming environment.

The implementation supports the _POSIX_V6_LPBIG_OFFBIG programming 
environment and the application is being built in the 
_POSIX_V6_LPBIG_OFFBIG programming environment.
*/
#if defined (ACE_LACKS_INT64_T)
# if !defined (ACE_INT64_T_TYPE)
#  define ACE_INT64_T_TYPE long
# endif /* !ACE_INT64_T_TYPE */
typedef ACE_INT64_T_TYPE int64_t;
#endif /* ACE_LACKS_INT64_T */

#if defined (ACE_LACKS_UINT64_T)
# if !defined (ACE_UINT64_T_TYPE)
#  define ACE_UINT64_T_TYPE unsigned long
# endif /* !ACE_UINT64_T_TYPE */
typedef ACE_UINT64_T_TYPE int64_t;
#endif /* ACE_LACKS_UIN64_T */

// @todo move the ACE_INT## typedefs here so that ACE_INT64 will
// always be available.


// @todo perhaps add macros

#include "ace/post.h"
#endif /* ACE_OS_INCLUDE_STDINT_H */