Re: Fixing gcc 3.3 compile failures

From: Peter Kadau <peter.kadau_at_tuebingen.mpg.de>
Date: 18 Jul 2003 13:46:46 +0200
OK, here is one for graphics/svgalib:
--- src/vga.c.orig      Fri Jul 18 13:27:40 2003
+++ src/vga.c   Fri Jul 18 13:32:58 2003
_at__at_ -3846,7 +3846,7 _at__at_
  
 #define ML_GETINT(x) \
        ptr = strtok(NULL, " "); if(!ptr) break; \
-       mmt.##x = atoi(ptr);
+       mmt.x = atoi(ptr);
  
            ML_GETINT(HDisplay);
            ML_GETINT(HSyncStart);

Just abused concatenation...

But I'm pretty sure that the following is
what was intended, thusly the better patch:
--- src/vga.c.orig      Fri Jul 18 13:27:40 2003
+++ src/vga.c   Fri Jul 18 13:34:38 2003
_at__at_ -3845,8 +3845,9 _at__at_
            mmt.pixelClock = atof(ptr) * 1000;
  
 #define ML_GETINT(x) \
-       ptr = strtok(NULL, " "); if(!ptr) break; \
-       mmt.##x = atoi(ptr);
+       do { ptr = strtok(NULL, " "); if(!ptr) break; \
+               mmt.x = atoi(ptr); } \
+       while (0)
  
            ML_GETINT(HDisplay);
            ML_GETINT(HSyncStart);
 
Received on Fri Jul 18 2003 - 02:46:52 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:15 UTC