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 612961 - dvdreadsrc.c compile error with MSVC, missing GST_FUNCTION
dvdreadsrc.c compile error with MSVC, missing GST_FUNCTION
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-ugly
0.10.14
Other Windows
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-03-15 17:52 UTC by David Hoyt
Modified: 2010-10-18 16:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
win32/config.h patch (474 bytes, patch)
2010-03-15 17:52 UTC, David Hoyt
none Details | Review
win32/config.h patch (460 bytes, patch)
2010-03-16 20:19 UTC, David Hoyt
rejected Details | Review

Description David Hoyt 2010-03-15 17:52:48 UTC
Created attachment 156200 [details] [review]
win32/config.h patch

win32 config.h doesn't define GST_FUNCTION and as a result dvdreadsrc.c compilation fails with MSVC.

The attached patch fixes the problem for now. But it seems like configure needs to be updated to properly define the macro.
Comment 1 Sebastian Dröge (slomo) 2010-03-16 20:00:58 UTC
Not sure what the problem here is but all other win32 config.h don't define GST_FUNCTION either. What exactly is the compile error?
Comment 2 David Hoyt 2010-03-16 20:12:04 UTC
1>------ Build started: Project: gstdvdread, Configuration: Release Win32 ------
1>Compiling...
1>dvdreadsrc.c
1>..\..\..\..\..\Source\gst-plugins-ugly\ext\dvdread\dvdreadsrc.c(196) : error C2065: 'GST_FUNCTION' : undeclared identifier
1>..\..\..\..\..\Source\gst-plugins-ugly\ext\dvdread\dvdreadsrc.c(196) : error C4047: 'function' : 'const gchar *' differs in levels of indirection from 'int'
1>..\..\..\..\..\Source\gst-plugins-ugly\ext\dvdread\dvdreadsrc.c(196) : warning C4024: 'gst_debug_log' : different types for formal and actual parameter 4
1>..\..\..\..\..\Source\gst-plugins-ugly\ext\dvdread\dvdreadsrc.c(202) : error C2065: 'GST_FUNCTION' : undeclared identifier
1>..\..\..\..\..\Source\gst-plugins-ugly\ext\dvdread\dvdreadsrc.c(202) : error C4047: 'function' : 'const gchar *' differs in levels of indirection from 'int'
.
.
.
.
1>gstdvdread - 180 error(s), 90 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Comment 3 David Hoyt 2010-03-16 20:19:13 UTC
Created attachment 156303 [details] [review]
win32/config.h patch
Comment 4 David Hoyt 2010-03-16 20:19:48 UTC
I looked at it a bit more closely, and the difference is that in ugly's config.h, you use #undef. Elsewhere it's not even mentioned.

If you comment out the #undef GST_FUNCTION, then it proceeds to compile normally. I suppose that's the real fix.

I recompiled everything successfully after I removed #undef GST_FUNCTION completely.

I've attached a new patch with the changes.
Comment 5 Tim-Philipp Müller 2010-03-16 23:19:42 UTC
Any idea why this is not also a problem in gst-plugins-base? It looks like it also has an #undef GST_FUNCTION in win32/common/config.h ..
Comment 6 David Hoyt 2010-03-16 23:23:51 UTC
Not a clue.

I suppose we could have a bug in our build environment that's referencing the wrong win32/common/config.h in gst-plugins-base. I'll check it out ASAP, but I doubt that's the problem.

Perhaps dvdreadsrc is missing a header that base plugins have? I don't think so - I'm just thinking off the top of my head.
Comment 7 Tim-Philipp Müller 2010-03-22 15:13:50 UTC
Comment on attachment 156303 [details] [review]
win32/config.h patch

Any more info on why it works in -base but not in -ugly?

We would need to remove AG_GST_CHECK_FUNCTION from configure.ac to create a config.h without this undef.

However, I still don't really understand what's going on here.

dvdreadsrc.c includes config.h first thing. this undefines GST_FUNCTION, which shouldn't be a problem.

Now, at some point via #include <gst/gst.h> it includes gstinfo.h which has this blurb:

#ifndef GST_FUNCTION
#if defined (__GNUC__) || (defined (_MSC_VER) && _MSC_VER >= 1300)
#  define GST_FUNCTION     ((const char*) (__FUNCTION__))
#elif defined (__STDC__) && defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#  define GST_FUNCTION     ((const char*) (__func__))
#else
#  define GST_FUNCTION     ((const char*) ("???"))
#endif
#endif

which should define GST_FUNCTION to *something* in any case.

Could you look into it some more by any chance?
Comment 8 Tim-Philipp Müller 2010-05-17 19:08:01 UTC
I still would like to understand what the actual problem is here. It still doesn't really seem to entirely make sense to me.
Comment 9 David Hoyt 2010-05-17 19:11:55 UTC
I haven't had time to inspect it further at this point. But I will as soon as work lets up a bit. :)
Comment 10 Tobias Mueller 2010-10-16 14:49:21 UTC
Hm. David, have you had the chance to check?
Otherwise I'd close this bug soonish esp. since the attached patch has been rejected.
Comment 11 David Hoyt 2010-10-18 16:06:50 UTC
Go ahead and close it out. If there's an issue I'll discuss it on IRC and open a new bug report. I haven't had time to inspect it and most likely won't for a while.