summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2015-03-04 15:03:35 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2015-03-04 15:07:43 +0000
commit62c634abface49f5ed1253acc5bdaf0fa2853d8f (patch)
treeca8989feaa676e007878b7ba4565f9e251b79889
parent50dfb465658a5c1705cac51a31f145fee8b6b168 (diff)
downloadgobject-introspection-62c634abface49f5ed1253acc5bdaf0fa2853d8f.tar.gz
scanner: Support the C99 'bool' type
Otherwise API using it will badly break in weird ways. https://bugzilla.gnome.org/show_bug.cgi?id=745608
-rw-r--r--giscanner/ast.py2
-rw-r--r--giscanner/scannerlexer.l1
2 files changed, 3 insertions, 0 deletions
diff --git a/giscanner/ast.py b/giscanner/ast.py
index c3c83d47..12f273e7 100644
--- a/giscanner/ast.py
+++ b/giscanner/ast.py
@@ -284,6 +284,8 @@ type_names['int32_t'] = TYPE_INT32
type_names['uint32_t'] = TYPE_UINT32
type_names['int64_t'] = TYPE_INT64
type_names['uint64_t'] = TYPE_UINT64
+# C99 stdbool
+type_names['bool'] = TYPE_BOOLEAN
# A few additional GLib type aliases
type_names['guchar'] = TYPE_UINT8
diff --git a/giscanner/scannerlexer.l b/giscanner/scannerlexer.l
index e35e9d5d..835b92c1 100644
--- a/giscanner/scannerlexer.l
+++ b/giscanner/scannerlexer.l
@@ -193,6 +193,7 @@ stringtext ([^\\\"])|(\\.)
"asm" { if (!parse_ignored_macro()) REJECT; }
"auto" { return AUTO; }
+"bool" { return BOOL; }
"break" { return BREAK; }
"case" { return CASE; }
"char" { return CHAR; }