Include esp_mac.h and C++20 str_startswith/str_ends (#7999)

This commit is contained in:
Ryan Henderson 2025-01-12 20:18:20 -08:00 committed by GitHub
parent 3fa67fad32
commit df50e57409
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -45,7 +45,9 @@
#endif
#ifdef USE_ESP32
#include "esp32/rom/crc.h"
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 2)
#include "esp_mac.h"
#endif
#include "esp_efuse.h"
#include "esp_efuse_table.h"
#endif
@ -261,7 +263,7 @@ bool random_bytes(uint8_t *data, size_t len) {
bool str_equals_case_insensitive(const std::string &a, const std::string &b) {
return strcasecmp(a.c_str(), b.c_str()) == 0;
}
#if ESP_IDF_VERSION_MAJOR >= 5
#if __cplusplus >= 202002L
bool str_startswith(const std::string &str, const std::string &start) { return str.starts_with(start); }
bool str_endswith(const std::string &str, const std::string &end) { return str.ends_with(end); }
#else