1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:34:59 +00:00
serenity/Userland/Libraries/LibC/arch/aarch64/fenv.cpp
Nico Weber 4409b33145 AK: Make IndexSequence use size_t
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.)
2024-02-11 18:53:00 +01:00

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_AARCH64();
return 0;
}
int fesetenv(fenv_t const* env)
{
if (!env)
return 1;
(void)env;
TODO_AARCH64();
return 0;
}
int feholdexcept(fenv_t* env)
{
fegetenv(env);
fenv_t current_env;
fegetenv(&current_env);
(void)env;
TODO_AARCH64();
fesetenv(&current_env);
return 0;
}
int fesetexceptflag(fexcept_t const* except, int exceptions)
{
if (!except)
return 1;
fenv_t current_env;
fegetenv(&current_env);
exceptions &= FE_ALL_EXCEPT;
(void)exceptions;
(void)except;
TODO_AARCH64();
fesetenv(&current_env);
return 0;
}
int fegetround()
{
TODO_AARCH64();
}
int fesetround(int rounding_mode)
{
if (rounding_mode < FE_TONEAREST || rounding_mode > FE_TOWARDZERO)
return 1;
TODO_AARCH64();
return 0;
}
int feclearexcept(int exceptions)
{
exceptions &= FE_ALL_EXCEPT;
fenv_t current_env;
fegetenv(&current_env);
(void)exceptions;
TODO_AARCH64();
fesetenv(&current_env);
return 0;
}
int fetestexcept(int exceptions)
{
(void)exceptions;
TODO_AARCH64();
}
int feraiseexcept(int exceptions)
{
fenv_t env;
fegetenv(&env);
exceptions &= FE_ALL_EXCEPT;
(void)exceptions;
TODO_AARCH64();
}
}