ORCA-C/ORCACDefs/limits.h
Stephen Heumann 31adb5f5d6 Update headers to support long long (and intmax_t typedef'd as long long).
This includes:
*Functions operating on long long in <stdlib.h>
*Limits of long long types in <limits.h>
*64-bit types and limits (plus intmax_t and its limits) in <stdint.h>
*New format codes, plus functions operating on intmax_t, in <inttypes.h>

The new stuff is generally conditionalized to only be included if __ORCAC_HAS_LONG_LONG__ is defined, or if the implementation claims to be C99 or later. This allows the headers to remain usable with older versions of ORCA/C, or with any hypothetical "strict C89" mode that might be implemented in the future.
2021-02-17 14:57:18 -06:00

39 lines
1014 B
C

/****************************************************************
*
* limits.h - limits on the size of numbers
*
* April 1989
* Mike Westerfield
*
* Copyright 1989
* Byte Works, Inc.
*
****************************************************************/
#ifndef __limits__
#define __limits__
#define CHAR_BIT 8
#define CHAR_MAX 255
#define CHAR_MIN 0
#define SHRT_MAX 32767
#define SHRT_MIN (-32767-1)
#define INT_MAX 32767
#define INT_MIN (-32767-1)
#define LONG_MAX 2147483647
#define LONG_MIN (-2147483647-1)
#define MB_LEN_MAX 1
#define SCHAR_MAX 127
#define SCHAR_MIN (-128)
#define UCHAR_MAX 255
#define UINT_MAX 65535u
#define ULONG_MAX 4294967295u
#define USHRT_MAX 65535u
#if defined(__ORCAC_HAS_LONG_LONG__) || __STDC_VERSION__ >= 199901L
#define LLONG_MIN (-9223372036854775807-1)
#define LLONG_MAX 9223372036854775807
#define ULLONG_MAX 18446744073709551615u
#endif
#endif