From 7d84f09e7e1943813242c7d8ee0e60b46697ec60 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Boric Date: Sun, 25 Apr 2021 21:10:55 +0200 Subject: [PATCH] Userland: Move non-standard math constants from math.h --- AK/ExtraMathConstants.h | 11 +++++++++++ Userland/Libraries/LibM/math.cpp | 1 + Userland/Libraries/LibM/math.h | 4 ---- .../LibWeb/HTML/CanvasRenderingContext2D.cpp | 1 + Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp | 1 + 5 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 AK/ExtraMathConstants.h diff --git a/AK/ExtraMathConstants.h b/AK/ExtraMathConstants.h new file mode 100644 index 00000000000..907306f45c9 --- /dev/null +++ b/AK/ExtraMathConstants.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2021, the SerenityOS developers. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#define M_TAU 6.28318530717958647692 +#define M_DEG2RAD 0.01745329251994329576 +#define M_RAD2DEG 57.2957795130823208767 diff --git a/Userland/Libraries/LibM/math.cpp b/Userland/Libraries/LibM/math.cpp index 1dd7ea76743..1ce7cebb53f 100644 --- a/Userland/Libraries/LibM/math.cpp +++ b/Userland/Libraries/LibM/math.cpp @@ -5,6 +5,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include #include #include diff --git a/Userland/Libraries/LibM/math.h b/Userland/Libraries/LibM/math.h index 4d2f02b5390..12e264e34df 100644 --- a/Userland/Libraries/LibM/math.h +++ b/Userland/Libraries/LibM/math.h @@ -57,10 +57,6 @@ __BEGIN_DECLS #define M_SQRT2f32 1.41421356237309504880f #define M_SQRT1_2f32 0.70710678118654752440f -#define M_TAU 6.28318530717958647692 -#define M_DEG2RAD 0.01745329251994329576 -#define M_RAD2DEG 57.2957795130823208767 - #define FP_NAN 0 #define FP_INFINITE 1 #define FP_ZERO 2 diff --git a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp index d73ab77eb92..ba33075faed 100644 --- a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp +++ b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp @@ -4,6 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include #include #include diff --git a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp index 9cd4b1a30a4..b758bc867e8 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp @@ -5,6 +5,7 @@ */ #include +#include #include #include #include