[FFmpeg-devel] [PATCH] fix MSVC compilation errors

Michael Niedermayer michael at niedermayer.cc
Sun Dec 3 23:26:37 EET 2017


On Sat, Dec 02, 2017 at 09:50:26PM +0100, Mateusz wrote:
> After commit 3701d49 'error_resilience: remove avpriv_atomic usage'
> we have included windows.h in much more files and we should
> avoid conflicts with defines/function declarations.
> 
> Signed-off-by: Mateusz Brzostek <mateuszb at poczta.onet.pl>
> ---
>  libavcodec/jpegls.h  | 4 ++++
>  libavcodec/mss2.c    | 6 +++---
>  libavformat/mxfenc.c | 2 +-
>  3 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/libavcodec/jpegls.h b/libavcodec/jpegls.h
> index c8997c7861..69a57b9538 100644
> --- a/libavcodec/jpegls.h
> +++ b/libavcodec/jpegls.h
> @@ -32,6 +32,10 @@
>  #include "avcodec.h"
>  #include "internal.h"
>  
> +#ifdef near
> +#undef near
> +#endif
> +
>  typedef struct JpeglsContext {
>      AVCodecContext *avctx;
>  } JpeglsContext;
> diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c
> index 9e7cc466de..f850349a0a 100644
> --- a/libavcodec/mss2.c
> +++ b/libavcodec/mss2.c
> @@ -464,9 +464,9 @@ static int decode_wmv9(AVCodecContext *avctx, const uint8_t *buf, int buf_size,
>      return 0;
>  }
>  
> -typedef struct Rectangle {
> +typedef struct ff_Rectangle {

Does Rect instead of ff_Rectangle work too ?

The ff_ is a bit confusng as its outside how we name structs
(struct identifers are capitalized)

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171203/6fe7cee2/attachment.sig>


More information about the ffmpeg-devel mailing list