From 5c2b12acd12224330f236f7f851e4657443905f1 Mon Sep 17 00:00:00 2001 From: James Aguilar Date: Fri, 3 Jan 2025 20:06:36 -0500 Subject: [PATCH] Depend on Arduino.h only if platform is AVR When the platform is not Arduino, we can't use random(), but that appears to be the only Arduino dep in the entire library. Avoiding a dependency on Arduino allows using the FixedPoint library on native, which is useful for unit tests. --- src/FixedPoints/Details.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/FixedPoints/Details.h b/src/FixedPoints/Details.h index 26e03b0..7670496 100644 --- a/src/FixedPoints/Details.h +++ b/src/FixedPoints/Details.h @@ -14,7 +14,6 @@ #pragma once -#include #include #include @@ -33,6 +32,8 @@ #if !defined(__AVR__) #define FIXED_POINTS_NO_RANDOM +#else +#include "Arduino.h" #endif // Pay no attention to the man behind the curtains