Kernel/include/std.hpp

60 lines
1.4 KiB
C++

/* This function includes all the standard headers and defines some useful macros.
* Note: This std implementation is not complete.
*/
#ifndef __FENNIX_KERNEL_STD_H__
#define __FENNIX_KERNEL_STD_H__
#include <types.h>
#include <std/unordered_map.hpp>
#include <std/functional.hpp>
#include <std/stdexcept.hpp>
#include <std/smart_ptr.hpp>
#include <std/utility.hpp>
#include <std/vector.hpp>
#include <std/string.hpp>
#include <std/list.hpp>
/**
* @brief // stub namespace for std::align_val_t and new operator
* @note // Found on https://gcc.gnu.org/legacy-ml/gcc-patches/2016-09/msg00628.html for "_ZnwmSt11align_val_t" compiler error
*/
namespace std
{
typedef __SIZE_TYPE__ size_t;
static const size_t npos = -1;
enum class align_val_t : std::size_t
{
};
template <typename InputIt, typename OutputIt, typename UnaryOperation>
OutputIt transform(InputIt first, InputIt last, OutputIt result, UnaryOperation op)
{
while (first != last)
{
*result = op(*first);
++first;
++result;
}
return result;
};
inline __always_inline int tolower(int c)
{
if (c >= 'A' && c <= 'Z')
return c + ('a' - 'A');
else
return c;
}
inline __always_inline int toupper(int c)
{
if (c >= 'a' && c <= 'z')
return c - ('a' - 'A');
else
return c;
}
}
#endif // !__FENNIX_KERNEL_STD_H__