@@ -88,7 +88,9 @@ pub(crate) enum FormatType {
8888 Half = b'e' ,
8989 Float = b'f' ,
9090 Double = b'd' ,
91+ LongDouble = b'g' ,
9192 VoidP = b'P' ,
93+ PyObject = b'O' ,
9294}
9395
9496impl fmt:: Debug for FormatType {
@@ -148,7 +150,9 @@ impl FormatType {
148150 Half => nonnative_info!( f16, $end) ,
149151 Float => nonnative_info!( f32 , $end) ,
150152 Double => nonnative_info!( f64 , $end) ,
151- _ => unreachable!( ) , // size_t or void*
153+ LongDouble => nonnative_info!( f64 , $end) , // long double same as double
154+ PyObject => nonnative_info!( usize , $end) , // pointer size
155+ _ => unreachable!( ) , // size_t or void*
152156 }
153157 } } ;
154158 }
@@ -183,7 +187,9 @@ impl FormatType {
183187 Half => native_info ! ( f16) ,
184188 Float => native_info ! ( raw:: c_float) ,
185189 Double => native_info ! ( raw:: c_double) ,
190+ LongDouble => native_info ! ( raw:: c_double) , // long double same as double for now
186191 VoidP => native_info ! ( * mut raw:: c_void) ,
192+ PyObject => native_info ! ( * mut raw:: c_void) , // pointer to PyObject
187193 } ,
188194 Endianness :: Big => match_nonnative ! ( self , BigEndian ) ,
189195 Endianness :: Little => match_nonnative ! ( self , LittleEndian ) ,
@@ -306,8 +312,16 @@ impl FormatCode {
306312 continue ;
307313 }
308314
309- if c == b'{' || c == b'}' {
310- // Skip standalone braces (pointer targets, etc.)
315+ if c == b'{'
316+ || c == b'}'
317+ || c == b'&'
318+ || c == b'<'
319+ || c == b'>'
320+ || c == b'@'
321+ || c == b'='
322+ || c == b'!'
323+ {
324+ // Skip standalone braces (pointer targets, etc.), pointer prefix, and nested endianness markers
311325 continue ;
312326 }
313327
0 commit comments