From 7d5f697c38629ceee5aa169f5b776de40c37a244 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 4 Mar 2024 10:27:07 +1100 Subject: [PATCH] py/emitglue: Add explicit cast of proto_fun to uint8_t pointer. Otherwise C++ compilers may complain when this header is included in an extern "C" block. Signed-off-by: Damien George --- py/emitglue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/emitglue.h b/py/emitglue.h index 0960ee22daec..126462671b00 100644 --- a/py/emitglue.h +++ b/py/emitglue.h @@ -63,7 +63,7 @@ typedef const void *mp_proto_fun_t; // is guaranteed to have either its first or second byte non-zero. So if both bytes are // zero then the mp_proto_fun_t pointer must be an mp_raw_code_t. static inline bool mp_proto_fun_is_bytecode(mp_proto_fun_t proto_fun) { - const uint8_t *header = proto_fun; + const uint8_t *header = (const uint8_t *)proto_fun; return (header[0] | (header[1] << 8)) != (MP_PROTO_FUN_INDICATOR_RAW_CODE_0 | (MP_PROTO_FUN_INDICATOR_RAW_CODE_1 << 8)); }