21#ifndef _SCHILY_STDINT_H
22#define _SCHILY_STDINT_H
24#ifndef _SCHILY_MCONFIG_H
31#ifndef _SCHILY_TYPES_H
38#ifndef _SCHILY_PARAM_H
45#ifndef _SCHILY_LIMITS_H
83#define TYPE_ISSIGNED(t) (((t)-1) < ((t)0))
84#define TYPE_ISUNSIGNED(t) (!TYPE_ISSIGNED(t))
85#define TYPE_MSBVAL(t) ((t)(~((t)0) << (sizeof (t)*CHAR_BIT - 1)))
86#define TYPE_MINVAL(t) (TYPE_ISSIGNED(t) \
89#define TYPE_MAXVAL(t) ((t)(~((t)0) - TYPE_MINVAL(t)))
104#ifdef __CHAR_UNSIGNED__
105#ifndef CHAR_IS_UNSIGNED
106#define CHAR_IS_UNSIGNED
120# if !defined(USE_LONGLONG) && defined(HAVE_LONGLONG)
123# if !defined(USE_LONGLONG) && defined(HAVE___INT64)
130# if defined(HAVE___INT64)
136#define SIZEOF_LLONG SIZEOF___INT64
137#define SIZEOF_ULLONG SIZEOF_UNSIGNED___INT64
141typedef long long Llong;
142typedef unsigned long long Ullong;
143typedef unsigned long long ULlong;
145#define SIZEOF_LLONG SIZEOF_LONG_LONG
146#define SIZEOF_ULLONG SIZEOF_UNSIGNED_LONG_LONG
156#define SIZEOF_LLONG SIZEOF_LONG
157#define SIZEOF_ULLONG SIZEOF_UNSIGNED_LONG
162#define LLONG_MIN TYPE_MINVAL(Llong)
165#define LLONG_MAX TYPE_MAXVAL(Llong)
168#define ULLONG_MAX TYPE_MAXVAL(Ullong)
180#if defined(HAVE_INTTYPES_H) || defined(HAVE_STDINT_H)
181#if defined(HAVE_INTTYPES_H)
182# ifndef _INCL_INTTYPES_H
183# include <inttypes.h>
184# define _INCL_INTTYPES_H
187#if defined(HAVE_STDINT_H)
188# ifndef _INCL_STDINT_H
190# define _INCL_STDINT_H
205# define HAVE_UINT64_T
209#define Int16_t int16_t
210#define Int32_t int32_t
212#define Int64_t int64_t
214#define Intmax_t intmax_t
215#define UInt8_t uint8_t
216#define UInt16_t uint16_t
217#define UInt32_t uint32_t
219#define UInt64_t uint64_t
221#define UIntmax_t uintmax_t
223#define Intptr_t intptr_t
224#define UIntptr_t uintptr_t
232#ifndef HAVE_TYPE_INTMAX_T
233#define intmax_t Llong
235#ifndef HAVE_TYPE_UINTMAX_T
236#define uintmax_t ULlong
249#if SIZEOF_CHAR != 1 || SIZEOF_UNSIGNED_CHAR != 1
257#include <schily/err_char.h>
260#if defined(__STDC__) || defined(CHAR_IS_UNSIGNED)
261 typedef signed char Int8_t;
266#if SIZEOF_SHORT_INT == 2
267 typedef short Int16_t;
271#include <schily/err_type.h>
275#if defined(_MSC_VER) && SIZEOF_LONG_INT == 4
276 typedef long Int32_t;
283#include <schily/err_type.h>
286#if SIZEOF_LONG_INT == 8
287 typedef long Int64_t;
290#if SIZEOF_LONG_LONG == 8
291 typedef long long Int64_t;
294#if SIZEOF___INT64 == 8
306#if SIZEOF_CHAR_P == SIZEOF_INT
309#if SIZEOF_CHAR_P == SIZEOF_LONG_INT
312#if SIZEOF_CHAR_P == SIZEOF_LLONG
317#include <schily/err_type.h>
324#if SIZEOF_UNSIGNED_SHORT_INT == 2
325 typedef unsigned short UInt16_t;
329#include <schily/err_type.h>
332#if SIZEOF_UNSIGNED_INT == 4
333#if defined(_MSC_VER) && SIZEOF_UNSIGNED_LONG_INT == 4
334 typedef unsigned long UInt32_t;
336 typedef unsigned int UInt32_t;
341#include <schily/err_type.h>
344#if SIZEOF_UNSIGNED_LONG_INT == 8
345 typedef unsigned long UInt64_t;
346# define HAVE_UINT64_T
348#if SIZEOF_UNSIGNED_LONG_LONG == 8
349 typedef unsigned long long UInt64_t;
350# define HAVE_UINT64_T
352#if SIZEOF_UNSIGNED___INT64 == 8
353 typedef unsigned __int64 UInt64_t;
354# define HAVE_UINT64_T
364#define Intmax_t Llong
365#define UIntmax_t Ullong
367#if SIZEOF_CHAR_P == SIZEOF_UNSIGNED_INT
370#if SIZEOF_CHAR_P == SIZEOF_UNSIGNED_LONG_INT
373#if SIZEOF_CHAR_P == SIZEOF_ULLONG
378#include <schily/err_type.h>
395#define int16_t Int16_t
397#define int32_t Int32_t
399#define int64_t Int64_t
401#define intmax_t Intmax_t
403#define uint8_t UInt8_t
405#define uint16_t UInt16_t
407#define uint32_t UInt32_t
409#define uint64_t UInt64_t
411#define uintmax_t UIntmax_t
414#define intptr_t Intptr_t
416#define uintptr_t UIntptr_t
426#define INT8_MIN TYPE_MINVAL(Int8_t)
429#define INT8_MAX TYPE_MAXVAL(Int8_t)
432#define UINT8_MAX TYPE_MAXVAL(UInt8_t)
436#define INT16_MIN TYPE_MINVAL(Int16_t)
439#define INT16_MAX TYPE_MAXVAL(Int16_t)
442#define UINT16_MAX TYPE_MAXVAL(UInt16_t)
446#define INT32_MIN TYPE_MINVAL(Int32_t)
449#define INT32_MAX TYPE_MAXVAL(Int32_t)
452#define UINT32_MAX TYPE_MAXVAL(UInt32_t)
457#define INT64_MIN TYPE_MINVAL(Int64_t)
460#define INT64_MAX TYPE_MAXVAL(Int64_t)
465#define UINT64_MAX TYPE_MAXVAL(UInt64_t)
470#define INTMAX_MIN TYPE_MINVAL(Intmax_t)
473#define INTMAX_MAX TYPE_MAXVAL(Intmax_t)
476#define UINTMAX_MAX TYPE_MAXVAL(UIntmax_t)
479#define SIZE_T_MIN TYPE_MINVAL(size_t)
483#define SIZE_T_MAX TYPE_MAXVAL(size_t)
485#define SSIZE_T_MIN TYPE_MINVAL(ssize_t)
486#define SSIZE_T_MAX TYPE_MAXVAL(ssize_t)
unsigned short int uint16_t