From ca00c69c9e7f0f4302966fa3f476487816b11290 Mon Sep 17 00:00:00 2001 From: Aleksei Besogonov Date: Thu, 18 Sep 2025 22:29:50 -0700 Subject: [PATCH] Work around broken __has_include RP2040 tooling has a somewhat broken __has_include support. It doesn't check for include files outside of the library folder itself, making it useless for custom configuration. This commit adds classic #ifndef-#define style configuration support. --- src/BER.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/BER.h b/src/BER.h index e542f7e..2fb9bb6 100644 --- a/src/BER.h +++ b/src/BER.h @@ -7,26 +7,32 @@ #ifdef __has_include #if __has_include("SNMPcfg.h") #include "SNMPcfg.h" -#else +#endif +#endif + /** * @def SNMP_STREAM * @brief Defines read and write operations. */ +#ifndef SNMP_STREAM #define SNMP_STREAM 1 +#endif /** * @def SNMP_VECTOR * @brief Defines storage for ArrayBER. */ +#ifndef SNMP_VECTOR #define SNMP_VECTOR 0 +#endif /** * @def SNMP_CAPACITY * @brief Defines capacity of SequenceBER. */ +#ifndef SNMP_CAPACITY #define SNMP_CAPACITY 6 #endif -#endif #if SNMP_STREAM #include