X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=includes%2Flimits.h;h=0d354959795e879c9db244cc74c03e09b8104627;hp=7d14a9330007371d87b118ae0695f3a7abe0242e;hb=1d9d92ba957a0b8307c9a65c35867fde68e6533b;hpb=70f1c6f7c9d515ef426da68973511f46de57005a diff --git a/includes/limits.h b/includes/limits.h index 7d14a93..0d35495 100644 --- a/includes/limits.h +++ b/includes/limits.h @@ -1,55 +1,59 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- -// Sizes of integer types -// ---------------------------------------------------------------------------- - -#ifndef __LIMITS_H -#define __LIMITS_H __LIMITS_H - -// ISO/IEC 9899:1999, §5.2.4.2.1 -// The values given below shall be replaced by constant expressions suitable -// for use in #if preprocessing directives. Moreover, except for CHAR_BIT and -// MB_LEN_MAX, the following shall be replaced by expressions that have the -// same type as would an expression that is an object of the corresponding type -// converted according to the integer promotions. Their implementation-defined -// values shall be equal or greater in magnitude (absolute value) to those -// shown, with the same sign. - -// This file is part of the platform personality (see personality.txt). - -// Limits of type 'char' -#define CHAR_BIT // 8 -#define CHAR_MAX // SCHAR_MAX / UCHAR_MAX -#define CHAR_MIN // SCHAR_MIN / 0 -#define SCHAR_MAX // +127 -#define SCHAR_MIN // -127 -#define UCHAR_MAX // 255 (2^CHAR_BIT - 1) - -// Multibyte characters -#define MB_LEN_MAX // 1 - -// Limits of type 'short int' -#define SHRT_MAX // +32767 -#define SHRT_MIN // -32767 -#define USHRT_MAX // 65535 - -// Limits of type 'int' -#define INT_MAX // +32767 -#define INT_MIN // -32767 -#define UINT_MAX // 65535 - -// Limits of type 'long int' -#define LONG_MAX // +2147483647 -#define LONG_MIN // -2147483647 -#define ULONG_MAX // 4294967295 - -// Limits of type 'long long int' -#define LLONG_MAX // +9223372036854775807 -#define LLONG_MIN // -9223372036854775807 -#define ULLONG_MAX // 18446744073709551615 - -#endif // __LIMITS_H +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * ---------------------------------------------------------------------------- + * Sizes of integer types + * ---------------------------------------------------------------------------- + * This header is part of a freestanding implementation + * --------------------------------------------------------------------------*/ + +#ifndef _LIMITS_H +#define _LIMITS_H _LIMITS_H + +/* ISO/IEC 9899:1999, §5.2.4.2.1 + * The values given below shall be replaced by constant expressions suitable + * for use in #if preprocessing directives. Moreover, except for CHAR_BIT and + * MB_LEN_MAX, the following shall be replaced by expressions that have the + * same type as would an expression that is an object of the corresponding type + * converted according to the integer promotions. Their implementation-defined + * values shall be equal or greater in magnitude (absolute value) to those + * shown, with the same sign. + */ + +/* This file is part of the platform personality, and is commonly generated + using the enquire utility (included). */ + +/* Limits of type 'char' */ +#define CHAR_BIT /* 8 */ +#define CHAR_MAX /* SCHAR_MAX / UCHAR_MAX */ +#define CHAR_MIN /* SCHAR_MIN / 0 */ +#define SCHAR_MAX /* +127 */ +#define SCHAR_MIN /* -127 */ +#define UCHAR_MAX /* 255 (2^CHAR_BIT - 1) */ + +/* Multibyte characters */ +#define MB_LEN_MAX /* 1 */ + +/* Limits of type 'short int' */ +#define SHRT_MAX /* +32767 */ +#define SHRT_MIN /* -32767 */ +#define USHRT_MAX /* 65535 */ + +/* Limits of type 'int' */ +#define INT_MAX /* +32767 */ +#define INT_MIN /* -32767 */ +#define UINT_MAX /* 65535 */ + +/* Limits of type 'long int' */ +#define LONG_MAX /* +2147483647 */ +#define LONG_MIN /* -2147483647 */ +#define ULONG_MAX /* 4294967295 */ + +/* Limits of type 'long long int' */ +#define LLONG_MAX /* +9223372036854775807 */ +#define LLONG_MIN /* -9223372036854775807 */ +#define ULLONG_MAX /* 18446744073709551615 */ + +#endif /* _LIMITS_H */