// =====================================================================================================================
//  fennec, a free and open source game engine
//  Copyright © 2025  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/>.
// =====================================================================================================================

#ifndef FENNEC_LANG_DETAIL_NUMERIC_TRANSFORMS_H
#define FENNEC_LANG_DETAIL_NUMERIC_TRANSFORMS_H

#include <fennec/lang/types.h>
#include <fennec/lang/type_transforms.h>

namespace fennec
{

namespace detail
{

template<typename> struct __make_unsigned : type_transform<undefined_t> {};

template<> struct __make_unsigned<char_t>   : type_transform<uchar_t> {};
template<> struct __make_unsigned<uchar_t>  : type_transform<uchar_t> {};
template<> struct __make_unsigned<schar_t>  : type_transform<uchar_t> {};
template<> struct __make_unsigned<short_t>  : type_transform<ushort_t> {};
template<> struct __make_unsigned<ushort_t> : type_transform<ushort_t> {};
template<> struct __make_unsigned<uint_t>   : type_transform<uint_t> {};
template<> struct __make_unsigned<int_t>    : type_transform<uint_t> {};
template<> struct __make_unsigned<long_t>   : type_transform<ulong_t> {};
template<> struct __make_unsigned<ulong_t>  : type_transform<ulong_t> {};
template<> struct __make_unsigned<llong_t>  : type_transform<ullong_t> {};
template<> struct __make_unsigned<ullong_t> : type_transform<ullong_t> {};


template<typename> struct __make_signed : type_transform<undefined_t> {};

template<> struct __make_signed<char_t>   : type_transform<schar_t> {};
template<> struct __make_signed<uchar_t>  : type_transform<schar_t> {};
template<> struct __make_signed<schar_t>  : type_transform<schar_t> {};
template<> struct __make_signed<short_t>  : type_transform<short_t> {};
template<> struct __make_signed<ushort_t> : type_transform<short_t> {};
template<> struct __make_signed<uint_t>   : type_transform<int_t> {};
template<> struct __make_signed<int_t>    : type_transform<int_t> {};
template<> struct __make_signed<long_t>   : type_transform<long_t> {};
template<> struct __make_signed<ulong_t>  : type_transform<long_t> {};
template<> struct __make_signed<llong_t>  : type_transform<llong_t> {};
template<> struct __make_signed<ullong_t> : type_transform<llong_t> {};

}

}

#endif // FENNEC_LANG_DETAIL_NUMERIC_TRANSFORMS_H
