[webkit-dev] std::complex affects isinf(), etc.

Chris Rogers crogers at google.com
Wed Feb 3 17:07:34 PST 2010


Basically, if you include <complex> then it undefines the functions (or
macros) for isinf(), isnan(), and others, and then expects you
to use std::isinf(), std::isnan() instead.  We use these functions in a
number of places, so we'd need to figure out a reasonable solution.
Or just go with my original class.

On Wed, Feb 3, 2010 at 5:01 PM, Sam Weinig <sam.weinig at gmail.com> wrote:

> What specific errors are you getting? I don't understand why including a
> standard header would break other standard functions.
>
> -Sam
>
> On Wed, Feb 3, 2010 at 3:22 PM, Chris Rogers <crogers at google.com> wrote:
>
>> I initially put in a patch for a class for Complex numbers, but people
>> preferred that I just use the std::complex version.
>>
>> In the process of switching my code over to use std::complex I noticed a
>> conflict with isinf(), isnan(), etc.
>> The problem is that simply including:
>>
>> #include <complex>
>>
>> breaks the isinf(), isnan() functions (and some others I think).  So now
>> I'm getting compile errors in any header files
>> which use these functions, such as WebGLFloatArray.h (which I need to
>> include for music visualizer stuff).
>> I'm a bit queasy about all the side-effects of simply including <complex>
>> and am not even sure how to address the
>> current situation, short of switching all of webkit over to using
>> std::isinf, std::isnan, etc.
>>
>> Now I remember having similar problems with this in other codebases I've
>> worked on, as the effects of <complex> seem
>> to be viral...
>>
>> Anybody have any recommendations?
>>
>> Thanks,
>> Chris
>>
>>
>> _______________________________________________
>> webkit-dev mailing list
>> webkit-dev at lists.webkit.org
>> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20100203/ea99097e/attachment.html>


More information about the webkit-dev mailing list