Files
.github
.vscode
arch
core
exec
files
include
include_std
std
sys
algorithm
assert.h
atomic
cassert
cmath
cstddef
cstring
cxxabi.h
dlfcn.h
errno.h
exception
float.h
functional
limits.h
list
math.h
mutex
pthread.h
sched.h
std.hpp
stdarg.h
stdatomic.h
stddef.h
stdexcept
stdint.h
stdio.h
stdlib.h
string
string.h
strings.h
stropts.h
time.h
type_trails
typeinfo
unistd.h
unordered_map
unwind.h
utility
utsname.h
vector
wchar.h
kshell
library
network
profiling
storage
syscalls
tasking
tests
virtualization
.gdbinit
.gitignore
CREDITS.md
Doxyfile
ISSUES.md
LICENSE.md
LICENSES.md
Makefile
README.md
TODO.md
driver.h
dump.sh
kernel.cpp
kernel.h
kernel_config.cpp
kernel_thread.cpp
kernel_vfs.cpp
syscalls.h
Kernel/include_std/std.hpp
2023-10-11 13:00:15 +03:00

69 lines
1.9 KiB
C++

/*
This file is part of Fennix Kernel.
Fennix Kernel 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.
Fennix Kernel 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 Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
*/
/* 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>
/**
* @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__