After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 630802 - videotestsrc.c doesn't compile in Visual Studio 2008
videotestsrc.c doesn't compile in Visual Studio 2008
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Windows
: Normal normal
: 0.10.31
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-09-28 09:21 UTC by Vladimir Eremeev
Modified: 2010-10-05 18:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Defining rint function, if a system library doesn't have one (893 bytes, patch)
2010-10-04 11:09 UTC, Vladimir Eremeev
rejected Details | Review

Description Vladimir Eremeev 2010-09-28 09:21:47 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
Comment 1 Olivier Crête 2010-09-28 16:18:20 UTC
According to rint(3), the test should be something like

#if (! (_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 || _ISOC99_SOURCE))
Comment 2 Sebastian Dröge (slomo) 2010-09-28 16:29:29 UTC
Or let configure check for rint. That's what we're doing (almost?) everywhere for the other C99 functions
Comment 3 Vladimir Eremeev 2010-09-28 16:50:07 UTC
(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
Comment 4 Vladimir Eremeev 2010-10-04 11:09:40 UTC
Created attachment 171687 [details] [review]
Defining rint function, if a system library doesn't have one
Comment 5 Tim-Philipp Müller 2010-10-05 18:28:30 UTC
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.