fix linux compile and increase version

This commit is contained in:
cDc
2017-12-09 14:53:52 +02:00
parent af81c87222
commit 87c343b4f1
4 changed files with 8 additions and 10 deletions

View File

@@ -1,8 +1,4 @@
cmake_minimum_required(VERSION 2.6)
cmake_policy(VERSION 2.6)
if(POLICY CMP0063)
cmake_policy(SET CMP0063 OLD)
endif()
cmake_minimum_required(VERSION 3.1)
project(TinyEXIF)
include(GNUInstallDirs)
@@ -14,12 +10,13 @@ find_package(tinyxml2 REQUIRED)
################################
# set lib version here
set(GENERIC_LIB_VERSION "1.0.0")
set(GENERIC_LIB_VERSION "1.0.1")
set(GENERIC_LIB_SOVERSION "1")
################################
# Add definitions
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
################################

View File

@@ -703,7 +703,7 @@ int EXIFInfo::parseFrom(EXIFStream& stream) {
int EXIFInfo::parseFrom(const uint8_t* buf, unsigned len) {
class EXIFStreamBuffer : public EXIFStream {
public:
EXIFStreamBuffer(const uint8_t* buf, unsigned len)
explicit EXIFStreamBuffer(const uint8_t* buf, unsigned len)
: it(buf), end(buf+len) {}
bool IsValid() const override {
return it != NULL;
@@ -722,7 +722,8 @@ int EXIFInfo::parseFrom(const uint8_t* buf, unsigned len) {
private:
const uint8_t* it, * const end;
};
return parseFrom(EXIFStreamBuffer(buf, len));
EXIFStreamBuffer stream(buf, len);
return parseFrom(stream);
}
//

View File

@@ -39,7 +39,7 @@
#define TINYEXIF_MAJOR_VERSION 1
#define TINYEXIF_MINOR_VERSION 0
#define TINYEXIF_PATCH_VERSION 0
#define TINYEXIF_PATCH_VERSION 1
#ifdef _MSC_VER
# ifdef TINYEXIF_EXPORT

View File

@@ -11,7 +11,7 @@
class EXIFStreamFile : public TinyEXIF::EXIFStream {
public:
EXIFStreamFile(const char* fileName)
explicit EXIFStreamFile(const char* fileName)
: file(fileName, std::ifstream::in|std::ifstream::binary) {}
bool IsValid() const override {
return file.is_open();