2013-10-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/include/machine/_default_types.h (__int8_t): Define via <stdint.h> provided type. (__uint8_t): Likewise. (__int8_least_t): Likewise. (__uint8_least_t): Likewise. (__int16_t): Likewise. (__uint16_t): Likewise. (__int16_least_t): Likewise. (__uint16_least_t): Likewise. (__int32_t): Likewise. (__uint32_t): Likewise. (__int32_least_t): Likewise. (__uint32_least_t): Likewise. (__int64_t): Likewise. (__uint64_t): Likewise.
This commit is contained in:
parent
50588a20d4
commit
6a0563a2e3
@ -1,3 +1,21 @@
|
|||||||
|
2013-10-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||||
|
|
||||||
|
* libc/include/machine/_default_types.h (__int8_t): Define via
|
||||||
|
<stdint.h> provided type.
|
||||||
|
(__uint8_t): Likewise.
|
||||||
|
(__int8_least_t): Likewise.
|
||||||
|
(__uint8_least_t): Likewise.
|
||||||
|
(__int16_t): Likewise.
|
||||||
|
(__uint16_t): Likewise.
|
||||||
|
(__int16_least_t): Likewise.
|
||||||
|
(__uint16_least_t): Likewise.
|
||||||
|
(__int32_t): Likewise.
|
||||||
|
(__uint32_t): Likewise.
|
||||||
|
(__int32_least_t): Likewise.
|
||||||
|
(__uint32_least_t): Likewise.
|
||||||
|
(__int64_t): Likewise.
|
||||||
|
(__uint64_t): Likewise.
|
||||||
|
|
||||||
2013-10-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
2013-10-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||||
|
|
||||||
* libc/include/paths.h (_PATH_DEVNULL): Define.
|
* libc/include/paths.h (_PATH_DEVNULL): Define.
|
||||||
|
@ -5,114 +5,40 @@
|
|||||||
#ifndef _MACHINE__DEFAULT_TYPES_H
|
#ifndef _MACHINE__DEFAULT_TYPES_H
|
||||||
#define _MACHINE__DEFAULT_TYPES_H
|
#define _MACHINE__DEFAULT_TYPES_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
typedef int8_t __int8_t ;
|
||||||
* Guess on types by examining *_MIN / *_MAX defines.
|
typedef uint8_t __uint8_t ;
|
||||||
*/
|
|
||||||
#if __GNUC_PREREQ (3, 3)
|
|
||||||
/* GCC >= 3.3.0 has __<val>__ implicitly defined. */
|
|
||||||
#define __EXP(x) __##x##__
|
|
||||||
#else
|
|
||||||
/* Fall back to POSIX versions from <limits.h> */
|
|
||||||
#define __EXP(x) x
|
|
||||||
#include <limits.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if __EXP(SCHAR_MAX) == 0x7f
|
|
||||||
typedef signed char __int8_t ;
|
|
||||||
typedef unsigned char __uint8_t ;
|
|
||||||
#define ___int8_t_defined 1
|
#define ___int8_t_defined 1
|
||||||
#endif
|
|
||||||
|
|
||||||
#if __EXP(INT_MAX) == 0x7fff
|
typedef int_least8_t __int_least8_t;
|
||||||
typedef signed int __int16_t;
|
typedef uint_least8_t __uint_least8_t;
|
||||||
typedef unsigned int __uint16_t;
|
#define ___int_least8_t_defined 1
|
||||||
#define ___int16_t_defined 1
|
|
||||||
#elif __EXP(SHRT_MAX) == 0x7fff
|
|
||||||
typedef signed short __int16_t;
|
|
||||||
typedef unsigned short __uint16_t;
|
|
||||||
#define ___int16_t_defined 1
|
|
||||||
#elif __EXP(SCHAR_MAX) == 0x7fff
|
|
||||||
typedef signed char __int16_t;
|
|
||||||
typedef unsigned char __uint16_t;
|
|
||||||
#define ___int16_t_defined 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if ___int16_t_defined
|
typedef int16_t __int16_t;
|
||||||
typedef __int16_t __int_least16_t;
|
typedef uint16_t __uint16_t;
|
||||||
typedef __uint16_t __uint_least16_t;
|
#define ___int16_t_defined 1
|
||||||
|
|
||||||
|
typedef int_least16_t __int_least16_t;
|
||||||
|
typedef uint_least16_t __uint_least16_t;
|
||||||
#define ___int_least16_t_defined 1
|
#define ___int_least16_t_defined 1
|
||||||
|
|
||||||
#if !___int8_t_defined
|
typedef int32_t __int32_t;
|
||||||
typedef __int16_t __int_least8_t;
|
typedef uint32_t __uint32_t;
|
||||||
typedef __uint16_t __uint_least8_t;
|
#define ___int32_t_defined 1
|
||||||
#define ___int_least8_t_defined 1
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if __EXP(INT_MAX) == 0x7fffffffL
|
typedef int_least32_t __int_least32_t;
|
||||||
typedef signed int __int32_t;
|
typedef uint_least32_t __uint_least32_t;
|
||||||
typedef unsigned int __uint32_t;
|
|
||||||
#define ___int32_t_defined 1
|
|
||||||
#elif __EXP(LONG_MAX) == 0x7fffffffL
|
|
||||||
typedef signed long __int32_t;
|
|
||||||
typedef unsigned long __uint32_t;
|
|
||||||
#define ___int32_t_defined 1
|
|
||||||
#elif __EXP(SHRT_MAX) == 0x7fffffffL
|
|
||||||
typedef signed short __int32_t;
|
|
||||||
typedef unsigned short __uint32_t;
|
|
||||||
#define ___int32_t_defined 1
|
|
||||||
#elif __EXP(SCHAR_MAX) == 0x7fffffffL
|
|
||||||
typedef signed char __int32_t;
|
|
||||||
typedef unsigned char __uint32_t;
|
|
||||||
#define ___int32_t_defined 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if ___int32_t_defined
|
|
||||||
typedef __int32_t __int_least32_t;
|
|
||||||
typedef __uint32_t __uint_least32_t;
|
|
||||||
#define ___int_least32_t_defined 1
|
#define ___int_least32_t_defined 1
|
||||||
|
|
||||||
#if !___int8_t_defined
|
typedef int64_t __int64_t;
|
||||||
typedef __int32_t __int_least8_t;
|
typedef uint64_t __uint64_t;
|
||||||
typedef __uint32_t __uint_least8_t;
|
|
||||||
#define ___int_least8_t_defined 1
|
|
||||||
#endif
|
|
||||||
#if !___int16_t_defined
|
|
||||||
typedef __int32_t __int_least16_t;
|
|
||||||
typedef __uint32_t __uint_least16_t;
|
|
||||||
#define ___int_least16_t_defined 1
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if __EXP(LONG_MAX) > 0x7fffffff
|
|
||||||
typedef signed long __int64_t;
|
|
||||||
typedef unsigned long __uint64_t;
|
|
||||||
#define ___int64_t_defined 1
|
#define ___int64_t_defined 1
|
||||||
|
|
||||||
/* GCC has __LONG_LONG_MAX__ */
|
|
||||||
#elif defined(__LONG_LONG_MAX__) && (__LONG_LONG_MAX__ > 0x7fffffff)
|
|
||||||
typedef signed long long __int64_t;
|
|
||||||
typedef unsigned long long __uint64_t;
|
|
||||||
#define ___int64_t_defined 1
|
|
||||||
|
|
||||||
/* POSIX mandates LLONG_MAX in <limits.h> */
|
|
||||||
#elif defined(LLONG_MAX) && (LLONG_MAX > 0x7fffffff)
|
|
||||||
typedef signed long long __int64_t;
|
|
||||||
typedef unsigned long long __uint64_t;
|
|
||||||
#define ___int64_t_defined 1
|
|
||||||
|
|
||||||
#elif __EXP(INT_MAX) > 0x7fffffff
|
|
||||||
typedef signed int __int64_t;
|
|
||||||
typedef unsigned int __uint64_t;
|
|
||||||
#define ___int64_t_defined 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#undef __EXP
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user