// =====================================================================================================================
//  fennec, a free and open source game engine
//  Copyright © 2025 - 2026  Medusa Slockbower
//
//  This program 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.
//
//  This program 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.
//
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <https://www.gnu.org/licenses/>.
// =====================================================================================================================

///
/// \file fennec/lang/types.h
/// \brief \ref fennec_lang_types
///
///
/// \details
/// \author Medusa Slockbower
///
/// \copyright Copyright © 2025 - 2026 Medusa Slockbower ([GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html))
///
///

#ifndef FENNEC_LANG_TYPES_H
#define FENNEC_LANG_TYPES_H

///
/// \page fennec_lang_types Types
///
/// \code #include <fennec/lang/types.h> \endcode
///
/// \brief This header contains definitions for the built-in types of the C++ language.
///
/// <table width="100%" class="fieldtable" id="table_fennec_lang_types">
/// <tr><th style="vertical-align: top">Type
///     <th style="vertical-align: top">Description
/// <tr><th colspan=2 style="text-align: center;">Basic Types
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::bool_t "bool_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::bool_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::char_t "char_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::char_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::schar_t "schar_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::schar_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::uchar_t "uchar_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::uchar_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::short_t "short_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::short_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::ushort_t "ushort_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::ushort_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::int_t "int_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::int_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::uint_t "uint_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::uint_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::long_t "long_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::long_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::ulong_t "ulong_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::ulong_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::llong_t "llong_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::llong_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::ullong_t "ullong_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::ullong_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::float_t "float_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::float_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::double_t "double_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::double_t
///
/// <tr><th colspan=2 style="text-align: center;">Sized Arithmetic Types
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::int8_t "int8_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::int8_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::int16_t "int16_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::int16_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::int32_t "int32_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::int32_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::int64_t "int64_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::int64_t
///
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::uint8_t "uint8_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::uint8_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::uint16_t "uint16_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::uint16_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::uint32_t "uint32_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::uint32_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::uint64_t "uint64_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::int64_t
///
///
/// <tr><th colspan=2 style="text-align: center;">Special Types
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::nullptr_t "nullptr_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::nullptr_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::intptr_t "intptr_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::intptr_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::uintptr_t "uintptr_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::uintptr_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::intmax_t "intmax_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::intmax_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::uintmax_t "uintmax_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::uintmax_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::size_t "size_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::size_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::ptrdiff_t "ptrdiff_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::ptrdiff_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::empty_t "empty_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::empty_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::undefined_t "undefined_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::undefined_t
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
///		<tt>\ref fennec::void_t "void_t"</tt>
///     <td width="50%" style="vertical-align: top">
///     \copybrief fennec::void_t
///
///
/// </table>
///
///

#include <fennec/lang/detail/_int.h>

namespace fennec
{
	// Basic Types =========================================================================================================

	///
	/// \name Basic Types
	/// @{

	using bool_t = bool; //!< \brief A conditional type.

	using byte_t = unsigned char; //!< \brief A type capable of holding a single byte.

	using char_t  = char;          //!< \brief A type capable of holding an ascii value.
	using schar_t = signed char;   //!< \brief A type with the size of a char, capable of holding a signed 8-bit integer.
	using uchar_t = unsigned char; //!< \brief A type with the size of a char, capable of holding an unsigned 8-bit integer.

	using short_t = signed short;    //!< \brief A signed short type, capable of holding signed 16-bit integer.
	using ushort_t = unsigned short; //!< \brief An unsigned short type, capable of holding an unsigned signed 16-bit integer.

	using int_t = signed int;    //!< \brief A signed integer type, size varies by implementation, but typically 32-bit.
	using uint_t = unsigned int; //!< \brief An unsigned integer type, size varies by implementation, but typically 32-bit.

	using long_t  = signed long;   //!< \brief A signed integer type, with a size of at least 32-bits.
	using ulong_t = unsigned long; //!< \brief An unsigned integer type, with a size of at least 32-bits.

	using llong_t  = signed long long;   //!< \brief A signed integer type, with a size of 64-bits.
	using ullong_t = unsigned long long; //!< \brief An unsigned integer type, with a size of 64-bits.

	using float_t = float;   //!< \brief A single-precision floating-point type, typically with a size of 32-bits.
	using double_t = double; //!< \brief A double-precision floating-point type, typically with a size of 64-bits.

	/// @}



	///
	/// \name Special Types
	/// @{

	using  nullptr_t = decltype(nullptr); //!< \brief Null Pointer Type.
	using  intptr_t  = intptr_t;          //!< \brief Signed Integer Capable of Holding a Pointer to void.
	using  uintptr_t = uintptr_t;         //!< \brief Unsigned Integer Capable of Holding a Pointer to void.
	using  intmax_t  = intmax_t;          //!< \brief Maximum Width Signed Integer Type.
	using  uintmax_t = uintmax_t;         //!< \brief Maximum Width Unsigned Integer Type.
	using  size_t    = size_t;            //!< \brief Unsigned Integer Type Returned By `sizeof`, `sizeof...`, and `alignof`.
	using  ptrdiff_t = __PTRDIFF_TYPE__;  //!< \brief Signed Integer Type Returned by the Subtraction of two Pointers.
	struct empty_t     {};                //!< \brief A struct resembling an empty type.


	class undefined_t;                         //!< \brief Undefined class for SFINAE.
	template<typename...> using void_t = void; //!< \brief Void type used for SFINAE.

	/// @}


	// Sized Arithmetic Types ==============================================================================================

	///
	/// \name Sized Integer Types
	/// @{

	using int8_t  = ::int8_t;  //!< \brief Signed 8-bit integer.
	using int16_t = ::int16_t; //!< \brief Signed 16-bit integer.
	using int32_t = ::int32_t; //!< \brief Signed 32-bit integer.
	using int64_t = ::int64_t; //!< \brief Signed 64-bit integer.

	using uint8_t  = ::uint8_t;  //!< \brief Unsigned 8-bit integer.
	using uint16_t = ::uint16_t; //!< \brief Unsigned 16-bit integer.
	using uint32_t = ::uint32_t; //!< \brief Unsigned 32-bit integer.
	using uint64_t = ::uint64_t; //!< \brief Unsigned 64-bit integer.

	/// @}



	///
	/// \name Sized Floating-Point Types
	/// @{

	//using float16_t = _Float16; //!< \brief A half-precision floating-point scalar
	//using float32_t = _Float32; //!< \brief A single-precision floating-point scalar
	//using float64_t = _Float64; //!< \brief A double-precision floating-point scalar

	/// @}

}

#endif // FENNEC_LANG_TYPES_H
