Hi,

when including avutil/log.h in the code compiled as C++, g++ 4.6
produces the following error because of missing AVClass struct name in
the declaration.

log.h:89:3: error: conflicting declaration ‘typedef struct AVClass AVClass’
log.h:88:18: error: ‘struct AVClass’ has a previous declaration as
‘struct AVClass’

Trivial fix attached.

Regards,
-- 
Jindrich Makovicka
From 9a2a7b9a25e9c7ba5beb32b3a752aaaa7c81ae35 Mon Sep 17 00:00:00 2001
From: Jindrich Makovicka <[email protected]>
Date: Wed, 12 Oct 2011 22:30:56 +0200
Subject: [PATCH] log.h: add struct name to allow using avcodec with C++ code
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

fixes a build error with gcc 4.6:

log.h:89:3: error: conflicting declaration ‘typedef struct AVClass AVClass’
log.h:88:18: error: ‘struct AVClass’ has a previous declaration as ‘struct AVClass’
---
 libavutil/log.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavutil/log.h b/libavutil/log.h
index 18d0ddf..0678e1a 100644
--- a/libavutil/log.h
+++ b/libavutil/log.h
@@ -30,7 +30,7 @@
  * arbitrary struct of which the first field is a pointer to an
  * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).
  */
-typedef struct {
+typedef struct AVClass {
     /**
      * The name of the class; usually it is the same name as the
      * context structure type to which the AVClass is associated.
-- 
1.7.7

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to