Winebuild fix

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

 



Hi,

Line number reporting is wrong in winebuild. The attached patch fixes
this, and for redefinition errors gives a 2 line error like gcc.

These changes make IDE's like KDevelop able to jump to the correct
lines when errors are clicked in the build window.

Cheers,
Jon

License: X11

ChangeLog:

  Jon Griffiths <jon_p_griffiths@yahoo.com>

  +tools/winebuild/utils.c tools/winebuild/parser.c
   Report correct line number for parse warnings/errors.



=====
"Don't wait for the seas to part, or messiahs to come;
 Don't you sit around and waste this chance..." - Live

jon_p_griffiths@yahoo.com

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com
diff -u wine/tools/winebuild/parser.c wine-develop-most_recent-old/tools/winebuild/parser.c
--- wine/tools/winebuild/parser.c	Sun Aug  4 10:13:55 2002
+++ wine-develop-most_recent-old/tools/winebuild/parser.c	Sun Aug  4 13:02:04 2002
@@ -389,7 +389,7 @@
 
     odp->name = xstrdup( token );
     fix_export_name( odp->name );
-    odp->lineno = current_line;
+    odp->lineno = current_line - 1;
     odp->ordinal = ordinal;
 
     switch(odp->type)
@@ -480,9 +480,11 @@
     {
         if (!strcmp( Names[i]->name, Names[i+1]->name ))
         {
-            current_line = max( Names[i]->lineno, Names[i+1]->lineno );
-            fatal_error( "'%s' redefined (previous definition at line %d)\n",
-                         Names[i]->name, min( Names[i]->lineno, Names[i+1]->lineno ) );
+            display_warnings = 1;
+            current_line = max( Names[i]->lineno, Names[i+1]->lineno ) + 1;
+            warning( "'%s' redefined\n", Names[i]->name );
+            current_line = min( Names[i]->lineno, Names[i+1]->lineno ) + 1;
+            fatal_error( "First defined here\n" );
         }
     }
 }
diff -u wine/tools/winebuild/utils.c wine-develop-most_recent-old/tools/winebuild/utils.c
--- wine/tools/winebuild/utils.c	Sun Aug  4 10:13:56 2002
+++ wine-develop-most_recent-old/tools/winebuild/utils.c	Sun Aug  4 13:02:04 2002
@@ -79,7 +79,7 @@
     {
         fprintf( stderr, "%s:", input_file_name );
         if (current_line)
-            fprintf( stderr, "%d:", current_line );
+            fprintf( stderr, "%d:", current_line - 1 );
         fputc( ' ', stderr );
     }
     vfprintf( stderr, msg, valist );
@@ -95,7 +95,7 @@
     {
         fprintf( stderr, "%s:", input_file_name );
         if (current_line)
-            fprintf( stderr, "%d:", current_line );
+            fprintf( stderr, "%d:", current_line - 1);
         fputc( ' ', stderr );
     }
     vfprintf( stderr, msg, valist );
@@ -114,7 +114,7 @@
     {
         fprintf( stderr, "%s:", input_file_name );
         if (current_line)
-            fprintf( stderr, "%d:", current_line );
+            fprintf( stderr, "%d:", current_line - 1 );
         fputc( ' ', stderr );
     }
     fprintf( stderr, "warning: " );

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux