mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-25 05:55:13 +00:00
Remove all functions with platform #if's from fenv, and add arch dependent implementations instead. The build system now selects the implementation based on the platform.
32 lines
664 B
C++
32 lines
664 B
C++
/*
|
|
* Copyright (c) 2021, Mițca Dumitru <dumitru0mitca@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <AK/Types.h>
|
|
#include <fenv.h>
|
|
|
|
// This is the size of the floating point environment image in protected mode
|
|
static_assert(sizeof(__x87_floating_point_environment) == 28);
|
|
|
|
extern "C" {
|
|
|
|
int feupdateenv(fenv_t const* env)
|
|
{
|
|
auto currently_raised_exceptions = fetestexcept(FE_ALL_EXCEPT);
|
|
|
|
fesetenv(env);
|
|
feraiseexcept(currently_raised_exceptions);
|
|
|
|
return 0;
|
|
}
|
|
|
|
int fegetexceptflag(fexcept_t* except, int exceptions)
|
|
{
|
|
if (!except)
|
|
return 1;
|
|
*except = (uint16_t)fetestexcept(exceptions);
|
|
return 0;
|
|
}
|
|
}
|