summaryrefslogtreecommitdiff
path: root/odb/pragma.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/pragma.cxx')
-rw-r--r--odb/pragma.cxx38
1 files changed, 37 insertions, 1 deletions
diff --git a/odb/pragma.cxx b/odb/pragma.cxx
index a22c1d1..3b8d222 100644
--- a/odb/pragma.cxx
+++ b/odb/pragma.cxx
@@ -127,7 +127,8 @@ check_decl_type (tree d, string const& name, string const& p, location_t l)
}
else if (p == "object" ||
p == "pointer" ||
- p == "abstract")
+ p == "abstract" ||
+ p == "callback")
{
if (tc != RECORD_TYPE)
{
@@ -374,6 +375,41 @@ handle_pragma (cpp_reader* reader,
tt = pragma_lex (&t);
}
+ else if (p == "callback")
+ {
+ // callback (name)
+ //
+
+ // Make sure we've got the correct declaration type.
+ //
+ if (decl != 0 && !check_decl_type (decl, decl_name, p, loc))
+ return;
+
+ if (pragma_lex (&t) != CPP_OPEN_PAREN)
+ {
+ error () << "'(' expected after db pragma '" << p << "'" << endl;
+ return;
+ }
+
+ tt = pragma_lex (&t);
+
+ if (tt != CPP_NAME)
+ {
+ error () << "member function name expected in db pragma '" << p
+ << "'" << endl;
+ return;
+ }
+
+ val = IDENTIFIER_POINTER (t);
+
+ if (pragma_lex (&t) != CPP_CLOSE_PAREN)
+ {
+ error () << "')' expected at the end of db pragma '" << p << "'" << endl;
+ return;
+ }
+
+ tt = pragma_lex (&t);
+ }
else if (p == "id")
{
// id