GNOME Bugzilla – Bug 630802
videotestsrc.c doesn't compile in Visual Studio 2008
Last modified: 2010-10-05 18:28:56 UTC
It complains about the missing rint function. I propose adding the following few lines of code in the beginning of the file. #ifdef _MSC_VER double rint(double x) { return floor(x + 0.5); } #endif
According to rint(3), the test should be something like #if (! (_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 || _ISOC99_SOURCE))
Or let configure check for rint. That's what we're doing (almost?) everywhere for the other C99 functions
(In reply to comment #2) > Or let configure check for rint. That's what we're doing (almost?) everywhere > for the other C99 functions There is no configure in MSVC. There is something like generated and manually edited config.h
Created attachment 171687 [details] [review] Defining rint function, if a system library doesn't have one
This should fix it. Please re-open if not (make sure to update core as well): commit 383f7edaf40577ea1d452fa0b14facf04946ce14 Author: Tim-Philipp Müller <tim.muller@collabora.co.uk> Date: Tue Oct 5 19:13:43 2010 +0100 videotestsrc: include new math-compat.h header for rint() on MSVC Should fix compilation with Visual Studio 2008. https://bugzilla.gnome.org/show_bug.cgi?id=630802 (In reply to comment #1) > According to rint(3), the test should be something like > > #if (! (_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 || _ISOC99_SOURCE)) I don't think this is to test if the feature is available, but rather what needs to be defined for glibc to expose this.