From f3eb9dfafe54535a43a7ca29288a9e93d1f410ae Mon Sep 17 00:00:00 2001 From: Themaister Date: Sat, 11 Jan 2014 12:21:43 +0100 Subject: [PATCH] Make RPNG compilable outside RetroArch without source hacking. --- gfx/rpng/rpng.c | 8 ++++++++ gfx/rpng/rpng.h | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/gfx/rpng/rpng.c b/gfx/rpng/rpng.c index 8fad551aa4..8389a9e32f 100644 --- a/gfx/rpng/rpng.c +++ b/gfx/rpng/rpng.c @@ -20,7 +20,15 @@ #include #include #include + +#ifdef RARCH_INTERNAL #include "../../hash.h" +#else +static inline uint32_t crc32_calculate(const uint8_t *data, size_t length) +{ + return crc32(0, data, length); +} +#endif // Decodes a subset of PNG standard. // Does not handle much outside 24/32-bit RGB(A) images. diff --git a/gfx/rpng/rpng.h b/gfx/rpng/rpng.h index 0ee0a2f8e9..eeb4f725d4 100644 --- a/gfx/rpng/rpng.h +++ b/gfx/rpng/rpng.h @@ -17,7 +17,10 @@ #define RPNG_H__ #include -#include "../../boolean.h" + +#ifndef __cplusplus +#include +#endif #ifdef HAVE_CONFIG_H #include "../../config.h"