diff --git a/cores/beken-72xx/base/fixups/generic.h b/cores/beken-72xx/base/fixups/generic.h index d812710..f729b13 100644 --- a/cores/beken-72xx/base/fixups/generic.h +++ b/cores/beken-72xx/base/fixups/generic.h @@ -9,3 +9,9 @@ #undef ntohs #undef htonl #undef ntohl + +// fix conflicts with std::max() and std::min() +#ifdef __cplusplus +#undef max +#undef min +#endif diff --git a/cores/beken-72xx/base/fixups/include.h b/cores/beken-72xx/base/fixups/include.h new file mode 100644 index 0000000..ebff54e --- /dev/null +++ b/cores/beken-72xx/base/fixups/include.h @@ -0,0 +1,8 @@ +/* Copyright (c) Kuba SzczodrzyƄski 2023-03-14. */ + +#include_next "include.h" + +#pragma once + +// force including fixups/generic.h, even by BDK/include.h +#include "generic.h" diff --git a/cores/common/arduino/libraries/common/MD5/MD5.h b/cores/common/arduino/libraries/common/MD5/MD5.h index 9530fec..2971867 100644 --- a/cores/common/arduino/libraries/common/MD5/MD5.h +++ b/cores/common/arduino/libraries/common/MD5/MD5.h @@ -4,7 +4,6 @@ #include -#if 0 // maybe simply using void* is easier? this is not C++ so it will link anyway // available built-in implementations #if LT_ARD_MD5_POLARSSL #include "MD5PolarSSLImpl.h" @@ -15,7 +14,6 @@ #if LT_ARD_MD5_HOSTAPD #include "MD5HostapdImpl.h" #endif -#endif // common API #ifdef __cplusplus diff --git a/cores/common/arduino/libraries/common/MD5/MD5HostapdImpl.h b/cores/common/arduino/libraries/common/MD5/MD5HostapdImpl.h index d187482..5bc092b 100644 --- a/cores/common/arduino/libraries/common/MD5/MD5HostapdImpl.h +++ b/cores/common/arduino/libraries/common/MD5/MD5HostapdImpl.h @@ -6,12 +6,12 @@ extern "C" { #endif -#include +struct MD5Context { + unsigned long buf[4]; + unsigned long bits[2]; + unsigned char in[64]; +}; -typedef uint32_t u32; -typedef uint8_t u8; - -#include #define LT_MD5_CTX_T struct MD5Context #ifdef __cplusplus diff --git a/cores/common/arduino/libraries/common/MD5/MD5MbedTLSImpl.h b/cores/common/arduino/libraries/common/MD5/MD5MbedTLSImpl.h index 68fcd48..76369c8 100644 --- a/cores/common/arduino/libraries/common/MD5/MD5MbedTLSImpl.h +++ b/cores/common/arduino/libraries/common/MD5/MD5MbedTLSImpl.h @@ -6,7 +6,12 @@ extern "C" { #endif -#include +typedef struct { + unsigned long total[2]; /*!< number of bytes processed */ + unsigned long state[4]; /*!< intermediate digest state */ + unsigned char buffer[64]; /*!< data block being processed */ +} mbedtls_md5_context; + #define LT_MD5_CTX_T mbedtls_md5_context #ifdef __cplusplus diff --git a/cores/common/arduino/libraries/common/MD5/MD5PolarSSLImpl.h b/cores/common/arduino/libraries/common/MD5/MD5PolarSSLImpl.h index 778d526..6eb7eaa 100644 --- a/cores/common/arduino/libraries/common/MD5/MD5PolarSSLImpl.h +++ b/cores/common/arduino/libraries/common/MD5/MD5PolarSSLImpl.h @@ -6,7 +6,12 @@ extern "C" { #endif -#include +typedef struct { + unsigned long total[2]; /*!< number of bytes processed */ + unsigned long state[4]; /*!< intermediate digest state */ + unsigned char buffer[64]; /*!< data block being processed */ +} md5_context; + #define LT_MD5_CTX_T md5_context #ifdef __cplusplus diff --git a/cores/common/arduino/src/Arduino.h b/cores/common/arduino/src/Arduino.h index 3c8eb98..e0e9aeb 100644 --- a/cores/common/arduino/src/Arduino.h +++ b/cores/common/arduino/src/Arduino.h @@ -36,6 +36,7 @@ using std::min; // FreeRTOS kernel #include +#include // Define available serial ports #if defined(__cplusplus) && LT_ARD_HAS_SERIAL