GTEST_SRC_CHECK
VALGRIND_CHECK
+case $host_cpu in
+ x86_64 )
+ default_float=no
+ default_double=no
+ ;;
+ *)
+ default_float=yes
+ default_double=yes
+ # Argh, the epsilon values are likely wrong :-/
+ ;;
+esac
+
+AC_ARG_ENABLE([float],
+ [AS_HELP_STRING([--enable-float],
+ [Enable use of the `float' type.])],
+ [enable_float=${enableval}],
+ [enable_float=${default_float}])
+
+AC_ARG_ENABLE([double],
+ [AS_HELP_STRING([--enable-double],
+ [Enable use of the `double' type.])],
+ [enable_double=${enableval}],
+ [enable_double=${default_double}])
+
+if test "x$enable_float" != xno; then
+ AC_DEFINE([ENABLE_FLOAT], [1], [enable use of the `float' type])
+fi
+if test "x$enable_double" != xno; then
+ AC_DEFINE([ENABLE_DOUBLE], [1], [enable use of the `double' type])
+fi
+
AC_SUBST([BROT2_CFLAGS], [${pkg_cflags}])
AC_SUBST([BROT2_CXXFLAGS], [${pkg_cxxflags}])
#include <map>
#include <iostream>
#include "Registry.h"
+#include "config.h"
namespace Fractal {
typedef long double Value; // short for "fractal value"
typedef std::complex<Value> Point; // "complex fractal point"
+#ifdef ENABLE_DOUBLE
+#define MAYBE_DO_DOUBLE(_DO) _DO(double,Double,0.00000000000000044408920985006L /* 4.44e-16 */)
+#else
+#define MAYBE_DO_DOUBLE(_DO)
+#endif
+
+#ifdef ENABLE_FLOAT
+#define MAYBE_DO_FLOAT(_DO) _DO(float, Float, 0.0000002384185791016)
+#else
+#define MAYBE_DO_FLOAT(_DO)
+#endif
+
// Master list of all maths types we know about.
// Format: _DO(type name, enum name, minimum pixel size)
-#define ALL_MATHS_TYPES(_DO) \
- _DO(double,Double,0.00000000000000044408920985006L /* 4.44e-16 */) \
+#define ALL_MATHS_TYPES(_DO) \
+ MAYBE_DO_FLOAT(_DO) \
+ MAYBE_DO_DOUBLE(_DO) \
_DO(long double, LongDouble, 0.0000000000000000002168404345L /* 2.16e-19 */) \
- _DO(float, Float, 0.0000002384185791016) \
class Maths {