From 4fcb4ae749b3cf40f24ab1b9ddeb58b3ae0600f7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 31 Jul 2012 12:16:55 +0200 Subject: Add support for changing location that ODB views as class definition This is useful for making third-party/system types into ODB composite value types. New pragma: definition. New test: common/definition. --- odb/pragma.cxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'odb/pragma.cxx') diff --git a/odb/pragma.cxx b/odb/pragma.cxx index abb6692..ffe711f 100644 --- a/odb/pragma.cxx +++ b/odb/pragma.cxx @@ -404,7 +404,8 @@ check_spec_decl_type (tree d, p == "query" || p == "object" || p == "optimistic" || - p == "polymorphic") + p == "polymorphic" || + p == "definition") { if (tc != RECORD_TYPE) { @@ -1162,6 +1163,19 @@ handle_pragma (cxx_lexer& l, tt = l.next (tl, &tn); } + else if (p == "definition") + { + // definition + // + + // Make sure we've got the correct declaration type. + // + if (decl != 0 && !check_spec_decl_type (decl, decl_name, p, loc)) + return; + + val = l.location (); + tt = l.next (tl, &tn); + } else if (p == "callback") { // callback (name) -- cgit v1.1