From 6b262e2ddc706f935b55c1ca404ea3fb91467ab2 Mon Sep 17 00:00:00 2001 From: Syping Date: Fri, 29 Oct 2021 12:33:43 +0200 Subject: [PATCH] C API: bool -> int, size_t included --- src/RagePhoto.cpp | 3 +-- src/RagePhoto.h | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/RagePhoto.cpp b/src/RagePhoto.cpp index 2fff99d..48f200e 100644 --- a/src/RagePhoto.cpp +++ b/src/RagePhoto.cpp @@ -865,14 +865,13 @@ inline void RagePhoto::uInt32ToCharLE(uint32_t x, char *y) y[3] = x >> 24; } -// C API #ifdef LIBRAGEPHOTO_C_API ragephoto_t ragephoto_open() { return new RagePhoto; } -bool ragephoto_load(ragephoto_t instance, const char *data, size_t size) +int ragephoto_load(ragephoto_t instance, const char *data, size_t size) { RagePhoto *ragePhoto = static_cast(instance); return ragePhoto->load(data, size); diff --git a/src/RagePhoto.h b/src/RagePhoto.h index 15bb4e2..57661ec 100644 --- a/src/RagePhoto.h +++ b/src/RagePhoto.h @@ -176,6 +176,7 @@ extern "C" { #else #include "libragephoto_global.h" #include +#include #endif typedef void* ragephoto_t; @@ -189,7 +190,7 @@ LIBRAGEPHOTO_EXPORT ragephoto_t ragephoto_open(); * \param data Photo data * \param size Photo data size */ -LIBRAGEPHOTO_EXPORT bool ragephoto_load(ragephoto_t instance, const char *data, size_t size); +LIBRAGEPHOTO_EXPORT int ragephoto_load(ragephoto_t instance, const char *data, size_t size); /** Returns the Photo JPEG data. * \param instance \p ragephoto_t instance