Re: GS 8.12 doesn't compile on MSVC 6.0
Ray Johnston <[email protected]>
| Newsgroups | gmane.comp.printing.ghostscript.patches |
|---|---|
| Message-ID | <[email protected]> |
Russell, Thanks. It saved me installing 'out of the box' MSVC 6 on my wife's computer in order to test. I'm willing to have Alex commit on this basis. Regards, Ray ___________________________________________________________________ Russell Lang wrote: > Ray, Alex, > > The fix works on my (believed to be) unpatched MSVC 6. > > Russell > > Quoting Ray Johnston <[email protected]>: > > >>Alex, >> >>Since I cannot test this (I have Service Pack 3 installed) I'd like >>to wait until Russell also confirms that it lets him build as well. >> >>Also, once Russell confirms, please add to the log message and comment >>that MSVC 6 with Service Pack 3 doesn't require this work around. >> >>Regards, >>Ray >>_____________________________________________________________________ >> >>Alex Cherepanov wrote: >> >> >>>Split an expression in two because MSVC 6.00.8168.0 cannot compile it >>>in -O2 mode, enabled in GS 8.12 by default. >>> >>> >>> >> >>------------------------------------------------------------------------ >> >>>Index: gs/src/idict.c >>>=================================================================== >>>RCS file: /cvs/ghostscript/gs/src/idict.c,v >>>retrieving revision 1.8 >>>diff -b -u -r1.8 idict.c >>>--- gs/src/idict.c 3 Sep 2003 03:22:59 -0000 1.8 >>>+++ gs/src/idict.c 12 Dec 2003 00:09:58 -0000 >>>@@ -313,7 +313,7 @@ >>> * Make sure that equal reals and integers hash the same. >>> */ >>> { >>>- int expt; >>>+ int expt, i; >>> double mant = frexp(pkey->value.realval, &expt); >>> /* >>> * The value is mant * 2^expt, where 0.5 <= mant < 1, >>>@@ -321,9 +321,10 @@ >>> */ >>> >>> if (expt < sizeof(long) * 8 || pkey->value.realval == min_long) >>>- hash = (uint)(int)pkey->value.realval * 30503; >>>+ i = (int)pkey->value.realval; >>> else >>>- hash = (uint)(int)(mant * min_long) * 30503; >>>+ i = (int)(mant * min_long); /* MSVC 6 cannot compile > > this > >>*/ >> >>>+ hash = (uint)i * 30503; /* with -O2 as a single >> >>expression */ >> >>> } >>> goto ih; >>> case t_integer: >>> >>> >>> >> >>------------------------------------------------------------------------ >> >>>_______________________________________________ >>>gs-code-review mailing list >>>[email protected] >>>http://www.ghostscript.com/mailman/listinfo/gs-code-review >> >>_______________________________________________ >>gs-code-review mailing list >>[email protected] >>http://www.ghostscript.com/mailman/listinfo/gs-code-review >> > > > > > Russell Lang [email protected] > >