chore(env_var)!: rename DEFINE_ENV_VAR_STRING to DEFINE_ENV_VAR_STRING_LEN, DEFINE_ENV_VAR_STRING now checks len >= 1
This commit is contained in:
@@ -52,7 +52,7 @@ class EnvVarRegistry {
|
||||
};
|
||||
};
|
||||
|
||||
#define DEFINE_ENV_VAR_STRING(name, DEFAULT_VALUE, MIN_LEN) \
|
||||
#define DEFINE_ENV_VAR_STRING_LEN(name, DEFAULT_VALUE, MIN_LEN) \
|
||||
namespace EnvVars { \
|
||||
struct name { \
|
||||
static constexpr char const* DEFAULT = DEFAULT_VALUE; \
|
||||
@@ -60,7 +60,7 @@ class EnvVarRegistry {
|
||||
static char const* GET() { \
|
||||
auto c = std::getenv(#name); \
|
||||
if (c) { \
|
||||
if (std::strlen(c) > MIN_LEN) { \
|
||||
if (std::strlen(c) >= MIN_LEN) { \
|
||||
return c; \
|
||||
} \
|
||||
} \
|
||||
@@ -71,6 +71,9 @@ class EnvVarRegistry {
|
||||
}; \
|
||||
}
|
||||
|
||||
#define DEFINE_ENV_VAR_STRING(name, DEFAULT_VALUE) \
|
||||
DEFINE_ENV_VAR_STRING_LEN(name, DEFAULT_VALUE, 1)
|
||||
|
||||
#define DEFINE_ENV_VAR_INT(TYPE, name, DEFAULT_VALUE) \
|
||||
namespace EnvVars { \
|
||||
struct name { \
|
||||
|
||||
Reference in New Issue
Block a user