[vlc-devel] [PATCH] prepare for VisualC

Sergey Radionov rsatom at gmail.com
Thu Nov 17 16:37:21 CET 2011


2011/11/17 Jean-Baptiste Kempf <jb at videolan.org>

> On Thu, Nov 17, 2011 at 09:32:37PM +0700, Sergey Radionov wrote :
> > +#ifdef _MSC_VER
> > +
> > +const CATID CATID_SafeForScripting     =
> > +    {0x7dd95801, 0x9882, 0x11cf,
> {0x9f,0xa9,0x00,0xaa,0x00,0x6c,0x42,0xc4}};
> > +const CATID CATID_SafeForInitializing  =
> > +
>  {0x7dd95802,0x9882,0x11cf,{0x9f,0xa9,0x00,0xaa,0x00,0x6c,0x42,0xc4}};
> > +
> > +#else /*!_MSC_VER*/
> > +
> >  #include <_mingw.h>
> >
> >  #ifdef __MINGW64_VERSION_MAJOR
> > @@ -60,7 +69,7 @@ static DEFINE_GUID(CATID_SafeForScripting, \
> >       0x7DD95801, 0x9882, 0x11CF, 0x9F, 0xA9,
> 0x00,0xAA,0x00,0x6C,0x42,0xC4);
> >
> >  #endif /* __MINGW64_VERSION_MAJOR */
> > -
> > +#endif /*_MSC_VER*/
>
> I don't see why you can't use the same codepath here.
>
I don't understand what you mean.



>
> > +#ifdef _MSC_VER
> > +#define PROGID_STR "VideoLAN.VLCPlugin"
> > +#else
> >  #define PROGID_STR COMPANY_STR"."PROGRAM_STR
> > +#endif
> No. COMPANY_STR is "VideoLAN". You shouldn't need that.
> Else, redefine COMPANY_STR as  "VideoLAN".
>

Problem is that

#define PROGID_STR COMPANY_STR"."PROGRAM_STR
and some later
TEXT(PROGID_STR)

expands to

 L"VideoLAN"".""VLCPlugin"

and Visual C not understand this.
It want
L"VideoLAN"L"."L"VLCPlugin"
or
L"VideoLAN.VLCPlugin"

so we need replace TEXT(PROGID_STR) to PROGID_STR (without TEXT)
everywhere, and
#define COMPANY_STR "VideoLAN" to #define COMPANY_STR TEXT("VideoLAN")  and
#define PROGRAM_STR "VLCPlugin" to #define PROGRAM_STR TEXT("VLCPlugin") and
#define PROGID_STR COMPANY_STR"."PROGRAM_STR to #define PROGID_STR
COMPANY_STR TEXT(".") PROGRAM_STR
and maybe some more, I don't remember now...

so, I think,
> +#ifdef _MSC_VER
> +#define PROGID_STR "VideoLAN.VLCPlugin"
> +#else
>  #define PROGID_STR COMPANY_STR"."PROGRAM_STR
> +#endif
is simplest way to satisfy VC

> +#ifdef _MSC_VER
> > +                _snprintf(timeBuffer, sizeof(timeBuffer),
> ":start-time=%d", _i_time);
> > +#else
> >                  snprintf(timeBuffer, sizeof(timeBuffer),
> ":start-time=%d", _i_time);
> > +#endif
>
> #ifdef _MSC_VER
> # define snprintf _snprintf
> #endif
>
> WOuld be better and more global.
>
> > +#ifdef _MSC_VER
> > +        if( !_stricmp( n, h->n ) )
> > +#else
> >          if( !strcasecmp( n, h->n ) )
> > +#endif
>
> idem for _stricmp and strcasecmp
>
accepted.


> Best Regards,
>
> --
> Jean-Baptiste Kempf
> http://www.jbkempf.com/ - +33 672 704 734
> Sent from my Electronic Device
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20111117/dd42a648/attachment.html>


More information about the vlc-devel mailing list