OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.17.0/] [newlib/] [libc/] [sys/] [linux/] [sys/] [stdint.h] - Diff between revs 148 and 158

Only display areas with differences | Details | Blame | View Log

Rev 148 Rev 158
/*
/*
 * Copyright (c) 2004, 2005 by
 * Copyright (c) 2004, 2005 by
 * Ralf Corsepius, Ulm/Germany. All rights reserved.
 * Ralf Corsepius, Ulm/Germany. All rights reserved.
 *
 *
 * Permission to use, copy, modify, and distribute this software
 * Permission to use, copy, modify, and distribute this software
 * is freely granted, provided that this notice is preserved.
 * is freely granted, provided that this notice is preserved.
 */
 */
 
 
/*
/*
 * @todo - Add fast<N>_t types.
 * @todo - Add fast<N>_t types.
 * @todo - Add support for wint_t types.
 * @todo - Add support for wint_t types.
 */
 */
 
 
#ifndef _STDINT_H
#ifndef _STDINT_H
#define _STDINT_H
#define _STDINT_H
 
 
#include <sys/types.h>
#include <sys/types.h>
 
 
#ifdef __cplusplus
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
#endif
 
 
#if defined(__GNUC__) && (__GNUC__ >= 3 ) \
#if defined(__GNUC__) && (__GNUC__ >= 3 ) \
  && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ > 2 )
  && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ > 2 )
