mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:24:57 +00:00

This makes it possible to use MakeIndexSequqnce in functions like: template<typename T, size_t N> constexpr auto foo(T (&a)[N]) This means AK/StdLibExtraDetails.h must now include AK/Types.h for size_t, which means AK/Types.h can no longer include AK/StdLibExtras.h (which arguably it shouldn't do anyways), which requires rejiggering some things. (IMHO Types.h shouldn't use AK::Details metaprogramming at all. FlatPtr doesn't necessarily have to use Conditional<> and ssize_t could maybe be in its own header or something. But since it's tangential to this PR, going with the tried and true "lift things that cause the cycle up to the top" approach.)
109 lines
1.5 KiB
C++
109 lines
1.5 KiB
C++
/*
|
|
* Copyright (c) 2024, Tom Finet <tom.codeninja@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <AK/Assertions.h>
|
|
#include <AK/Types.h>
|
|
#include <fenv.h>
|
|
|
|
extern "C" {
|
|
|
|
int fegetenv(fenv_t* env)
|
|
{
|
|
if (!env)
|
|
return 1;
|
|
|
|
(void)env;
|
|
TODO_RISCV64();
|
|
return 0;
|
|
}
|
|
|
|
int fesetenv(fenv_t const* env)
|
|
{
|
|
if (!env)
|
|
return 1;
|
|
|
|
(void)env;
|
|
TODO_RISCV64();
|
|
return 0;
|
|
}
|
|
|
|
int feholdexcept(fenv_t* env)
|
|
{
|
|
fegetenv(env);
|
|
|
|
fenv_t current_env;
|
|
fegetenv(¤t_env);
|
|
|
|
(void)env;
|
|
TODO_RISCV64();
|
|
|
|
fesetenv(¤t_env);
|
|
return 0;
|
|
}
|
|
|
|
int fesetexceptflag(fexcept_t const* except, int exceptions)
|
|
{
|
|
if (!except)
|
|
return 1;
|
|
|
|
fenv_t current_env;
|
|
fegetenv(¤t_env);
|
|
|
|
exceptions &= FE_ALL_EXCEPT;
|
|
|
|
(void)exceptions;
|
|
(void)except;
|
|
TODO_RISCV64();
|
|
|
|
fesetenv(¤t_env);
|
|
return 0;
|
|
}
|
|
|
|
int fegetround()
|
|
{
|
|
TODO_RISCV64();
|
|
}
|
|
|
|
int fesetround(int rounding_mode)
|
|
{
|
|
if (rounding_mode < FE_TONEAREST || rounding_mode > FE_TOWARDZERO)
|
|
return 1;
|
|
|
|
TODO_RISCV64();
|
|
return 0;
|
|
}
|
|
|
|
int feclearexcept(int exceptions)
|
|
{
|
|
exceptions &= FE_ALL_EXCEPT;
|
|
|
|
fenv_t current_env;
|
|
fegetenv(¤t_env);
|
|
|
|
(void)exceptions;
|
|
TODO_RISCV64();
|
|
|
|
fesetenv(¤t_env);
|
|
return 0;
|
|
}
|
|
|
|
int fetestexcept(int exceptions)
|
|
{
|
|
(void)exceptions;
|
|
TODO_RISCV64();
|
|
}
|
|
|
|
int feraiseexcept(int exceptions)
|
|
{
|
|
fenv_t env;
|
|
fegetenv(&env);
|
|
|
|
exceptions &= FE_ALL_EXCEPT;
|
|
|
|
(void)exceptions;
|
|
TODO_RISCV64();
|
|
}
|
|
}
|