From c15b608343c5a0de8558b31650ed001177fb3892 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Thu, 19 Mar 2009 22:59:57 +0100 Subject: Allow @cast on "struct " and "union " (by ignoring them). * parse.cxx (parser::parse_symbol): Strip off "struct " or "union " from cop->type. --- parse.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'parse.cxx') diff --git a/parse.cxx b/parse.cxx index ac7e652c..a26d594c 100644 --- a/parse.cxx +++ b/parse.cxx @@ -2341,6 +2341,12 @@ parser::parse_symbol () cop->operand = parse_expression (); expect_op(","); expect_unknown(tok_string, cop->type); + // types never start with "struct" or "union", + // so gobble it up. + if (cop->type.compare(0, 7, "struct ") == 0) + cop->type = cop->type.substr(7); + if (cop->type.compare(0, 6, "union ") == 0) + cop->type = cop->type.substr(6); if (peek_op (",")) { next(); -- cgit