// Standard C++ <climits> header
// Copyright (C) Florian Negele

// This file is part of the Eigen Compiler Suite.

// The ECS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// The ECS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// Under Section 7 of the GNU General Public License version 3,
// the copyright holder grants you additional permissions to use
// this file as described in the ECS Runtime Support Exception.

// You should have received a copy of the GNU General Public License
// and a copy of the ECS Runtime Support Exception along with
// the ECS.  If not, see <https://www.gnu.org/licenses/>.

#ifndef ECS_CPP_CLIMITS_HEADER_INCLUDED
#define ECS_CPP_CLIMITS_HEADER_INCLUDED

#define CHAR_BIT 8
#define CHAR_MIN 0
#define CHAR_MAX 255
#define MB_LEN_MAX 4

#define SCHAR_MIN (-128)
#define SCHAR_MAX (+127)
#define UCHAR_MAX 255

#define SHRT_MIN (-32768)
#define SHRT_MAX (+32767)
#define USHRT_MAX 65535

#define LONG_MIN (-2147483648)
#define LONG_MAX (+2147483647)
#define ULONG_MAX 4294967295

#define LLONG_MIN (-9223372036854775808)
#define LLONG_MAX (+9223372036854775807)
#define ULLONG_MAX 18446744073709551615

#if __sizeof_int__ == __sizeof_short__
	#define INT_MIN SHRT_MIN
	#define INT_MAX SHRT_MAX
	#define UINT_MAX USHRT_MAX
#elif __sizeof_int__ == __sizeof_long__
	#define INT_MIN LONG_MIN
	#define INT_MAX LONG_MAX
	#define UINT_MAX ULONG_MAX
#else
	#error unsupported integer size
#endif

#endif // ECS_CPP_CLIMITS_HEADER_INCLUDED
