The GNU C Library is free software; you can redistribute it and/or. Modify it under the terms of the. ISO C99: 7.18 Integer types stdint.h. #ifndef STDINTH. This project fills the absence of stdint.h and inttypes.h in Microsoft Visual Studio. This files were standartized by ISO/IEC as a part of C99 standard library. If you want to compile or use C99 compliant project with Microsoft Visual Studio, you will likely find that you're missing these headers.
stdint.h
![Stdint.h Free Download Stdint.h Free Download](http://static2.iphonecake.com/appcake/appimg2/1404/1397778293-0.jpg)
/* |
* Copyright (c) 2000-2010 Apple Inc. |
* All rights reserved. |
*/ |
#ifndef _STDINT_H_ |
#define_STDINT_H_ |
#if __LP64__ |
#define__WORDSIZE64 |
#else |
#define__WORDSIZE32 |
#endif |
/* from ISO/IEC 988:1999 spec */ |
/* 7.18.1.1 Exact-width integer types */ |
#include<sys/_types/_int8_t.h> |
#include<sys/_types/_int16_t.h> |
#include<sys/_types/_int32_t.h> |
#include<sys/_types/_int64_t.h> |
#include<_types/_uint8_t.h> |
#include<_types/_uint16_t.h> |
#include<_types/_uint32_t.h> |
#include<_types/_uint64_t.h> |
/* 7.18.1.2 Minimum-width integer types */ |
typedefint8_tint_least8_t; |
typedefint16_tint_least16_t; |
typedefint32_tint_least32_t; |
typedefint64_tint_least64_t; |
typedefuint8_tuint_least8_t; |
typedefuint16_tuint_least16_t; |
typedefuint32_tuint_least32_t; |
typedefuint64_tuint_least64_t; |
/* 7.18.1.3 Fastest-width integer types */ |
typedefint8_tint_fast8_t; |
typedefint16_tint_fast16_t; |
typedefint32_tint_fast32_t; |
typedefint64_tint_fast64_t; |
typedefuint8_tuint_fast8_t; |
typedefuint16_tuint_fast16_t; |
typedefuint32_tuint_fast32_t; |
typedefuint64_tuint_fast64_t; |
/* 7.18.1.4 Integer types capable of holding object pointers */ |
#include<sys/_types.h> |
#include<sys/_types/_intptr_t.h> |
#include<sys/_types/_uintptr_t.h> |
/* 7.18.1.5 Greatest-width integer types */ |
#include<_types/_intmax_t.h> |
#include<_types/_uintmax_t.h> |
/* 7.18.2 Limits of specified-width integer types: |
* These #defines specify the minimum and maximum limits |
* of each of the types declared above. |
*/ |
/* 7.18.2.1 Limits of exact-width integer types */ |
#defineINT8_MAX127 |
#defineINT16_MAX32767 |
#defineINT32_MAX2147483647 |
#defineINT64_MAX9223372036854775807LL |
#defineINT8_MIN -128 |
#defineINT16_MIN -32768 |
/* |
Note: the literal 'most negative int' cannot be written in C -- |
the rules in the standard (section 6.4.4.1 in C99) will give it |
an unsigned type, so INT32_MIN (and the most negative member of |
any larger signed type) must be written via a constant expression. |
*/ |
#defineINT32_MIN (-INT32_MAX-1) |
#defineINT64_MIN (-INT64_MAX-1) |
#defineUINT8_MAX255 |
#defineUINT16_MAX65535 |
#defineUINT32_MAX4294967295U |
#defineUINT64_MAX18446744073709551615ULL |
/* 7.18.2.2 Limits of minimum-width integer types */ |
#defineINT_LEAST8_MIN INT8_MIN |
#defineINT_LEAST16_MIN INT16_MIN |
#defineINT_LEAST32_MIN INT32_MIN |
#defineINT_LEAST64_MIN INT64_MIN |
#defineINT_LEAST8_MAX INT8_MAX |
#defineINT_LEAST16_MAX INT16_MAX |
#defineINT_LEAST32_MAX INT32_MAX |
#defineINT_LEAST64_MAX INT64_MAX |
#defineUINT_LEAST8_MAX UINT8_MAX |
#defineUINT_LEAST16_MAX UINT16_MAX |
#defineUINT_LEAST32_MAX UINT32_MAX |
#defineUINT_LEAST64_MAX UINT64_MAX |
/* 7.18.2.3 Limits of fastest minimum-width integer types */ |
#defineINT_FAST8_MIN INT8_MIN |
#defineINT_FAST16_MIN INT16_MIN |
#defineINT_FAST32_MIN INT32_MIN |
#defineINT_FAST64_MIN INT64_MIN |
#defineINT_FAST8_MAX INT8_MAX |
#defineINT_FAST16_MAX INT16_MAX |
#defineINT_FAST32_MAX INT32_MAX |
#defineINT_FAST64_MAX INT64_MAX |
#defineUINT_FAST8_MAX UINT8_MAX |
#defineUINT_FAST16_MAX UINT16_MAX |
#defineUINT_FAST32_MAX UINT32_MAX |
#defineUINT_FAST64_MAX UINT64_MAX |
/* 7.18.2.4 Limits of integer types capable of holding object pointers */ |
#if __WORDSIZE 64 |
#defineINTPTR_MIN INT64_MIN |
#defineINTPTR_MAX INT64_MAX |
#else |
#defineINTPTR_MIN INT32_MIN |
#defineINTPTR_MAX INT32_MAX |
#endif |
#if __WORDSIZE 64 |
#defineUINTPTR_MAX UINT64_MAX |
#else |
#defineUINTPTR_MAX UINT32_MAX |
#endif |
/* 7.18.2.5 Limits of greatest-width integer types */ |
#defineINTMAX_MIN INT64_MIN |
#defineINTMAX_MAX INT64_MAX |
#defineUINTMAX_MAX UINT64_MAX |
/* 7.18.3 'Other' */ |
#if __WORDSIZE 64 |
#definePTRDIFF_MIN INT64_MIN |
#definePTRDIFF_MAX INT64_MAX |
#else |
#definePTRDIFF_MIN INT32_MIN |
#definePTRDIFF_MAX INT32_MAX |
#endif |
#if __WORDSIZE 64 |
#defineSIZE_MAX UINT64_MAX |
#else |
#defineSIZE_MAX UINT32_MAX |
#endif |
#if defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 |
#defineRSIZE_MAX (SIZE_MAX >> 1) |
#endif |
#ifndef WCHAR_MAX |
# ifdef __WCHAR_MAX__ |
# defineWCHAR_MAX __WCHAR_MAX__ |
# else |
# defineWCHAR_MAX0x7fffffff |
# endif |
#endif |
/* WCHAR_MIN should be 0 if wchar_t is an unsigned type and |
(-WCHAR_MAX-1) if wchar_t is a signed type. Unfortunately, |
it turns out that -fshort-wchar changes the signedness of |
the type. */ |
#ifndef WCHAR_MIN |
# if WCHAR_MAX 0xffff |
# defineWCHAR_MIN0 |
# else |
# defineWCHAR_MIN (-WCHAR_MAX-1) |
# endif |
#endif |
#defineWINT_MIN INT32_MIN |
#defineWINT_MAX INT32_MAX |
#defineSIG_ATOMIC_MIN INT32_MIN |
#defineSIG_ATOMIC_MAX INT32_MAX |
/* 7.18.4 Macros for integer constants */ |
#defineINT8_C(v) (v) |
#defineINT16_C(v) (v) |
#defineINT32_C(v) (v) |
#defineINT64_C(v) (v ## LL) |
#defineUINT8_C(v) (v ## U) |
#defineUINT16_C(v) (v ## U) |
#defineUINT32_C(v) (v ## U) |
#defineUINT64_C(v) (v ## ULL) |
#ifdef __LP64__ |
#defineINTMAX_C(v) (v ## L) |
#defineUINTMAX_C(v) (v ## UL) |
#else |
#defineINTMAX_C(v) (v ## LL) |
#defineUINTMAX_C(v) (v ## ULL) |
#endif |
#endif/* _STDINT_H_ */ |
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment