[vlc-devel] [PATCH] prepare for VisualC

Jean-Baptiste Kempf jb at videolan.org
Thu Nov 17 15:38:39 CET 2011


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.

> +#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".

> +#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

Best Regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-npapi-Changed-files-to-be-compilable-by-VC.patch
Type: application/octet-stream
Size: 5267 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20111117/52e454d6/attachment.obj>


More information about the vlc-devel mailing list