Skip to content

Commit

Permalink
py/emitglue: Add explicit cast of proto_fun to uint8_t pointer.
Browse files Browse the repository at this point in the history
Otherwise C++ compilers may complain when this header is included in an
extern "C" block.

Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
dpgeorge committed Mar 3, 2024
1 parent bc424dd commit 7d5f697
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion py/emitglue.h
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down

0 comments on commit 7d5f697

Please sign in to comment.