From 628f81b3239341a6f2a5f4e5a990f53083cf2233 Mon Sep 17 00:00:00 2001 From: Gildas Bazin Date: Mon, 7 Feb 2005 10:44:49 +0000 Subject: [PATCH] * include/vlc_common.h, include/modules_inner.h, modules/codec/ffmpeg/: MSVC build fixes by Steve Lhomme (steve dot lhomme at free dot fr) + IMPORT_SYMBOL change by me. --- include/modules_inner.h | 6 ++++++ include/vlc_common.h | 13 ++++--------- modules/codec/ffmpeg/audio.c | 2 +- modules/codec/ffmpeg/encoder.c | 4 ++-- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/modules_inner.h b/include/modules_inner.h index 8a408515b4..bebaf0c7e0 100644 --- a/include/modules_inner.h +++ b/include/modules_inner.h @@ -78,6 +78,12 @@ # define EXTERN_SYMBOL #endif +#if defined( USE_DLL ) +# define IMPORT_SYMBOL __declspec(dllimport) +#else +# define IMPORT_SYMBOL +#endif + #define MODULE_STRING STRINGIFY( MODULE_NAME ) /* diff --git a/include/vlc_common.h b/include/vlc_common.h index 1e5a0dfa79..93cd22cc22 100644 --- a/include/vlc_common.h +++ b/include/vlc_common.h @@ -526,11 +526,11 @@ static int64_t GCD( int64_t a, int64_t b ) { \ if( i_oldsize ) \ { \ - (p_ar) = realloc( p_ar, ((i_oldsize) + 1) * sizeof( *(p_ar) ) ); \ + (p_ar) = (void**)realloc( p_ar, ((i_oldsize) + 1) * sizeof( *(p_ar) ) ); \ } \ else \ { \ - (p_ar) = malloc( ((i_oldsize) + 1) * sizeof( *(p_ar) ) ); \ + (p_ar) = (void**)malloc( ((i_oldsize) + 1) * sizeof( *(p_ar) ) ); \ } \ if( (i_oldsize) - (i_pos) ) \ { \ @@ -932,6 +932,7 @@ typedef __int64 off_t; # define _OFF_T_DEFINED # else # define off_t __int64 + /* for wx compatibility typedef long off_t; */ # endif # endif @@ -956,13 +957,7 @@ typedef __int64 off_t; # define vsnprintf _vsnprintf # endif -# ifndef _T -# ifdef UNICODE -# define _T(q) L##q -# else -# define _T(q) q -# endif -# endif +# include #endif /* lseek (defined in src/extras/libc.c) */ diff --git a/modules/codec/ffmpeg/audio.c b/modules/codec/ffmpeg/audio.c index 31f79a1d41..5b33b95931 100644 --- a/modules/codec/ffmpeg/audio.c +++ b/modules/codec/ffmpeg/audio.c @@ -116,7 +116,7 @@ int E_(InitAudioDec)( decoder_t *p_dec, AVCodecContext *p_context, malloc( p_dec->fmt_in.i_extra + FF_INPUT_BUFFER_PADDING_SIZE ); memcpy( p_sys->p_context->extradata, p_dec->fmt_in.p_extra, p_dec->fmt_in.i_extra ); - memset( p_sys->p_context->extradata + p_dec->fmt_in.i_extra, 0, + memset( (char*)p_sys->p_context->extradata + p_dec->fmt_in.i_extra, 0, FF_INPUT_BUFFER_PADDING_SIZE ); } diff --git a/modules/codec/ffmpeg/encoder.c b/modules/codec/ffmpeg/encoder.c index ab8b673154..f089afa783 100644 --- a/modules/codec/ffmpeg/encoder.c +++ b/modules/codec/ffmpeg/encoder.c @@ -156,8 +156,8 @@ static const char *ppsz_enc_options[] = { /***************************************************************************** * OpenEncoder: probe the encoder *****************************************************************************/ -extern int16_t ff_mpeg4_default_intra_matrix[]; -extern int16_t ff_mpeg4_default_non_intra_matrix[]; +extern int16_t IMPORT_SYMBOL ff_mpeg4_default_intra_matrix[]; +extern int16_t IMPORT_SYMBOL ff_mpeg4_default_non_intra_matrix[]; int E_(OpenEncoder)( vlc_object_t *p_this ) { -- 2.39.2