Skip to content

Commit 7d5f697

Browse files
committed
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 <[email protected]>
1 parent bc424dd commit 7d5f697

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

py/emitglue.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ typedef const void *mp_proto_fun_t;
6363
// is guaranteed to have either its first or second byte non-zero. So if both bytes are
6464
// zero then the mp_proto_fun_t pointer must be an mp_raw_code_t.
6565
static inline bool mp_proto_fun_is_bytecode(mp_proto_fun_t proto_fun) {
66-
const uint8_t *header = proto_fun;
66+
const uint8_t *header = (const uint8_t *)proto_fun;
6767
return (header[0] | (header[1] << 8)) != (MP_PROTO_FUN_INDICATOR_RAW_CODE_0 | (MP_PROTO_FUN_INDICATOR_RAW_CODE_1 << 8));
6868
}
6969

0 commit comments

Comments
 (0)