summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--py/compile.h8
-rw-r--r--py/emit.h6
-rw-r--r--py/emitglue.h4
-rw-r--r--py/lexer.h4
-rw-r--r--py/parse.h4
-rw-r--r--py/runtime0.h4
6 files changed, 30 insertions, 0 deletions
diff --git a/py/compile.h b/py/compile.h
index cef20efce2..9d612da532 100644
--- a/py/compile.h
+++ b/py/compile.h
@@ -23,6 +23,12 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#ifndef __MICROPY_INCLUDED_PY_COMPILE_H__
+#define __MICROPY_INCLUDED_PY_COMPILE_H__
+
+#include "py/lexer.h"
+#include "py/parse.h"
+#include "py/emitglue.h"
// These must fit in 8 bits; see scope.h
enum {
@@ -38,3 +44,5 @@ mp_obj_t mp_compile(mp_parse_node_t pn, qstr source_file, uint emit_opt, bool is
// this is implemented in runtime.c
mp_obj_t mp_parse_compile_execute(mp_lexer_t *lex, mp_parse_input_kind_t parse_input_kind, mp_obj_dict_t *globals, mp_obj_dict_t *locals);
+
+#endif // __MICROPY_INCLUDED_PY_COMPILE_H__
diff --git a/py/emit.h b/py/emit.h
index 1f1798fdf1..8b9b368c2f 100644
--- a/py/emit.h
+++ b/py/emit.h
@@ -33,6 +33,10 @@
* This is problematic for some emitters (x64) since they need to know the maximum
* stack size to compile the entry to the function, and this affects code size.
*/
+#ifndef __MICROPY_INCLUDED_PY_EMIT_H__
+#define __MICROPY_INCLUDED_PY_EMIT_H__
+
+#include "py/runtime0.h"
typedef enum {
MP_PASS_SCOPE = 1, // work out id's and their kind, and number of labels
@@ -195,3 +199,5 @@ extern const emit_inline_asm_method_table_t emit_inline_thumb_method_table;
emit_inline_asm_t *emit_inline_thumb_new(mp_uint_t max_num_labels);
void emit_inline_thumb_free(emit_inline_asm_t *emit);
+
+#endif // __MICROPY_INCLUDED_PY_EMIT_H__
diff --git a/py/emitglue.h b/py/emitglue.h
index fd55af26a6..60ccd67406 100644
--- a/py/emitglue.h
+++ b/py/emitglue.h
@@ -23,6 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#ifndef __MICROPY_INCLUDED_PY_EMITGLUE_H__
+#define __MICROPY_INCLUDED_PY_EMITGLUE_H__
// These variables and functions glue the code emitters to the runtime.
@@ -59,3 +61,5 @@ void mp_emit_glue_assign_native(mp_raw_code_t *rc, mp_raw_code_kind_t kind, void
mp_obj_t mp_make_function_from_raw_code(mp_raw_code_t *rc, mp_obj_t def_args, mp_obj_t def_kw_args);
mp_obj_t mp_make_closure_from_raw_code(mp_raw_code_t *rc, mp_uint_t n_closed_over, const mp_obj_t *args);
+
+#endif // __MICROPY_INCLUDED_PY_EMITGLUE_H__
diff --git a/py/lexer.h b/py/lexer.h
index c2f621d4ca..7f8d93b1ea 100644
--- a/py/lexer.h
+++ b/py/lexer.h
@@ -23,6 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#ifndef __MICROPY_INCLUDED_PY_LEXER_H__
+#define __MICROPY_INCLUDED_PY_LEXER_H__
/* lexer.h -- simple tokeniser for Micro Python
*
@@ -186,3 +188,5 @@ mp_import_stat_t mp_import_stat(const char *path);
mp_lexer_t *mp_lexer_new_from_file(const char *filename);
extern mp_uint_t mp_optimise_value;
+
+#endif // __MICROPY_INCLUDED_PY_LEXER_H__
diff --git a/py/parse.h b/py/parse.h
index 45645951af..4006223181 100644
--- a/py/parse.h
+++ b/py/parse.h
@@ -23,6 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#ifndef __MICROPY_INCLUDED_PY_PARSE_H__
+#define __MICROPY_INCLUDED_PY_PARSE_H__
struct _mp_lexer_t;
@@ -93,3 +95,5 @@ typedef enum {
// returns MP_PARSE_NODE_NULL on error, and then parse_error_kind_out is valid
mp_parse_node_t mp_parse(struct _mp_lexer_t *lex, mp_parse_input_kind_t input_kind, mp_parse_error_kind_t *parse_error_kind_out);
+
+#endif // __MICROPY_INCLUDED_PY_PARSE_H__
diff --git a/py/runtime0.h b/py/runtime0.h
index b6db1dd855..dc4a526d1c 100644
--- a/py/runtime0.h
+++ b/py/runtime0.h
@@ -23,6 +23,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#ifndef __MICROPY_INCLUDED_PY_RUNTIME0_H__
+#define __MICROPY_INCLUDED_PY_RUNTIME0_H__
// taken from python source, Include/code.h
// These must fit in 8 bits; see scope.h
@@ -152,3 +154,5 @@ typedef enum {
} mp_fun_kind_t;
extern void *const mp_fun_table[MP_F_NUMBER_OF];
+
+#endif // __MICROPY_INCLUDED_PY_RUNTIME0_H__