#define __STDINT_EXP(x) __##x##__
#define __STDINT_EXP(x) __##x##__
#else
#else
#define __STDINT_EXP(x) x
#define __STDINT_EXP(x) x
#include <limits.h>
#include <limits.h>
#endif
#endif
 
 
#if __STDINT_EXP(SCHAR_MAX) == 0x7f
#if __STDINT_EXP(SCHAR_MAX) == 0x7f
#define __int8_t_defined 1
#define __int8_t_defined 1
#endif
#endif
 
 
#if __int8_t_defined
#if __int8_t_defined
typedef signed char int_least8_t;
typedef signed char int_least8_t;
typedef unsigned char uint_least8_t;
typedef unsigned char uint_least8_t;
#define __int_least8_t_defined 1
#define __int_least8_t_defined 1
#endif
#endif
 
 
#if __STDINT_EXP(SHRT_MAX) == 0x7fff
#if __STDINT_EXP(SHRT_MAX) == 0x7fff
#define __int16_t_defined 1
#define __int16_t_defined 1
#elif __STDINT_EXP(INT_MAX) == 0x7fff
#elif __STDINT_EXP(INT_MAX) == 0x7fff
#define __int16_t_defined 1
#define __int16_t_defined 1
#elif __STDINT_EXP(SCHAR_MAX) == 0x7fff
#elif __STDINT_EXP(SCHAR_MAX) == 0x7fff
#define __int16_t_defined 1
#define __int16_t_defined 1
#endif
#endif
 
 
#if __int16_t_defined
#if __int16_t_defined
typedef int16_t         int_least16_t;
typedef int16_t         int_least16_t;
typedef uint16_t        uint_least16_t;
typedef uint16_t        uint_least16_t;
#define __int_least16_t_defined 1
#define __int_least16_t_defined 1
 
 
#ifndef __int_least8_t_defined
#ifndef __int_least8_t_defined
typedef int16_t         int_least8_t;
typedef int16_t         int_least8_t;
typedef uint16_t        uint_least8_t;
typedef uint16_t        uint_least8_t;
#define __int_least8_t_defined 1
#define __int_least8_t_defined 1
#endif
#endif
#endif
#endif
 
 
#if __STDINT_EXP(INT_MAX) == 0x7fffffffL
#if __STDINT_EXP(INT_MAX) == 0x7fffffffL
#define __int32_t_defined 1
#define __int32_t_defined 1
#elif __STDINT_EXP(LONG_MAX) == 0x7fffffffL
#elif __STDINT_EXP(LONG_MAX) == 0x7fffffffL
#define __int32_t_defined 1
#define __int32_t_defined 1
#define __have_long32 1
#define __have_long32 1
#elif __STDINT_EXP(SHRT_MAX) == 0x7fffffffL
#elif __STDINT_EXP(SHRT_MAX) == 0x7fffffffL
#define __int32_t_defined 1
#define __int32_t_defined 1
#elif __STDINT_EXP(SCHAR_MAX) == 0x7fffffffL
#elif __STDINT_EXP(SCHAR_MAX) == 0x7fffffffL
#define __int32_t_defined 1
#define __int32_t_defined 1
#endif
#endif
 
 
#if __int32_t_defined
#if __int32_t_defined
typedef int32_t         int_least32_t;
typedef int32_t         int_least32_t;
typedef uint32_t        uint_least32_t;
typedef uint32_t        uint_least32_t;
#define __int_least32_t_defined 1
#define __int_least32_t_defined 1
 
 
#ifndef __int_least8_t_defined
#ifndef __int_least8_t_defined
typedef int32_t         int_least8_t;
typedef int32_t         int_least8_t;
typedef uint32_t        uint_least8_t;
typedef uint32_t        uint_least8_t;
#define __int_least8_t_defined 1
#define __int_least8_t_defined 1
#endif
#endif
 
 
#ifndef __int_least16_t_defined
#ifndef __int_least16_t_defined
typedef int32_t         int_least16_t;
typedef int32_t         int_least16_t;
typedef uint32_t        uint_least16_t;
typedef uint32_t        uint_least16_t;
#define __int_least16_t_defined 1
#define __int_least16_t_defined 1
#endif
#endif
#endif
#endif
 
 
#if __STDINT_EXP(LONG_MAX) > 0x7fffffff
#if __STDINT_EXP(LONG_MAX) > 0x7fffffff
#define __int64_t_defined 1
#define __int64_t_defined 1
#define __have_long64 1
#define __have_long64 1
#elif  defined(__LONG_LONG_MAX__) && (__LONG_LONG_MAX__ > 0x7fffffff)
#elif  defined(__LONG_LONG_MAX__) && (__LONG_LONG_MAX__ > 0x7fffffff)
#define __int64_t_defined 1
#define __int64_t_defined 1
#define __have_longlong64 1
#define __have_longlong64 1
#elif  defined(LLONG_MAX) && (LLONG_MAX > 0x7fffffff)
#elif  defined(LLONG_MAX) && (LLONG_MAX > 0x7fffffff)
#define __int64_t_defined 1
#define __int64_t_defined 1
#define __have_longlong64 1
#define __have_longlong64 1
#elif  __STDINT_EXP(INT_MAX) > 0x7fffffff
#elif  __STDINT_EXP(INT_MAX) > 0x7fffffff
#define __int64_t_defined 1
#define __int64_t_defined 1
#endif
#endif
 
 
#if __int64_t_defined
#if __int64_t_defined
typedef int64_t         int_least64_t;
typedef int64_t         int_least64_t;
typedef uint64_t        uint_least64_t;
typedef uint64_t        uint_least64_t;
#define __int_least64_t_defined 1
#define __int_least64_t_defined 1
 
 
#ifndef __int_least8_t_defined
#ifndef __int_least8_t_defined
typedef int64_t         int_least8_t;
typedef int64_t         int_least8_t;
typedef uint64_t        uint_least8_t;
typedef uint64_t        uint_least8_t;
#define __int_least8_t_defined 1
#define __int_least8_t_defined 1
#endif
#endif
 
 
#ifndef __int_least16_t_defined
#ifndef __int_least16_t_defined
typedef int64_t         int_least16_t;
typedef int64_t         int_least16_t;
typedef uint64_t        uint_least16_t;
typedef uint64_t        uint_least16_t;
#define __int_least16_t_defined 1
#define __int_least16_t_defined 1
#endif
#endif
 
 
#ifndef __int_least32_t_defined
#ifndef __int_least32_t_defined
typedef int64_t         int_least32_t;
typedef int64_t         int_least32_t;
typedef uint64_t        uint_least32_t;
typedef uint64_t        uint_least32_t;
#define __int_least32_t_defined 1
#define __int_least32_t_defined 1
#endif
#endif
#endif
#endif
 
 
#if __have_longlong64
#if __have_longlong64
typedef signed long long intmax_t;
typedef signed long long intmax_t;
typedef unsigned long long uintmax_t;
typedef unsigned long long uintmax_t;
#else
#else
typedef signed long intmax_t;
typedef signed long intmax_t;
typedef unsigned long uintmax_t;
typedef unsigned long uintmax_t;
#endif
#endif
 
 
/* Limits of Specified-Width Integer Types */
/* Limits of Specified-Width Integer Types */
 
 
#if __int8_t_defined
#if __int8_t_defined
#define INT8_MIN        -128
#define INT8_MIN        -128
#define INT8_MAX         127
#define INT8_MAX         127
#define UINT8_MAX        255
#define UINT8_MAX        255
#endif
#endif
 
 
#if __int_least8_t_defined
#if __int_least8_t_defined
#define INT_LEAST8_MIN  -128
#define INT_LEAST8_MIN  -128
#define INT_LEAST8_MAX   127
#define INT_LEAST8_MAX   127
#define UINT_LEAST8_MAX  255
#define UINT_LEAST8_MAX  255
#else
#else
#error required type int_least8_t missing
#error required type int_least8_t missing
#endif
#endif
 
 
#if __int16_t_defined
#if __int16_t_defined
#define INT16_MIN       -32768
#define INT16_MIN       -32768
#define INT16_MAX        32767
#define INT16_MAX        32767
#define UINT16_MAX       65535
#define UINT16_MAX       65535
#endif
#endif
 
 
#if __int_least16_t_defined
#if __int_least16_t_defined
#define INT_LEAST16_MIN -32768
#define INT_LEAST16_MIN -32768
#define INT_LEAST16_MAX  32767
#define INT_LEAST16_MAX  32767
#define UINT_LEAST16_MAX 65535
#define UINT_LEAST16_MAX 65535
#else
#else
#error required type int_least16_t missing
#error required type int_least16_t missing
#endif
#endif
 
 
#if __int32_t_defined
#if __int32_t_defined
#define INT32_MIN        (-2147483647-1)
#define INT32_MIN        (-2147483647-1)
#define INT32_MAX        2147483647
#define INT32_MAX        2147483647
#define UINT32_MAX       4294967295U
#define UINT32_MAX       4294967295U
#endif
#endif
 
 
#if __int_least32_t_defined
#if __int_least32_t_defined
#define INT_LEAST32_MIN  (-2147483647-1)
#define INT_LEAST32_MIN  (-2147483647-1)
#define INT_LEAST32_MAX  2147483647
#define INT_LEAST32_MAX  2147483647
#define UINT_LEAST32_MAX 4294967295U
#define UINT_LEAST32_MAX 4294967295U
#else
#else
#error required type int_least32_t missing
#error required type int_least32_t missing
#endif
#endif
 
 
#if __int64_t_defined
#if __int64_t_defined
#ifdef __have_long64
#ifdef __have_long64
#define INT64_MIN       (-9223372036854775807L-1L)
#define INT64_MIN       (-9223372036854775807L-1L)
#define INT64_MAX        9223372036854775807L
#define INT64_MAX        9223372036854775807L
#define UINT64_MAX      18446744073709551615U
#define UINT64_MAX      18446744073709551615U
#elif __have_longlong64
#elif __have_longlong64
#define INT64_MIN       (-9223372036854775807LL-1LL)
#define INT64_MIN       (-9223372036854775807LL-1LL)
#define INT64_MAX        9223372036854775807LL
#define INT64_MAX        9223372036854775807LL
#define UINT64_MAX      18446744073709551615ULL
#define UINT64_MAX      18446744073709551615ULL
#endif
#endif
#endif
#endif
 
 
#if __int_least64_t_defined
#if __int_least64_t_defined
#ifdef __have_long64
#ifdef __have_long64
#define INT_LEAST64_MIN  (-9223372036854775807L-1L)
#define INT_LEAST64_MIN  (-9223372036854775807L-1L)
#define INT_LEAST64_MAX  9223372036854775807L
#define INT_LEAST64_MAX  9223372036854775807L
#define UINT_LEAST64_MAX 18446744073709551615U
#define UINT_LEAST64_MAX 18446744073709551615U
#elif __have_longlong64
#elif __have_longlong64
#define INT_LEAST64_MIN  (-9223372036854775807LL-1LL)
#define INT_LEAST64_MIN  (-9223372036854775807LL-1LL)
#define INT_LEAST64_MAX  9223372036854775807LL
#define INT_LEAST64_MAX  9223372036854775807LL
#define UINT_LEAST64_MAX 18446744073709551615ULL
#define UINT_LEAST64_MAX 18446744073709551615ULL
#endif
#endif
#endif
#endif
 
 
/* This must match size_t in stddef.h, currently long unsigned int */
/* This must match size_t in stddef.h, currently long unsigned int */
#define SIZE_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1)
#define SIZE_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1)
 
 
/* This must match sig_atomic_t in <signal.h> (currently int) */
/* This must match sig_atomic_t in <signal.h> (currently int) */
#define SIG_ATOMIC_MIN (-__STDINT_EXP(INT_MAX) - 1)
#define SIG_ATOMIC_MIN (-__STDINT_EXP(INT_MAX) - 1)
#define SIG_ATOMIC_MAX __STDINT_EXP(INT_MAX)
#define SIG_ATOMIC_MAX __STDINT_EXP(INT_MAX)
 
 
/* This must match ptrdiff_t  in <stddef.h> (currently long int) */
/* This must match ptrdiff_t  in <stddef.h> (currently long int) */
#define PTRDIFF_MIN (-__STDINT_EXP(LONG_MAX) - 1L)
#define PTRDIFF_MIN (-__STDINT_EXP(LONG_MAX) - 1L)
#define PTRDIFF_MAX __STDINT_EXP(LONG_MAX)
#define PTRDIFF_MAX __STDINT_EXP(LONG_MAX)
 
 
/** Macros for minimum-width integer constant expressions */
/** Macros for minimum-width integer constant expressions */
#define INT8_C(x)       x
#define INT8_C(x)       x
#define UINT8_C(x)      x##U
#define UINT8_C(x)      x##U
 
 
#define INT16_C(x)      x
#define INT16_C(x)      x
#define UINT16_C(x)     x##U
#define UINT16_C(x)     x##U
 
 
#if __have_long32
#if __have_long32
#define INT32_C(x)      x##L
#define INT32_C(x)      x##L
#define UINT32_C(x)     x##UL
#define UINT32_C(x)     x##UL
#else
#else
#define INT32_C(x)      x
#define INT32_C(x)      x
#define UINT32_C(x)     x##U
#define UINT32_C(x)     x##U
#endif
#endif
 
 
#if __int64_t_defined
#if __int64_t_defined
#if __have_longlong64
#if __have_longlong64
#define INT64_C(x)      x##LL
#define INT64_C(x)      x##LL
#define UINT64_C(x)     x##ULL
#define UINT64_C(x)     x##ULL
#else
#else
#define INT64_C(x)      x##L
#define INT64_C(x)      x##L
#define UINT64_C(x)     x##UL
#define UINT64_C(x)     x##UL
#endif
#endif
#endif
#endif
 
 
/** Macros for greatest-width integer constant expression */
/** Macros for greatest-width integer constant expression */
#if __have_longlong64
#if __have_longlong64
#define INTMAX_C(x)     x##LL
#define INTMAX_C(x)     x##LL
#define UINTMAX_C(x)    x##ULL
#define UINTMAX_C(x)    x##ULL
#else
#else
#define INTMAX_C(x)     x##L
#define INTMAX_C(x)     x##L
#define UINTMAX_C(x)    x##UL
#define UINTMAX_C(x)    x##UL
#endif
#endif
 
 
 
 
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
 
 
#endif /* _STDINT_H */
#endif /* _STDINT_H */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.