From 0bcc1a43ae1b39791324e509e2f6a1687f75d094 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Sat, 2 Oct 2004 02:11:40 +0000 Subject: [PATCH] fix bitfield with expr git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6286 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Examples/test-suite/anonymous_bitfield.i | 2 ++ Source/CParse/parser.y | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Examples/test-suite/anonymous_bitfield.i b/Examples/test-suite/anonymous_bitfield.i index eca2c6b84..309f82caf 100644 --- a/Examples/test-suite/anonymous_bitfield.i +++ b/Examples/test-suite/anonymous_bitfield.i @@ -9,6 +9,8 @@ struct Foo { unsigned int f : 1; unsigned int : 5; int z : 15; + unsigned int : 8+6; + unsigned seq : (sizeof(unsigned)*8 - 6); }; %} diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index 5857e23cb..320a097a1 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -3448,7 +3448,7 @@ cpp_vend : cpp_const SEMI { ; -anonymous_bitfield : storage_class type COLON NUM_INT SEMI { }; +anonymous_bitfield : storage_class type COLON expr SEMI { }; /* ====================================================================== * PRIMITIVES @@ -3645,7 +3645,7 @@ def_args : EQUAL definetype { $$.bitfield = 0; $$.throws = 0; } - | COLON NUM_INT { + | COLON expr { $$.val = 0; $$.rawval = 0; $$.type = 0;