summaryrefslogtreecommitdiff
path: root/babl/babl-internal.h
diff options
context:
space:
mode:
authorJan Heller <jheller@svn.gnome.org>2008-05-20 22:11:12 +0000
committerJan Heller <jheller@src.gnome.org>2008-05-20 22:11:12 +0000
commit23903dead4065ba17afab115146883b6e3abc44c (patch)
tree4197376bb3dab2a88a3ca1ee7f6f1071fb01dbaf /babl/babl-internal.h
parentd43916b38fda1e0ab2e8b00c75569514d5267dd0 (diff)
fallback to floor function when rint function is not available.
2008-05-21 Jan Heller <jheller@svn.gnome.org> * babl/babl-internal.h: * babl/base/type-u16.c: * babl/base/type-u32.c: * babl/base/type-u8.c: * extensions/CIE-Lab.c: * extensions/gegl-fixups.c: * extensions/gggl-lies.c: * extensions/gggl.c: * extensions/gimp-8bit.c: * extensions/util.h: fallback to floor function when rint function is not available. * configure.ac: added check for rint function. svn path=/trunk/; revision=313
Diffstat (limited to 'babl/babl-internal.h')
-rw-r--r--babl/babl-internal.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/babl/babl-internal.h b/babl/babl-internal.h
index 6d20b2b..c7d6110 100644
--- a/babl/babl-internal.h
+++ b/babl/babl-internal.h
@@ -30,12 +30,15 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <math.h>
#include "assert.h"
#undef _BABL_INTERNAL_H
#include "babl.h"
#define _BABL_INTERNAL_H
+#include "config.h"
+
#include "babl-list.h"
#include "babl-hash-table.h"
#include "babl-db.h"
@@ -49,6 +52,13 @@
#define random rand
#endif
+/* fallback to floor function when rint is not around */
+#ifndef HAVE_RINT
+# define rint(f) ((long) floor (((double) f) + 0.5))
+#endif
+
+
+
Babl * babl_conversion_find (const void *source,
const void *destination);
double babl_conversion_error (BablConversion *conversion);