' ########################################################################################
' Microsoft C Runtime
' File: limits.inc
' Contents: defines for a number of implementation dependent values which are commonly
' used in C programs. [ANSI]
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_limits_PBI)
#DEFINE PBX_limits_PBI
%EQUATE `LIMITS_INC = 1
#INCLUDE ONCE "Legacy/Runtime/crtdefs.inc"
%EQUATE `CHAR_BIT = 8 ' /* number of bits in a char */
%EQUATE `SCHAR_MIN = -128% ' /* minimum signed char value */
%EQUATE `SCHAR_MAX = 127 ' /* maximum signed char value */
%EQUATE `UCHAR_MAX = &Hff ' /* maximum unsigned char value */
#IF NOT %DEF(%CHAR_UNSIGNED)
%EQUATE `CHAR_MIN = %SCHAR_MIN ' /* mimimum char value */
%EQUATE `CHAR_MAX = %SCHAR_MAX ' /* maximum char value */
#ELSE
%EQUATE `CHAR_MIN = 0
%EQUATE `CHAR_MAX = %UCHAR_MAX
#ENDIF ' /* _CHAR_UNSIGNED */
%EQUATE `MB_LEN_MAX = 5 ' /* max. # bytes in multibyte char */
%EQUATE `SHRT_MIN = -32768% ' /* minimum (signed) short value */
%EQUATE `SHRT_MAX = 32767% ' /* maximum (signed) short value */
%EQUATE `USHRT_MAX = &Hffff ' /* maximum unsigned short value */
%EQUATE `INT_MIN = -2147483647& - 1 ' /* minimum (signed) int value */
%EQUATE `INT_MAX = 2147483647& ' /* maximum (signed) int value */
%EQUATE `UINT_MAX = &Hffffffff ' /* maximum unsigned int value */
%EQUATE `LONG_MIN = -2147483647& - 1 ' /* minimum (signed) long value */
%EQUATE `LONG_MAX = 2147483647& ' /* maximum (signed) long value */
%EQUATE `ULONG_MAX = &Hffffffff ' /* maximum unsigned long value */
%EQUATE `LLONG_MAX = 9223372036854775807&& ' /* maximum signed long long int value */
%EQUATE `LLONG_MIN = -9223372036854775807&& - 1 ' /* minimum signed long long int value */
'#define ULLONG_MAX 0xffffffffffffffffui64 /* maximum unsigned long long int value */
'#ifndef SIZE_MAX
'#ifdef _WIN64
'#define SIZE_MAX _UI64_MAX
'#else
'#define SIZE_MAX UINT_MAX
%EQUATE `SIZE_MAX = %UINT_MAX
'#endif
'#endif
'#if __STDC_WANT_SECURE_LIB__
'/* While waiting to the C standard committee to finalize the decision on RSIZE_MAX and rsize_t,
' * we define RSIZE_MAX as SIZE_MAX
' */
'#ifndef RSIZE_MAX
'#define RSIZE_MAX SIZE_MAX
%EQUATE `RSIZE_MAX = %SIZE_MAX
'#endif
'#endif
#ENDIF
