[MPlayer-dev-eng] Compiling MPlayer under Wine

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Oct 9 11:33:14 CEST 2011


On Sun, Oct 09, 2011 at 01:29:17AM +0200, Ingo Brückl wrote:
> Reimar Döffinger wrote on Sun, 9 Oct 2011 00:34:15 +0200:
> 
> > I am not sure DECLSPEC_HIDDEN has the same effect
> 
> Well, that's how I understood the gcc attribute's documentation:
> 
>   Hidden visibility indicates that the symbol will not be placed into the
>   dynamic symbol table, so no other "module" (executable or shared library)
>   can reference it directly.
> 
> I may have misunderstood.

By my understanding that means
1) It's completely pointless for MPlayer because there is only one
module
2) Symbol collisions between different source files in MPlayer would
still be possible, which is exactly what the static is supposed to
avoid.
Btw. it's also possible to just not use DEFINE_GUID but instead do it
manually as with the IID_IUnknown. Either way the same method should
probably be used everywhere.

> Reimar Döffinger wrote on Sun, 9 Oct 2011 00:45:43 +0200:
> 
> > So at the very least adding the NONAMELESSUNION define without
> > explaining its purpose is really, really bad for maintainability.
> 
> Is
> 
>   #define NONAMELESSUNION    // to access otherwise anonymous VARIANT union members
> 
> ok?

They should be accessible exactly the way the code currently does if
they are anonymous.
Maybe winegcc is broken for nested anonymous unions or something?

> >> --- loader/dshow/DS_Filter.c  2011-01-18 11:38:59.000000000 +0100
> >> +++ /home/ib/mplayer/loader/dshow/DS_Filter.c 2011-10-08 17:47:25.000000000 +0200
> >> @@ -16,6 +16,7 @@
> >>  typedef long STDCALL (*GETCLASS) (const GUID*, const GUID*, void**);
> >>
> >>  #ifndef WIN32_LOADER
> >> +#ifndef __WINE__
> >>  const GUID IID_IUnknown =
> >>  {
> >>      0x00000000, 0x0000, 0x0000,
> >> @@ -26,6 +27,7 @@
> >>      0x00000001, 0x0000, 0x0000,
> >>      {0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}
> >>  };
> >> +#endif
> 
> > Seems like a wine bug if it works on Windows but not with wine...
> > But see the previous file how to "fix" this using define hacks and a
> > static copy of IID_IUnknown.
> 
> Which "previous" file?
> 
> A
> 
>   #define __IUnknown_INTERFACE_DEFINED__
>   #define __IClassFactory_INTERFACE_DEFINED__
> 
> in stream/tvi_dshow won't work.

#define IID_IUnknown MP_IID_IUnknown
as in tvi_dshow.

> Reimar Döffinger wrote on Sun, 9 Oct 2011 00:46:32 +0200:
> 
> > Note that just removing the static probably wouldn't cause problems
> > currently, but it's not a good solution really.
> 
> So what do you suggest?

Moving the static in would be an option.
Though it might be most flexible to add a
MP_DEFINE_LOCAL_GUID that does everything to define a static GUID,
then whatever is necessary can be done and if necessary changed in one place.


More information about the MPlayer-dev-eng mailing list