[patch] RFA mercury's missing std::abs

Jules Bergmann jules at codesourcery.com
Fri Nov 11 13:59:24 UTC 2005


This patch checks for missing std::abs overloads for float and double at 
configure time.  If missing (and ::abs overloads exist), 
VSIP_IMPL_FIX_MISSING_ABS is defined, which causes vsip::mag and 
vsip::magsq to use a blend of vsip::abs and ::abs.

This should be more robust than relying on the order of <cmath> and 
<cstdlib> (which might break if users include standard headers before 
including vsip headers -- something I tend to do).

Comments?

Patch also

  - uses vsip::mag in tests/test.hpp instead of std::abs.

  - throws an exception if general dispatch fails (instead of assert).
    Right thing to do, and fixes greenhills warning about function
    not returning a value.

				-- Jules
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mc.diff
URL: <http://sourcerytools.com/pipermail/vsipl++/attachments/20051111/07bf06e1/attachment.ksh>


More information about the vsipl++ mailing list