On Sun, Nov 16, 2008 at 9:51 PM, Bastiaan Jacques <[EMAIL PROTECTED]> wrote:

> For a different approach, you can have a look at the isInf function
> template in as_value.h. I'm thinking we should use that implementation
> to replace isFinite to make it more portable. In general I don't like
> #ifdef MY_PLATFORM very much (this is also why we prefer to use
> boost::thread, for example). Of course this is not always possible.


Ok, I'm all for better portability via boost. I did find one Win32
implementation of code for dirent.h
 (it is a rather simple port) but now you got me thinking about using
boost also for directory functions
like these in dirent.h.

Anyhow if in utility.h I included  as_value.h so that new version of
isFinite(d) becomes:

inline bool isFinite(double d)
{
      return !isinf(d);
}

we now have an unpleasant circular dependency since isinf is defined
in terms of isNaN.
isNaN in turn uses UNUSED macro which is defined at the bottom of utility.h.

VC++ gave me a ride and for quite some time I couldn't interpret the
errors - why
doesn't it find isinf identifier, am I missing namespace qualifier,  etc, etc ?

Thus I removed this line, including uitility.h in as_value.h

#include "utility.h" // UNUSED

Now we have:

template <typename T>
inline bool
isNaN(const T& num, typename
boost::enable_if<boost::is_floating_point<T> >::type* dummy = 0)
{
        dummy; // UNUSED(dummy);
        return num != num;
}

You (plural) are Ok with this?


_______________________________________________
Gnash-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnash-dev

Reply via email to