[gimp] gimp-mkenums: Ignore forward declarations



commit e2d72211cfba3179a59f71522ad0fd5b3b809759
Author: Mukund Sivaraman <muks banu com>
Date:   Fri May 2 22:57:50 2014 +0530

    gimp-mkenums: Ignore forward declarations
    
    Based on patch by Dan Winship (see commit f049262a in the glib git
    repo).

 tools/gimp-mkenums |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/tools/gimp-mkenums b/tools/gimp-mkenums
index 5aa0f33..a030fc8 100755
--- a/tools/gimp-mkenums
+++ b/tools/gimp-mkenums
@@ -239,6 +239,9 @@ while (<>) {
        ([^*]+|\*(?!/))*
        \*/@@gx;
        
+    # ignore forward declarations
+    next if /^\s*typedef\s+enum.*;/;
+
     if (m ^\s*typedef\s+enum\s*
            ({)?\s*
            (?:/\*<
@@ -259,6 +262,9 @@ while (<>) {
        # Didn't have trailing '{' look on next lines
        if (!defined $1) {
            while (<>) {
+               if (eof) {
+                   die "Hit end of file while parsing enum in $ARGV";
+               }
                if (s/^\s*\{//) {
                    last;
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]