Bug 41185 - lround func call missing definition under MSVC leads to always zero returns
Summary: lround func call missing definition under MSVC leads to always zero returns
Status: RESOLVED MOVED
Alias: None
Product: cairo
Classification: Unclassified
Component: win32 backend (show other bugs)
Version: 1.10.2
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: cairo-bugs mailing list
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-25 08:20 UTC by fmot.fics
Modified: 2018-08-25 13:42 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description fmot.fics 2011-09-25 08:20:23 UTC
There is a piece of code in cairoint.h:
#if DISABLE_SOME_FLOATING_POINT
cairo_private int
_cairo_lround (double d) cairo_const;
#else
#define _cairo_lround lround
#endif

This code works well if lround defitionion was met before. However if cairo is compiler using MSVC there is no lround definition.
And argument is passed as int. Return from lround is thus unpredictable, but most probably zero.

I'd suggest a simple following workaround:
#if DISABLE_SOME_FLOATING_POINT
cairo_private int
_cairo_lround (double d) cairo_const;
#else
#ifdef _MSC_VER
long int lround(double x);
#endif
#define _cairo_lround lround
#endif

The bug is difficult to find. The code compiles well, does not crash but text is not printed.
Comment 1 GitLab Migration User 2018-08-25 13:42:47 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/155.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.