From 78fde4819c2e56365947dcfcc686d447c1d75f09 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 6 Sep 2014 19:24:52 +0300 Subject: [PATCH] modstruct: Implement 'O', 'P', 's' types for packed structs. This is required to deal with, well, packed C structs containing pointers. --- py/binary.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py/binary.c b/py/binary.c index 783a48efdc..919ba87846 100644 --- a/py/binary.c +++ b/py/binary.c @@ -58,6 +58,8 @@ int mp_binary_get_size(char struct_type, char val_type, mp_uint_t *palign) { size = 4; break; case 'q': case 'Q': size = 8; break; + case 'P': case 'O': case 'S': + size = sizeof(void*); break; } break; case '@': {