Bug 4923 - stop using <ostream> in WebCore, eliminating the <cmath> troubles it causes
Summary: stop using <ostream> in WebCore, eliminating the <cmath> troubles it causes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P3 Enhancement
Assignee: Darin Adler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-10 14:47 PDT by Darin Adler
Modified: 2005-12-19 11:51 PST (History)
0 users

See Also:


Attachments
patch to remove the use of <ostream> and take out <math.h> workarounds (23.98 KB, patch)
2005-09-10 14:48 PDT, Darin Adler
eric: review-
Details | Formatted Diff | Diff
new patch; needs testing on gcc 4, but otherwise ready for review (27.23 KB, patch)
2005-10-11 09:37 PDT, Darin Adler
mjs: review-
Details | Formatted Diff | Diff
another pass -- this patch tested on both gcc 3 and gcc 4 (61.27 KB, patch)
2005-12-19 10:54 PST, Darin Adler
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2005-09-10 14:47:23 PDT
For historical reasons, various WebCore classes have debug-only code that outputs them to a 
std::ostream.

This requires include the header <ostream>, which in turn includes <cmath>, which causes us to run 
afoul of some troubles because <cmath> undefines the macros from <math.h>.
Comment 1 Darin Adler 2005-09-10 14:48:03 PDT
Created attachment 3850 [details]
patch to remove the use of <ostream> and take out <math.h> workarounds
Comment 2 Eric Seidel (no email) 2005-09-10 20:06:50 PDT
Comment on attachment 3850 [details]
patch to remove the use of <ostream> and take out <math.h> workarounds

The changes for everything but KWQDef.h look fine.  Removing qRound and the 64
bit types will break KDOM's build.
Comment 3 Darin Adler 2005-09-10 20:25:49 PDT
OK.

Eric, here's something to bring up with the KSVG folks: Going forward, is there a reason that KSVG needs 
to use Q types for 64-bit rather than standard C types? And is there a reason it can't just call the C 
standard lround instead of qRound?

I think a good rule is to use Qt stuff if there isn't a standard C alternative, but not if there is.
Comment 4 Eric Seidel (no email) 2005-09-10 21:16:53 PDT
Comment on attachment 3850 [details]
patch to remove the use of <ostream> and take out <math.h> workarounds

This breaks building under 4.0 (thus will break the opensource folks).	Also
please add back the 16 and 64 bit types, and qRound as otherwise WebCore+SVG
build will break when landing.	Otherwise the patch looks fine.
Comment 5 Darin Adler 2005-10-11 09:37:37 PDT
Created attachment 4312 [details]
new patch; needs testing on gcc 4, but otherwise ready for review
Comment 6 Maciej Stachowiak 2005-10-13 23:15:24 PDT
In general, r=me, but please test on gcc4. I am going to r- this until it works with gcc4, so it does not get 
accidentally committed; but please consider it an r+ and feel free to make it so once fixed on gcc4.
Comment 7 Darin Adler 2005-12-19 10:54:54 PST
Created attachment 5154 [details]
another pass -- this patch tested on both gcc 3 and gcc 4
Comment 8 Darin Adler 2005-12-19 10:55:18 PST
Comment on attachment 5154 [details]
another pass -- this patch tested on both gcc 3 and gcc 4

Last time the concerns were SVG and gcc 4. This patch compiles with SVG and
works with both gcc 3 and gcc 4.
Comment 9 Geoffrey Garen 2005-12-19 11:06:35 PST
Comment on attachment 5154 [details]
another pass -- this patch tested on both gcc 3 and gcc 4

r=me
Comment 10 Eric Seidel (no email) 2005-12-19 11:15:41 PST
Comment on attachment 5154 [details]
another pass -- this patch tested on both gcc 3 and gcc 4

Looks good.  r=me.