gnash-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-dev] Re: gnash/libbase utility.h


From: Deanna Phillips
Subject: [Gnash-dev] Re: gnash/libbase utility.h
Date: Mon, 27 Aug 2007 13:54:19 -0500
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/21.4 (berkeley-unix)

re availability of exp2() : 

> Please use a macro to detect availability of that function .
> Note: this is a BLOCKER for 0.8.1 (you committed there too, right?)

I think this should fix it.


Index: configure.ac
===================================================================
RCS file: /sources/gnash/gnash/configure.ac,v
retrieving revision 1.407
diff -u -p -r1.407 configure.ac
--- configure.ac        26 Aug 2007 10:23:48 -0000      1.407
+++ configure.ac        27 Aug 2007 18:25:09 -0000
@@ -821,6 +821,16 @@ if test x"$ac_cv_isfinite" = x"yes"; the
   AC_DEFINE(HAVE_ISFINITE, [], [Has isfinite])
 fi
 
+AC_CACHE_CHECK([for exp2], ac_cv_exp2,
+ [AC_TRY_LINK([#include <math.h>],
+ [double x; x = exp2(x);],
+ ac_cv_exp2=yes,
+ ac_cv_exp2=no
+ )])
+ if test x"$ac_cv_exp2" = x"yes"; then
+        AC_DEFINE(HAVE_EXP2, [], [Has exp2])
+ fi
+
 AC_LANG_PUSH(C++)
 AC_CACHE_CHECK([whether $CXX implements __PRETTY_FUNCTION__], 
ac_cv_implements___PRETTY_FUNCTION__, [
   AC_TRY_LINK([#include <cstdio>
Index: libbase/utility.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/utility.h,v
retrieving revision 1.28
diff -u -p -r1.28 utility.h
--- libbase/utility.h   27 Aug 2007 18:12:30 -0000      1.28
+++ libbase/utility.h   27 Aug 2007 18:25:10 -0000
@@ -116,7 +116,9 @@ const float LN_2 = 0.693147180559945f;
 inline float   log2(float f) { return std::log(f) / LN_2; }
 //exp2 might be missing on Net-/OpenBSD.
 // TODO: check availability with a configure macro 
-//inline float exp2(double x) { return std::pow((double)2, double(x)); }
+#ifndef HAVE_EXP2
+inline float   exp2(double x) { return std::pow((double)2, double(x)); }
+#endif
 inline int     fchop( float f ) { return (int) f; }    // replace w/ inline 
asm if desired
 inline int     frnd(float f) { return fchop(f + 0.5f); }       // replace with 
inline asm if desired
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]