File tree 1 file changed +12
-7
lines changed
1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -327,14 +327,19 @@ static inline std::string PlatformUtilsGetSecureEnv(const char* name) {
327
327
328
328
#include < sys/system_properties.h>
329
329
330
- static inline bool PlatformUtilsGetEnvSet (const char * /* name */ ) {
331
- // Stub func
332
- return false ;
333
- }
330
+ namespace detail {
334
331
335
- static inline std::string PlatformUtilsGetEnv (const char * /* name */ ) {
336
- // Stub func
337
- return {};
332
+ static inline char * ImplGetEnv (const char * name) { return getenv (name); }
333
+ } // namespace detail
334
+
335
+ static inline bool PlatformUtilsGetEnvSet (const char * name) { return detail::ImplGetEnv (name) != nullptr ; }
336
+
337
+ static inline std::string PlatformUtilsGetEnv (const char * name) {
338
+ auto str = detail::ImplGetEnv (name);
339
+ if (str == nullptr ) {
340
+ return {};
341
+ }
342
+ return str;
338
343
}
339
344
340
345
static inline std::string PlatformUtilsGetSecureEnv (const char * /* name */ ) {
You can’t perform that action at this time.
0 commit comments