GNOME Bugzilla – Bug 612961
dvdreadsrc.c compile error with MSVC, missing GST_FUNCTION
Last modified: 2010-10-18 16:24:05 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.
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?
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 ==========
Created attachment 156303 [details] [review] win32/config.h patch
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.
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 ..
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 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?
I still would like to understand what the actual problem is here. It still doesn't really seem to entirely make sense to me.
I haven't had time to inspect it further at this point. But I will as soon as work lets up a bit. :)
Hm. David, have you had the chance to check? Otherwise I'd close this bug soonish esp. since the attached patch has been rejected.
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.