Fix include <exiv2/exiv2.hpp> to include exiv2/config.h (and consequential changes)

Fix cltest.cpp and version.cpp to report MSVC 2017 in which _MSC_VER == 1910
This commit is contained in:
clanmills 2018-08-31 19:50:43 +01:00 committed by Luis Díaz Más
parent 6f5c339859
commit 3c42fdddeb
7 changed files with 14 additions and 4 deletions

View File

@ -1,4 +1,4 @@
// File generated by cmake from config/config.h.cmake.
// File generated by cmake from cmake/config.h.cmake.
#pragma once
#ifndef _EXV_CONF_H_

View File

@ -5,6 +5,8 @@ int main(int,const char**)
const char* vs[] = { "unknown" , "2005", "2008", "2010", "2012", "2013", "2015","2017" };
int v = (_MSC_VER-1300)/100;
if ( v < 0 || v >= (sizeof(vs)/sizeof(vs[0])) ) v = 0;
if ( v == 6 && _MSC_VER >= 1910 ) v++ ; // 2017 _MSC_VAR == 1910!
fprintf(stderr,"_%s = %d (%s) sizeof(void*) = %d\n","MSC_VER",_MSC_VER,vs[v],(int)sizeof(void*));
return 0;
}

View File

@ -30,6 +30,7 @@
// *****************************************************************************
// included header files
#include "exiv2/config.h"
#include "exiv2/datasets.hpp"
#include "exiv2/basicio.hpp"
#include "exiv2/bmpimage.hpp"

View File

@ -22,7 +22,10 @@
// Params::getopt() rc = 0
#include <exiv2/exiv2.hpp>
// getopt.{cpp|hpp} is not part of libexiv2
#include "getopt.hpp"
#ifdef EXV_HAVE_UNISTD_H
#include <unistd.h>
#endif
@ -33,7 +36,6 @@
#define Safe(x) (x?x:"unknown")
const char* optstring = ":hVvqfbuktTFa:Y:O:D:r:p:P:d:e:i:c:m:M:l:S:g:K:n:Q:";
// *****************************************************************************
// class Params
class Params : public Util::Getopt {
@ -83,7 +85,7 @@ int main(int argc, char** const argv)
{
int n;
#if EXV_HAVE_UNISTD_H
#ifdef EXV_HAVE_UNISTD_H
std::cout << "standard getopt()" << std::endl;
do {
n = ::getopt(argc,argv,::optstring);

View File

@ -33,6 +33,7 @@
#include <fstream>
#include <cassert>
// include local header files which are not part of libexiv2
#include "getopt.hpp"
#include "metacopy.hpp"

View File

@ -27,9 +27,11 @@
*/
// *****************************************************************************
// included header files
#include "config.h"
#include <exiv2/exiv2.hpp>
// include local header files which are not part of libexiv2
#include "exiv2app.hpp"
#include "getopt.hpp"
#include "actions.hpp"
#include "utils.hpp"
#include "convert.hpp"

View File

@ -200,6 +200,8 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys)
// 7.10 = 2003 8.00 = 2005 etc 12.00 = 2013 13.00 = 2015 (yet the installer labels it as 14.0!)
size_t edition = (_MSC_VER-600)/100;
const char* editions[] = { "0","1","2","3","4","5","6","2003", "2005", "2008", "2010", "2012","2013","2015","2017"};
if ( edition == 13 && _MSC_VER >= 1910 ) edition++ ; // 2017 _MSC_VAR == 1910!
if ( edition > lengthof(editions) ) edition = 0 ;
if ( edition ) sprintf(version+::strlen(version)," (%s/%s)",editions[edition],bits==64?"x64":"x86");
#define __VERSION__ version