Skip to content

Commit e9f032f

Browse files
authored
Merge pull request #7364 from jepler/fix-unix-standard-build
fix ports/unix builds besides coverage
2 parents e7ded6d + aa63fae commit e9f032f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ports/unix/modos.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@
5656
#endif
5757
#endif
5858

59+
#if defined(MICROPY_UNIX_COVERAGE)
60+
mp_obj_t common_hal_os_getenv(const char *key, mp_obj_t default_);
61+
#endif
62+
5963
STATIC mp_obj_t mod_os_urandom(mp_obj_t num) {
6064
mp_int_t n = mp_obj_get_int(num);
6165
vstr_t vstr;
@@ -193,12 +197,13 @@ STATIC mp_obj_t mod_os_system(mp_obj_t cmd_in) {
193197
}
194198
MP_DEFINE_CONST_FUN_OBJ_1(mod_os_system_obj, mod_os_system);
195199

196-
mp_obj_t common_hal_os_getenv(const char *key, mp_obj_t default_);
197200
STATIC mp_obj_t mod_os_getenv(mp_obj_t var_in) {
201+
#if defined(MICROPY_UNIX_COVERAGE)
198202
mp_obj_t result = common_hal_os_getenv(mp_obj_str_get_str(var_in), mp_const_none);
199203
if (result != mp_const_none) {
200204
return result;
201205
}
206+
#endif
202207
const char *s = getenv(mp_obj_str_get_str(var_in));
203208
if (s == NULL) {
204209
return mp_const_none;

0 commit comments

Comments
 (0)