Last Comment Bug 717047 - Use cmath instead of math.h in nsMathUtils.h
: Use cmath instead of math.h in nsMathUtils.h
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: XPCOM (show other bugs)
: Trunk
: x86 Mac OS X
: -- normal (vote)
: mozilla12
Assigned To: Joe Drew (not getting mail)
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-10 14:33 PST by Joe Drew (not getting mail)
Modified: 2012-01-11 18:10 PST (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
use cmath (691 bytes, patch)
2012-01-10 14:33 PST, Joe Drew (not getting mail)
no flags Details | Diff | Splinter Review
use cmath v2 (1.03 KB, patch)
2012-01-10 15:07 PST, Joe Drew (not getting mail)
jacob.benoit.1: review+
Details | Diff | Splinter Review

Description Joe Drew (not getting mail) 2012-01-10 14:33:40 PST
Created attachment 587476 [details] [diff] [review]
use cmath

If we manage to include <cmath> before including nsMathUtils.h, its usage of isfinite() breaks because isfinite only exists in the std:: namespace. We can work around this by explicitly using <cmath>'s version of the function.
Comment 1 Joe Drew (not getting mail) 2012-01-10 15:07:49 PST
Created attachment 587503 [details] [diff] [review]
use cmath v2

We shouldnt do "using namespace std;" in a header. I'm going to run this through try, but it seems like all I need to worry about is std::isfinite on Darwin.
Comment 2 Benoit Jacob [:bjacob] (mostly away) 2012-01-10 16:16:17 PST
Comment on attachment 587503 [details] [diff] [review]
use cmath v2

Review of attachment 587503 [details] [diff] [review]:
-----------------------------------------------------------------

r+ \o/ \o/ \o/
Comment 3 Joe Drew (not getting mail) 2012-01-10 19:42:14 PST
inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/53a8a6b4c812
Comment 4 Ed Morley [:emorley] 2012-01-11 18:10:14 PST
https://hg.mozilla.org/mozilla-central/rev/53a8a6b4c812

Note You need to log in before you can comment on or make changes to this bug.