os_stdint.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    os_stdint.h
00006  *
00007  *  integer types
00008  *
00009  *  os_stdint.h,v 1.5 2006/05/05 08:06:58 jwillemsen Exp
00010  *
00011  *  @author Don Hinton <dhinton@dresystems.com>
00012  *  @author This code was originally in various places including ace/OS.h.
00013  */
00014 //=============================================================================
00015 
00016 #ifndef ACE_OS_INCLUDE_OS_STDINT_H
00017 #define ACE_OS_INCLUDE_OS_STDINT_H
00018 
00019 #include /**/ "ace/pre.h"
00020 
00021 #include "ace/config-lite.h"
00022 
00023 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00024 # pragma once
00025 #endif /* ACE_LACKS_PRAGMA_ONCE */
00026 
00027 #if !defined (ACE_LACKS_STDINT_H)
00028 #  include /**/ <stdint.h>
00029 #endif /* !ACE_LACKS_STDINT_H */
00030 
00031 // Place all additions (especially function declarations) within extern "C" {}
00032 #ifdef __cplusplus
00033 extern "C"
00034 {
00035 #endif /* __cplusplus */
00036 
00037 // BSD style types
00038 #if defined (ACE_LACKS_SYS_TYPES_H) \
00039        || (defined (__GLIBC__) && !defined (_BSD_SOURCE))
00040       typedef unsigned char u_char;
00041       typedef unsigned short u_short;
00042       typedef unsigned int u_int;
00043       typedef unsigned long u_long;
00044 
00045       typedef unsigned char uchar_t;
00046       typedef unsigned short ushort_t;
00047       typedef unsigned int  uint_t;
00048       typedef unsigned long ulong_t;
00049 #endif  /* ACE_LACKS_SYS_TYPES_H */
00050 
00051 /* Define required types if missing */
00052 
00053 #if defined (ACE_LACKS_INT8_T)
00054 #  if !defined (ACE_INT8_T_TYPE)
00055 #    define ACE_INT8_T_TYPE char
00056 #  endif /* !ACE_INT8_T_TYPE */
00057    typedef ACE_INT8_T_TYPE int8_t;
00058 #endif /* ACE_LACKS_INT8_T */
00059 
00060 #if defined (ACE_LACKS_UINT8_T)
00061 #  if !defined (ACE_UINT8_T_TYPE)
00062 #    define ACE_UINT8_T_TYPE unsigned char
00063 #  endif /* !ACE_UINT8_T_TYPE */
00064    typedef ACE_UINT8_T_TYPE int8_t;
00065 #endif /* ACE_LACKS_UINT8_T */
00066 
00067 #if defined (ACE_LACKS_INT16_T)
00068 #  if !defined (ACE_INT16_T_TYPE)
00069 #    define ACE_INT16_T_TYPE short
00070 #  endif /* !ACE_INT16_T_TYPE */
00071    typedef ACE_INT16_T_TYPE int16_t;
00072 #endif /* ACE_LACKS_INT16_T */
00073 
00074 #if defined (ACE_LACKS_UINT16_T)
00075 #  if !defined (ACE_UINT16_T_TYPE)
00076 #    define ACE_UINT16_T_TYPE unsigned short
00077 #  endif /* !ACE_UINT16_T_TYPE */
00078    typedef ACE_UINT16_T_TYPE int16_t;
00079 #endif /* ACE_LACKS_UINT16_T */
00080 
00081 #if defined (ACE_LACKS_INT32_T)
00082 #  if !defined (ACE_INT32_T_TYPE)
00083 #    define ACE_INT32_T_TYPE long
00084 #  endif /* !ACE_INT32_T_TYPE */
00085    typedef ACE_INT32_T_TYPE int32_t;
00086 #endif /* ACE_LACKS_INT32_T */
00087 
00088 #if defined (ACE_LACKS_UINT32_T)
00089 #  if !defined (ACE_UINT32_T_TYPE)
00090 #    define ACE_UINT32_T_TYPE unsigned long
00091 #  endif /* !ACE_UINT32_T_TYPE */
00092    typedef ACE_UINT32_T_TYPE int32_t;
00093 #endif /* ACE_LACKS_UIN32_T */
00094 
00095 // @todo pull in ACE class here
00096 // 64 bit will be a problem, but stub it out for now
00097 /*
00098 If an implementation provides integer types with width 64 that meet
00099 these requirements, then the following types are required: int64_t uint64_t
00100 
00101 In particular, this will be the case if any of the following are true:
00102 
00103 The implementation supports the _POSIX_V6_ILP32_OFFBIG programming
00104 environment and the application is being built in the
00105 _POSIX_V6_ILP32_OFFBIG programming environment (see the Shell and
00106 Utilities volume of IEEE Std 1003.1-2001, c99, Programming Environments).
00107 
00108 The implementation supports the _POSIX_V6_LP64_OFF64 programming
00109 environment and the application is being built in the
00110 _POSIX_V6_LP64_OFF64 programming environment.
00111 
00112 The implementation supports the _POSIX_V6_LPBIG_OFFBIG programming
00113 environment and the application is being built in the
00114 _POSIX_V6_LPBIG_OFFBIG programming environment.
00115 */
00116 #if defined (ACE_LACKS_INT64_T)
00117 #  if !defined (ACE_INT64_T_TYPE)
00118 #    define ACE_INT64_T_TYPE long
00119 #  endif /* !ACE_INT64_T_TYPE */
00120    typedef ACE_INT64_T_TYPE int64_t;
00121 #endif /* ACE_LACKS_INT64_T */
00122 
00123 #if defined (ACE_LACKS_UINT64_T)
00124 #  if !defined (ACE_UINT64_T_TYPE)
00125 #    define ACE_UINT64_T_TYPE unsigned long
00126 #  endif /* !ACE_UINT64_T_TYPE */
00127    typedef ACE_UINT64_T_TYPE int64_t;
00128 #endif /* ACE_LACKS_UIN64_T */
00129 
00130 // @todo move the ACE_INT## typedefs here so that ACE_INT64 will
00131 // always be available.
00132 
00133 
00134 // @todo perhaps add macros
00135 
00136 #ifdef __cplusplus
00137 }
00138 #endif /* __cplusplus */
00139 
00140 #include /**/ "ace/post.h"
00141 #endif /* ACE_OS_INCLUDE_OS_STDINT_H */

Generated on Thu Nov 9 09:41:58 2006 for ACE by doxygen 1.3.6