Skip to content

Commit 5956466

Browse files
committed
py/builtin: Clean up and simplify import_stat and builtin_open config.
The following changes are made: - If MICROPY_VFS is enabled then mp_vfs_import_stat and mp_vfs_open are automatically used for mp_import_stat and mp_builtin_open respectively. - If MICROPY_PY_IO is enabled then "open" is automatically included in the set of builtins, and points to mp_builtin_open_obj. This helps to clean up and simplify the most common port configuration. Signed-off-by: Damien George <[email protected]>
1 parent 26b1d31 commit 5956466

File tree

15 files changed

+56
-20
lines changed

15 files changed

+56
-20
lines changed

examples/embedding/hello-embed.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <stdio.h>
2929
#include <stdlib.h>
3030

31+
#include "py/builtin.h"
3132
#include "py/compile.h"
3233
#include "py/runtime.h"
3334
#include "py/gc.h"

extmod/vfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#ifndef MICROPY_INCLUDED_EXTMOD_VFS_H
2727
#define MICROPY_INCLUDED_EXTMOD_VFS_H
2828

29-
#include "py/lexer.h"
29+
#include "py/builtin.h"
3030
#include "py/obj.h"
3131

3232
// return values of mp_vfs_lookup_path

mpy-cross/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <stdlib.h>
3030
#include <unistd.h>
3131

32+
#include "py/builtin.h"
3233
#include "py/compile.h"
3334
#include "py/persistentcode.h"
3435
#include "py/runtime.h"

ports/esp8266/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <stdio.h>
2929
#include <string.h>
3030

31+
#include "py/builtin.h"
3132
#include "py/compile.h"
3233
#include "py/runtime.h"
3334
#include "py/stackctrl.h"

ports/javascript/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <stdlib.h>
3030
#include <string.h>
3131

32+
#include "py/builtin.h"
3233
#include "py/compile.h"
3334
#include "py/runtime.h"
3435
#include "py/repl.h"

ports/minimal/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <stdio.h>
33
#include <string.h>
44

5+
#include "py/builtin.h"
56
#include "py/compile.h"
67
#include "py/runtime.h"
78
#include "py/repl.h"

ports/nrf/modules/uos/microbitfs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#ifndef __MICROPY_INCLUDED_FILESYSTEM_H__
2828
#define __MICROPY_INCLUDED_FILESYSTEM_H__
2929

30+
#include "py/builtin.h"
3031
#include "py/obj.h"
3132
#include "py/lexer.h"
3233

ports/powerpc/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include <stdio.h>
2828

29+
#include "py/builtin.h"
2930
#include "py/compile.h"
3031
#include "py/runtime.h"
3132
#include "py/repl.h"

ports/qemu-arm/test_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <malloc.h>
66
#include <setjmp.h>
77

8-
#include "py/obj.h"
8+
#include "py/builtin.h"
99
#include "py/compile.h"
1010
#include "py/runtime.h"
1111
#include "py/stackctrl.h"

ports/teensy/lexerfrozen.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <stdio.h>
22

3+
#include "py/builtin.h"
34
#include "py/lexer.h"
45
#include "py/runtime.h"
56
#include "py/mperrno.h"

0 commit comments

Comments
 (0)