diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | giscanner/scannerlexer.l | 13 |
2 files changed, 9 insertions, 10 deletions
@@ -1,3 +1,9 @@ +2008-09-07 Johan Dahlin <johan@gnome.org> + + Bug 551162 – giscanner does not recognize asm and __asm__ + * giscanner/scannerlexer.l: + Patch by Jani Monoses. + 2008-09-06 Colin Walters <walters@verbum.org> * girepository/girnode.c: Allow gtype_name diff --git a/giscanner/scannerlexer.l b/giscanner/scannerlexer.l index 45a47ab1..0f41637c 100644 --- a/giscanner/scannerlexer.l +++ b/giscanner/scannerlexer.l @@ -127,6 +127,8 @@ stringtext ([^\"])|(\\.) [a-zA-Z_][a-zA-Z_0-9]* { if (scanner->macro_scan) return IDENTIFIER; else REJECT; } +"asm" { if (!parse_ignored_macro()) REJECT; } +"__asm__" { if (!parse_ignored_macro()) REJECT; } "auto" { return AUTO; } "_Bool" { return BOOL; } "break" { return BREAK; } @@ -416,7 +418,7 @@ process_directive (GISourceScanner *scanner) /* * This parses a macro which is ignored, such as - * __attribute__(x) + * __attribute__((x)) or __asm__ (x) */ static int parse_ignored_macro (void) @@ -428,10 +430,6 @@ parse_ignored_macro (void) ; if (c != '(') return FALSE; - while ((c = input ()) != EOF && isspace (c)) - ; - if (c != '(') - return FALSE; nest = 0; while ((c = input ()) != EOF && (nest > 0 || c != ')')) { @@ -457,10 +455,5 @@ parse_ignored_macro (void) lineno++; } - while ((c = input ()) != EOF && isspace (c)) - ; - if (c != ')') - return FALSE; - return TRUE; } |