From 8e4dfa38843c4b4f4c62be78607f587d00c6536c Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Mon, 18 Jul 2022 02:56:43 +0200 Subject: [PATCH] maths: Provide MIN and MAX macros if not available --- src/maths.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/maths.h b/src/maths.h index 3ef7553..ece7958 100644 --- a/src/maths.h +++ b/src/maths.h @@ -23,6 +23,14 @@ #include "libsuperderpy.h" +#ifndef MAX +#define MAX(a, b) (((a) > (b)) ? (a) : (b)) +#endif + +#ifndef MIN +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#endif + double DotProduct(const double v[], const double u[], int n); double VectorLength(double x, double y, double z); double Wrap(double left, double right, double val);