[common] Add Arduino emptyString declaration

This commit is contained in:
Kuba Szczodrzyński
2025-06-01 19:38:11 +02:00
parent 37f096d3b5
commit 9eae0cd253
3 changed files with 5 additions and 1 deletions

View File

@@ -51,7 +51,7 @@ def env_add_core_sources(env: Environment, queue, name: str, path: str) -> bool:
"+<compat/*.c*>", "+<compat/*.c*>",
"+<port/*.c*>", "+<port/*.c*>",
"+<posix/*.c>", "+<posix/*.c>",
"+<wiring/*.c>", "+<wiring/*.c*>",
"+<wraps/*.c>", "+<wraps/*.c>",
], ],
includes=[ includes=[

View File

@@ -7,3 +7,6 @@ String ipToString(const IPAddress &ip) {
sprintf(szRet, "%hhu.%hhu.%hhu.%hhu", ip[0], ip[1], ip[2], ip[3]); sprintf(szRet, "%hhu.%hhu.%hhu.%hhu", ip[0], ip[1], ip[2], ip[3]);
return String(szRet); return String(szRet);
} }
// global empty string to allow returning const String& with nothing
const String emptyString;

View File

@@ -35,6 +35,7 @@ extern "C" {
#ifdef __cplusplus #ifdef __cplusplus
String ipToString(const IPAddress &ip); String ipToString(const IPAddress &ip);
extern const String emptyString;
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus