From da0cf4ff29e72b3109f13abc3dc1a13e84fbaafc Mon Sep 17 00:00:00 2001 From: Martchus Date: Mon, 4 Feb 2019 00:40:50 +0100 Subject: [PATCH] Fix build under Android platform >= 24 This alters the ABI but it is ok since with that config a build was previously impossible anyways. --- io/nativefilestream.cpp | 2 ++ io/nativefilestream.h | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/io/nativefilestream.cpp b/io/nativefilestream.cpp index 4705184..8bc0871 100644 --- a/io/nativefilestream.cpp +++ b/io/nativefilestream.cpp @@ -143,7 +143,9 @@ NativeFileStream::NativeFileStream() NativeFileStream::NativeFileStream(NativeFileStream &&other) : iostream(other.m_filebuf.release()) , m_filebuf(rdbuf()) +#if !defined(__ANDROID_API__) || !defined(__ANDROID_API_N__) || (__ANDROID_API__ < __ANDROID_API_N__) , m_fileHandle(other.m_fileHandle) +#endif { } diff --git a/io/nativefilestream.h b/io/nativefilestream.h index 2322a21..acd0326 100644 --- a/io/nativefilestream.h +++ b/io/nativefilestream.h @@ -28,7 +28,9 @@ public: void open(const std::string &path, std::ios_base::openmode openMode); void openFromFileDescriptor(int fileDescriptor, std::ios_base::openmode openMode); void close(); +#if !defined(__ANDROID_API__) || !defined(__ANDROID_API_N__) || (__ANDROID_API__ < __ANDROID_API_N__) FILE fileHandle(); +#endif static std::unique_ptr> makeFileBuffer(const std::string &path, ios_base::openmode openMode); static std::unique_ptr> makeFileBuffer(int fileDescriptor, ios_base::openmode openMode); @@ -40,7 +42,9 @@ private: void setFileBuffer(std::unique_ptr> buffer); std::unique_ptr> m_filebuf; +#if !defined(__ANDROID_API__) || !defined(__ANDROID_API_N__) || (__ANDROID_API__ < __ANDROID_API_N__) FILE m_fileHandle; +#endif }; inline NativeFileStream::NativeFileStream(const std::string &path, ios_base::openmode openMode) @@ -55,6 +59,7 @@ inline NativeFileStream::NativeFileStream(int fileDescriptor, ios_base::openmode openFromFileDescriptor(fileDescriptor, openMode); } +#if !defined(__ANDROID_API__) || !defined(__ANDROID_API_N__) || (__ANDROID_API__ < __ANDROID_API_N__) /*! * \brief Returns the underlying file handle if possible; otherwise the behaviour is undefined. * \deprecated Not implemented for any backend and will be removed in v5. @@ -64,6 +69,7 @@ inline FILE NativeFileStream::fileHandle() { return m_fileHandle; } +#endif #else // CPP_UTILITIES_USE_NATIVE_FILE_BUFFER