$NetBSD: patch-ab,v 1.12 2011/11/07 12:14:15 drochner 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 2005-01-08 08:55:02.000000000 +0100 +++ src/lib/color_helpers.c 2006-07-19 18:11:42.222074773 +0200 @@ -1,4 +1,22 @@ +#include +#include + #include "color_helpers.h" + +#ifdef __DragonFly__ +#include +#endif + +#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__INTERIX) || \ + (defined(__DragonFly__) && __DragonFly_version <= 130002) \ + || defined(__sun) && defined(__SunOS_5_8) +#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 and between rgb and hls