stdint.h
Go to the documentation of this file.
00001 /* ISO C9x  7.18  Integer types <stdint.h>
00002  * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794)
00003  *
00004  *  THIS SOFTWARE IS NOT COPYRIGHTED
00005  *
00006  *  Contributor: Danny Smith <danny_r_smith_2001@yahoo.co.nz>
00007  *
00008  *  This source code is offered for use in the public domain. You may
00009  *  use, modify or distribute it freely.
00010  *
00011  *  This code is distributed in the hope that it will be useful but
00012  *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
00013  *  DISCLAIMED. This includes but is not limited to warranties of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00015  *
00016  *  Date: 2000-12-02
00017  */
00018 
00019 
00020 #ifndef _STDINT_H
00021 #define _STDINT_H
00022 #define __need_wint_t
00023 #define __need_wchar_t
00024 #include <stddef.h>
00025 
00026 #define HAVE_INT8_T
00027 #define HAVE_UINT8_T
00028 #define HAVE_INT16_T
00029 #define HAVE_UINT16_T
00030 #define HAVE_INT32_T
00031 #define HAVE_UINT32_T
00032 #define HAVE_INT64_T
00033 #define HAVE_UINT64_T
00034 #define HAVE_INTPTR_T
00035 #define HAVE_UINTPTR_T
00036 
00037 /* 7.18.1.1  Exact-width integer types */
00038 typedef signed char int8_t;
00039 typedef unsigned char uint8_t;
00040 typedef short int16_t;
00041 typedef unsigned short uint16_t;
00042 typedef int int32_t;
00043 typedef unsigned uint32_t;
00044 typedef long long int64_t;
00045 typedef unsigned long long uint64_t;
00046 
00047 /* 7.18.1.2  Minimum-width integer types */
00048 typedef signed char int_least8_t;
00049 typedef unsigned char uint_least8_t;
00050 typedef short int_least16_t;
00051 typedef unsigned short uint_least16_t;
00052 typedef int int_least32_t;
00053 typedef unsigned uint_least32_t;
00054 typedef long long int_least64_t;
00055 typedef unsigned long long uint_least64_t;
00056 
00057 /*  7.18.1.3  Fastest minimum-width integer types
00058  *  Not actually guaranteed to be fastest for all purposes
00059  *  Here we use the exact-width types for 8 and 16-bit ints.
00060  */
00061 typedef char int_fast8_t;
00062 typedef unsigned char uint_fast8_t;
00063 typedef short int_fast16_t;
00064 typedef unsigned short uint_fast16_t;
00065 typedef int int_fast32_t;
00066 typedef unsigned int uint_fast32_t;
00067 typedef long long int_fast64_t;
00068 typedef unsigned long long uint_fast64_t;
00069 
00070 /* 7.18.1.4  Integer types capable of holding object pointers */
00071 typedef int intptr_t;
00072 typedef unsigned uintptr_t;
00073 
00074 /* 7.18.1.5  Greatest-width integer types */
00075 typedef long long intmax_t;
00076 typedef unsigned long long uintmax_t;
00077 
00078 /* 7.18.2  Limits of specified-width integer types */
00079 #if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS)
00080 
00081 /* 7.18.2.1  Limits of exact-width integer types */
00082 #define INT8_MIN (-128)
00083 #define INT16_MIN (-32768)
00084 #define INT32_MIN (-2147483647 - 1)
00085 #define INT64_MIN  (-9223372036854775807LL - 1)
00086 
00087 #define INT8_MAX 127
00088 #define INT16_MAX 32767
00089 #define INT32_MAX 2147483647
00090 #define INT64_MAX 9223372036854775807LL
00091 
00092 #define UINT8_MAX 0xff /* 255U */
00093 #define UINT16_MAX 0xffff /* 65535U */
00094 #define UINT32_MAX 0xffffffff  /* 4294967295U */
00095 #define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */
00096 
00097 /* 7.18.2.2  Limits of minimum-width integer types */
00098 #define INT_LEAST8_MIN INT8_MIN
00099 #define INT_LEAST16_MIN INT16_MIN
00100 #define INT_LEAST32_MIN INT32_MIN
00101 #define INT_LEAST64_MIN INT64_MIN
00102 
00103 #define INT_LEAST8_MAX INT8_MAX
00104 #define INT_LEAST16_MAX INT16_MAX
00105 #define INT_LEAST32_MAX INT32_MAX
00106 #define INT_LEAST64_MAX INT64_MAX
00107 
00108 #define UINT_LEAST8_MAX UINT8_MAX
00109 #define UINT_LEAST16_MAX UINT16_MAX
00110 #define UINT_LEAST32_MAX UINT32_MAX
00111 #define UINT_LEAST64_MAX UINT64_MAX
00112 
00113 /* 7.18.2.3  Limits of fastest minimum-width integer types */
00114 #define INT_FAST8_MIN INT8_MIN
00115 #define INT_FAST16_MIN INT16_MIN
00116 #define INT_FAST32_MIN INT32_MIN
00117 #define INT_FAST64_MIN INT64_MIN
00118 
00119 #define INT_FAST8_MAX INT8_MAX
00120 #define INT_FAST16_MAX INT16_MAX
00121 #define INT_FAST32_MAX INT32_MAX
00122 #define INT_FAST64_MAX INT64_MAX
00123 
00124 #define UINT_FAST8_MAX UINT8_MAX
00125 #define UINT_FAST16_MAX UINT16_MAX
00126 #define UINT_FAST32_MAX UINT32_MAX
00127 #define UINT_FAST64_MAX UINT64_MAX
00128 
00129 /* 7.18.2.4  Limits of integer types capable of holding
00130     object pointers */
00131 #define INTPTR_MIN INT32_MIN
00132 #define INTPTR_MAX INT32_MAX
00133 #define UINTPTR_MAX UINT32_MAX
00134 
00135 /* 7.18.2.5  Limits of greatest-width integer types */
00136 #define INTMAX_MIN INT64_MIN
00137 #define INTMAX_MAX INT64_MAX
00138 #define UINTMAX_MAX UINT64_MAX
00139 
00140 /* 7.18.3  Limits of other integer types */
00141 #define PTRDIFF_MIN INT32_MIN
00142 #define PTRDIFF_MAX INT32_MAX
00143 
00144 #define SIG_ATOMIC_MIN INT32_MIN
00145 #define SIG_ATOMIC_MAX INT32_MAX
00146 
00147 #define SIZE_MAX UINT32_MAX
00148 
00149 #ifndef WCHAR_MIN  /* also in wchar.h */
00150 #define WCHAR_MIN 0
00151 #define WCHAR_MAX 0xffff /* UINT16_MAX */
00152 #endif
00153 
00154 /*
00155  * wint_t is unsigned short for compatibility with MS runtime
00156  */
00157 #define WINT_MIN 0
00158 #define WINT_MAX 0xffff /* UINT16_MAX */
00159 
00160 #endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */
00161 
00162 
00163 /* 7.18.4  Macros for integer constants */
00164 #if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS)
00165 
00166 /* 7.18.4.1  Macros for minimum-width integer constants
00167 
00168     Accoding to Douglas Gwyn <gwyn@arl.mil>:
00169     "This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC
00170     9899:1999 as initially published, the expansion was required
00171     to be an integer constant of precisely matching type, which
00172     is impossible to accomplish for the shorter types on most
00173     platforms, because C99 provides no standard way to designate
00174     an integer constant with width less than that of type int.
00175     TC1 changed this to require just an integer constant
00176    *expression* with *promoted* type."
00177  */
00178 
00179 #define INT8_C(val) ((int8_t) + (val))
00180 #define UINT8_C(val) ((uint8_t) + (val ## U))
00181 #define INT16_C(val) ((int16_t) + (val))
00182 #define UINT16_C(val) ((uint16_t) + (val ## U))
00183 
00184 #define INT32_C(val) val ## L
00185 #define UINT32_C(val) val ## UL
00186 #define INT64_C(val) val ## LL
00187 #define UINT64_C(val) val ## ULL
00188 
00189 /* 7.18.4.2  Macros for greatest-width integer constants */
00190 #define INTMAX_C(val)  INT64_C(val)
00191 #define UINTMAX_C(val) UINT64_C(val)
00192 
00193 #endif  /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */
00194 
00195 #endif


bcap_core
Author(s): DENSO WAVE INCORPORATED
autogenerated on Thu Jun 6 2019 21:00:03