mescc: Add INTn_MIN/MAX defines to stdint.h.

* include/stdint.h: Add INTn_MIN/MAX defines.  Move integere size
defines from limits.h
* include/limits.h: Include it.
This commit is contained in:
Peter De Wachter 2018-10-16 20:40:41 +02:00 committed by Jan Nieuwenhuizen
parent b88d0121c6
commit bb5ad2e6f7
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
2 changed files with 39 additions and 11 deletions

View File

@ -29,19 +29,12 @@
#else // ! WITH_GLIBC
#define CHAR_BIT 8
#define UCHAR_MAX 255
#define CHAR_MAX 255
#define UINT_MAX 4294967295U
#define ULONG_MAX 4294967295U
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#include <stdint.h>
#define MB_CUR_MAX 1
#define LONG_MIN -2147483648
#define LONG_MAX 2147483647
#define _POSIX_OPEN_MAX 16
#define PATH_MAX 512
#define NAME_MAX 255
#define PATH_MAX 512
#define _POSIX_OPEN_MAX 16
#endif // ! WITH_GLIBC

View File

@ -1,6 +1,7 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018 Peter De Wachter <pdewacht@gmail.com>
*
* This file is part of GNU Mes.
*
@ -80,6 +81,40 @@ typedef unsigned* uintptr_t;
typedef long ptrdiff_t;
#endif
#define CHAR_BIT 8
#define CHAR_MAX 255
#define UCHAR_MAX 255
#define INT8_MAX 127
#define INT8_MIN (-INT8_MAX-1)
#define UINT8_MAX 255
#define INT16_MAX 32767
#define INT16_MIN (-INT16_MAX-1)
#define UINT16_MAX 65535
#define INT32_MAX 2147483647
#define INT32_MIN (-INT32_MAX-1)
#define UINT32_MAX 4294967295U
#define INT64_MAX 9223372036854775807LL
#define INT64_MIN (-INT64_MAX-1)
#define UINT64_MAX 18446744073709551615ULL
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#if __i386__
#define LONG_MIN INT_MIN
#define LONG_MAX INT_MAX
#define UINT_MAX UINT32_MAX
#define ULONG_MAX UINT32_MAX
#elif __x86_64__
#define LONG_MIN INT64_MIN
#define LONG_MAX INT64_MAX
#define UINT_MAX UINT32_MAX
#define ULONG_MAX UINT64_MAX
#endif
#endif // ! WITH_GLIBC
#endif // __MES_STDINT_H