Closed Bug 848611 Opened 11 years ago Closed 11 years ago

MathAlgorithms.h:116: error: 'fabsl' was not declared in this scope

Categories

(Core :: MFBT, defect)

ARM
MeeGo
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: romaxa, Assigned: romaxa)

References

Details

Attachments

(1 file)

gcc version 4.4.1 ('cs2009q3-hard-67-sb16')
Attachment #721956 - Flags: review?(jwalden+bmo)
Comment on attachment 721956 [details] [diff] [review]
Use cmath and std::fabs

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

You might need to rebase through changes in bug 847480, assuming relevant bits land before this.  Note that'll be temporarily semi-duplicating Abs into DeprecatedAbs, so you'll need to update two places, not one, to properly rebase.

::: mfbt/MathAlgorithms.h
@@ +12,5 @@
>  #include "mozilla/StandardInteger.h"
>  #include "mozilla/TypeTraits.h"
>  
>  #include <limits.h>
> +#include <cmath>

<cmath> goes before <limits.h>, alphabetically.

@@ +112,5 @@
>  template<>
>  inline long double
>  Abs<long double>(const long double d)
>  {
> +  return std::fabs(d);

If we're going to use the std::-qualified std::fabs here, we really should use it (well, the other overloads of it, guaranteed by C++98) for the others as well.  (Not least because <cmath> only provides the std:: versions, technically, and not the :: versions.)
Attachment #721956 - Flags: review?(jwalden+bmo) → review+
https://tbpl.mozilla.org/php/getParsedLog.php?id=20634933&tree=Try#error0
MathAlgorithms.h:102:10: error: 'fabsf' is not a member of 'std'
std::fabs is overloaded for float, double, and long double according to C++98, so I think every instance -- including the float one -- should just call std::fabs with that method's argument.
https://hg.mozilla.org/mozilla-central/rev/051405e33fc4
Assignee: nobody → romaxa
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: