mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
LibC: Move architecture detection from fenv.h to arch/fenv.h
This is similar to how it is done in sys/arch/regs.h.
This commit is contained in:
parent
4439b4afcf
commit
f60a02fc78
Notes:
sideshowbarker
2024-07-17 02:22:23 +09:00
Author: https://github.com/DanShaders Commit: https://github.com/SerenityOS/serenity/commit/f60a02fc78 Pull-request: https://github.com/SerenityOS/serenity/pull/24129 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/supercomputer7
3 changed files with 40 additions and 14 deletions
22
Userland/Libraries/LibC/arch/aarch64/fenv.h
Normal file
22
Userland/Libraries/LibC/arch/aarch64/fenv.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Dan Klishch <danilklishch@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#ifndef __aarch64__
|
||||
# error "This file should not be included on architectures other than AArch64."
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
// TODO: Implement this.
|
||||
typedef struct fenv_t {
|
||||
char __dummy; // NOTE: This silences -Wextern-c-compat.
|
||||
} fenv_t;
|
||||
|
||||
__END_DECLS
|
17
Userland/Libraries/LibC/arch/fenv.h
Normal file
17
Userland/Libraries/LibC/arch/fenv.h
Normal file
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Dan Klishch <danilklishch@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(__x86_64__)
|
||||
# include <arch/x86_64/fenv.h>
|
||||
#elif defined(__aarch64__)
|
||||
# include <arch/aarch64/fenv.h>
|
||||
#elif defined(__riscv) && __riscv_xlen == 64
|
||||
# include <arch/riscv64/fenv.h>
|
||||
#else
|
||||
# error Unknown architecture
|
||||
#endif
|
|
@ -6,23 +6,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <arch/fenv.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#if defined(__x86_64__)
|
||||
# include <arch/x86_64/fenv.h>
|
||||
#elif defined(__aarch64__)
|
||||
|
||||
// TODO: Implement this.
|
||||
typedef struct fenv_t {
|
||||
} fenv_t;
|
||||
|
||||
#elif defined(__riscv) && __riscv_xlen == 64
|
||||
# include <arch/riscv64/fenv.h>
|
||||
#else
|
||||
# error "Unknown architecture"
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define FE_DFL_ENV ((fenv_t const*)-1)
|
||||
|
|
Loading…
Reference in a new issue