$NetBSD: patch-ab,v 1.10 2005/11/04 20:11:47 tv Exp $

This patch makes imlib2 compile on systems that don't have an lround
function, which is defined in C99.

Needed at least for NetBSD-1.6.2 and NetBSD-2.0.

--- src/lib/color_helpers.c.orig	Sat Jan  8 16:55:02 2005
+++ src/lib/color_helpers.c	Wed Nov  2 08:00:28 2005
@@ -1,4 +1,18 @@
 #include "color_helpers.h"
+
+#ifdef __DragonFly__
+#include <sys/param.h>
+#endif
+
+#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__INTERIX) || \
+    (defined(__DragonFly__) && __DragonFly_version <= 130002)
+#define lround(x) my_lround(x)
+static long my_lround(double x)
+{
+	return (long) ((x) >= 0 ? (x) + 0.5 : (x) - 0.5);
+}
+#endif
+
 /*
  * Color space conversion helper routines
  * Convert between rgb and hsv adn between rgb and hls
