From 5d7a50efee5c45554fc4e4f8889f6ba8589869af Mon Sep 17 00:00:00 2001 From: Vincent Rabaud Date: Mon, 19 Jun 2017 17:12:29 +0200 Subject: [PATCH] Get code to compile in C++. Change-Id: I2f56e6b71e33ffecdba9e4fa9ef8f891c88f850f --- examples/gifdec.c | 6 ++++++ src/enc/backward_references_enc.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/gifdec.c b/examples/gifdec.c index 5442aa50..4219352f 100644 --- a/examples/gifdec.c +++ b/examples/gifdec.c @@ -28,11 +28,17 @@ #define GIF_DISPOSE_SHIFT 2 // from utils/utils.h +#ifdef __cplusplus +extern "C" { +#endif extern void WebPCopyPlane(const uint8_t* src, int src_stride, uint8_t* dst, int dst_stride, int width, int height); extern void WebPCopyPixels(const WebPPicture* const src, WebPPicture* const dst); +#ifdef __cplusplus +} +#endif void GIFGetBackgroundColor(const ColorMapObject* const color_map, int bgcolor_index, int transparent_index, diff --git a/src/enc/backward_references_enc.c b/src/enc/backward_references_enc.c index ee59577a..02b69466 100644 --- a/src/enc/backward_references_enc.c +++ b/src/enc/backward_references_enc.c @@ -157,8 +157,8 @@ static PixOrCopyBlock* BackwardRefsNewBlock(VP8LBackwardRefs* const refs) { extern void VP8LBackwardRefsCursorAdd(VP8LBackwardRefs* const refs, const PixOrCopy v); -WEBP_INLINE void VP8LBackwardRefsCursorAdd(VP8LBackwardRefs* const refs, - const PixOrCopy v) { +void VP8LBackwardRefsCursorAdd(VP8LBackwardRefs* const refs, + const PixOrCopy v) { PixOrCopyBlock* b = refs->last_block_; if (b == NULL || b->size_ == refs->block_size_) { b = BackwardRefsNewBlock(refs);