From 0c44f4158562c6cfb1ee7f8b7a0b659828432ed0 Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 28 Sep 2012 21:21:41 -0700 Subject: [PATCH] src/webp/*.h: don't forward declare enums in C++ Change-Id: I36d3765e94d2b5529b321c186ccee1744785c5b3 fixes: error: ISO C++ forbids forward references to 'enum' types since: 28d25c8 replace 'typedef struct {} X;" by "typedef struct X X; struct X {};" --- src/webp/decode.h | 2 ++ src/webp/encode.h | 6 ++++-- src/webp/mux.h | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/webp/decode.h b/src/webp/decode.h index dd7bf999..8ffddb81 100644 --- a/src/webp/decode.h +++ b/src/webp/decode.h @@ -23,8 +23,10 @@ extern "C" { typedef struct WebPRGBABuffer WebPRGBABuffer; typedef struct WebPYUVABuffer WebPYUVABuffer; typedef struct WebPDecBuffer WebPDecBuffer; +#if !(defined(__cplusplus) || defined(c_plusplus)) typedef enum VP8StatusCode VP8StatusCode; typedef enum WEBP_CSP_MODE WEBP_CSP_MODE; +#endif typedef struct WebPIDecoder WebPIDecoder; typedef struct WebPBitstreamFeatures WebPBitstreamFeatures; typedef struct WebPDecoderOptions WebPDecoderOptions; diff --git a/src/webp/encode.h b/src/webp/encode.h index b9a61472..40e98236 100644 --- a/src/webp/encode.h +++ b/src/webp/encode.h @@ -20,14 +20,16 @@ extern "C" { #define WEBP_ENCODER_ABI_VERSION 0x0200 // MAJOR(8b) + MINOR(8b) +#if !(defined(__cplusplus) || defined(c_plusplus)) typedef enum WebPImageHint WebPImageHint; typedef enum WebPEncCSP WebPEncCSP; -typedef struct WebPConfig WebPConfig; typedef enum WebPPreset WebPPreset; +typedef enum WebPEncodingError WebPEncodingError; +#endif +typedef struct WebPConfig WebPConfig; typedef struct WebPPicture WebPPicture; // main structure for I/O typedef struct WebPAuxStats WebPAuxStats; typedef struct WebPMemoryWriter WebPMemoryWriter; -typedef enum WebPEncodingError WebPEncodingError; // Return the encoder's version number, packed in hexadecimal using 8bits for // each of major/minor/revision. E.g: v2.5.7 is 0x020507. diff --git a/src/webp/mux.h b/src/webp/mux.h index 73d83a78..81e19397 100644 --- a/src/webp/mux.h +++ b/src/webp/mux.h @@ -55,14 +55,18 @@ extern "C" { typedef struct WebPMux WebPMux; // main opaque object. typedef struct WebPData WebPData; +#if !(defined(__cplusplus) || defined(c_plusplus)) typedef enum WebPMuxError WebPMuxError; typedef enum WebPFeatureFlags WebPFeatureFlags; typedef enum WebPChunkId WebPChunkId; +#endif typedef struct WebPMuxFrameInfo WebPMuxFrameInfo; typedef struct WebPDemuxer WebPDemuxer; +#if !(defined(__cplusplus) || defined(c_plusplus)) typedef enum WebPDemuxState WebPDemuxState; typedef enum WebPFormatFeature WebPFormatFeature; +#endif typedef struct WebPIterator WebPIterator; typedef struct WebPChunkIterator WebPChunkIterator;