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 b560899d84
commit 34b265df20
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 #else // ! WITH_GLIBC
#define CHAR_BIT 8 #include <stdint.h>
#define UCHAR_MAX 255
#define CHAR_MAX 255
#define UINT_MAX 4294967295U
#define ULONG_MAX 4294967295U
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define MB_CUR_MAX 1 #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 NAME_MAX 255
#define PATH_MAX 512
#define _POSIX_OPEN_MAX 16
#endif // ! WITH_GLIBC #endif // ! WITH_GLIBC

View file

@ -1,6 +1,7 @@
/* -*-comment-start: "//";comment-end:""-*- /* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software * GNU Mes --- Maxwell Equations of Software
* Copyright © 2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> * Copyright © 2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018 Peter De Wachter <pdewacht@gmail.com>
* *
* This file is part of GNU Mes. * This file is part of GNU Mes.
* *
@ -80,6 +81,40 @@ typedef unsigned* uintptr_t;
typedef long ptrdiff_t; typedef long ptrdiff_t;
#endif #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 // ! WITH_GLIBC
#endif // __MES_STDINT_H #endif // __MES_STDINT_H