fix linux compile and increase version
This commit is contained in:
@@ -1,8 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 2.6)
|
cmake_minimum_required(VERSION 3.1)
|
||||||
cmake_policy(VERSION 2.6)
|
|
||||||
if(POLICY CMP0063)
|
|
||||||
cmake_policy(SET CMP0063 OLD)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
project(TinyEXIF)
|
project(TinyEXIF)
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
@@ -14,12 +10,13 @@ find_package(tinyxml2 REQUIRED)
|
|||||||
################################
|
################################
|
||||||
# set lib version here
|
# set lib version here
|
||||||
|
|
||||||
set(GENERIC_LIB_VERSION "1.0.0")
|
set(GENERIC_LIB_VERSION "1.0.1")
|
||||||
set(GENERIC_LIB_SOVERSION "1")
|
set(GENERIC_LIB_SOVERSION "1")
|
||||||
|
|
||||||
################################
|
################################
|
||||||
# Add definitions
|
# Add definitions
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
|
||||||
|
|
||||||
################################
|
################################
|
||||||
|
|||||||
@@ -703,7 +703,7 @@ int EXIFInfo::parseFrom(EXIFStream& stream) {
|
|||||||
int EXIFInfo::parseFrom(const uint8_t* buf, unsigned len) {
|
int EXIFInfo::parseFrom(const uint8_t* buf, unsigned len) {
|
||||||
class EXIFStreamBuffer : public EXIFStream {
|
class EXIFStreamBuffer : public EXIFStream {
|
||||||
public:
|
public:
|
||||||
EXIFStreamBuffer(const uint8_t* buf, unsigned len)
|
explicit EXIFStreamBuffer(const uint8_t* buf, unsigned len)
|
||||||
: it(buf), end(buf+len) {}
|
: it(buf), end(buf+len) {}
|
||||||
bool IsValid() const override {
|
bool IsValid() const override {
|
||||||
return it != NULL;
|
return it != NULL;
|
||||||
@@ -722,7 +722,8 @@ int EXIFInfo::parseFrom(const uint8_t* buf, unsigned len) {
|
|||||||
private:
|
private:
|
||||||
const uint8_t* it, * const end;
|
const uint8_t* it, * const end;
|
||||||
};
|
};
|
||||||
return parseFrom(EXIFStreamBuffer(buf, len));
|
EXIFStreamBuffer stream(buf, len);
|
||||||
|
return parseFrom(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
#define TINYEXIF_MAJOR_VERSION 1
|
#define TINYEXIF_MAJOR_VERSION 1
|
||||||
#define TINYEXIF_MINOR_VERSION 0
|
#define TINYEXIF_MINOR_VERSION 0
|
||||||
#define TINYEXIF_PATCH_VERSION 0
|
#define TINYEXIF_PATCH_VERSION 1
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
# ifdef TINYEXIF_EXPORT
|
# ifdef TINYEXIF_EXPORT
|
||||||
|
|||||||
2
main.cpp
2
main.cpp
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
class EXIFStreamFile : public TinyEXIF::EXIFStream {
|
class EXIFStreamFile : public TinyEXIF::EXIFStream {
|
||||||
public:
|
public:
|
||||||
EXIFStreamFile(const char* fileName)
|
explicit EXIFStreamFile(const char* fileName)
|
||||||
: file(fileName, std::ifstream::in|std::ifstream::binary) {}
|
: file(fileName, std::ifstream::in|std::ifstream::binary) {}
|
||||||
bool IsValid() const override {
|
bool IsValid() const override {
|
||||||
return file.is_open();
|
return file.is_open();
|
||||||
|
|||||||
Reference in New Issue
Block a user