diff --git a/src/cairo-misc.c b/src/cairo-misc.c index 56409afc3..32c2428ce 100644 --- a/src/cairo-misc.c +++ b/src/cairo-misc.c @@ -463,6 +463,7 @@ _cairo_operator_bounded_by_either (cairo_operator_t op) } +#if DISABLE_SOME_FLOATING_POINT /* This function is identical to the C99 function lround(), except that it * performs arithmetic rounding (floor(d + .5) instead of away-from-zero rounding) and * has a valid input range of (INT_MIN, INT_MAX] instead of @@ -673,6 +674,7 @@ _cairo_lround (double d) #undef MSW #undef LSW } +#endif /* Convert a 32-bit IEEE single precision floating point number to a * 'half' representation (s10.5) diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c index 3e48ebbb0..b7f3aa2b7 100644 --- a/src/cairo-ps-surface.c +++ b/src/cairo-ps-surface.c @@ -880,8 +880,8 @@ _cairo_ps_surface_get_page_media (cairo_ps_surface_t *surface) page->name = strdup (page_name); } else { snprintf (buf, sizeof (buf), "%dx%dmm", - _cairo_lround (surface->width * 25.4/72), - _cairo_lround (surface->height * 25.4/72)); + (int) _cairo_lround (surface->width * 25.4/72), + (int) _cairo_lround (surface->height * 25.4/72)); page->name = strdup (buf); } diff --git a/src/cairoint.h b/src/cairoint.h index acc5769e4..9cd5cfab6 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -947,8 +947,13 @@ _cairo_round (double r) return floor (r + .5); } +#if DISABLE_SOME_FLOATING_POINT cairo_private int _cairo_lround (double d) cairo_const; +#else +#define _cairo_lround lround +#endif + cairo_private uint16_t _cairo_half_from_float (float f) cairo_const;