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:
parent
6f5c339859
commit
3c42fdddeb
@ -1,4 +1,4 @@
|
|||||||
// File generated by cmake from config/config.h.cmake.
|
// File generated by cmake from cmake/config.h.cmake.
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#ifndef _EXV_CONF_H_
|
#ifndef _EXV_CONF_H_
|
||||||
|
|||||||
@ -5,6 +5,8 @@ int main(int,const char**)
|
|||||||
const char* vs[] = { "unknown" , "2005", "2008", "2010", "2012", "2013", "2015","2017" };
|
const char* vs[] = { "unknown" , "2005", "2008", "2010", "2012", "2013", "2015","2017" };
|
||||||
int v = (_MSC_VER-1300)/100;
|
int v = (_MSC_VER-1300)/100;
|
||||||
if ( v < 0 || v >= (sizeof(vs)/sizeof(vs[0])) ) v = 0;
|
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*));
|
fprintf(stderr,"_%s = %d (%s) sizeof(void*) = %d\n","MSC_VER",_MSC_VER,vs[v],(int)sizeof(void*));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
// *****************************************************************************
|
// *****************************************************************************
|
||||||
// included header files
|
// included header files
|
||||||
|
#include "exiv2/config.h"
|
||||||
#include "exiv2/datasets.hpp"
|
#include "exiv2/datasets.hpp"
|
||||||
#include "exiv2/basicio.hpp"
|
#include "exiv2/basicio.hpp"
|
||||||
#include "exiv2/bmpimage.hpp"
|
#include "exiv2/bmpimage.hpp"
|
||||||
|
|||||||
@ -22,7 +22,10 @@
|
|||||||
// Params::getopt() rc = 0
|
// Params::getopt() rc = 0
|
||||||
|
|
||||||
#include <exiv2/exiv2.hpp>
|
#include <exiv2/exiv2.hpp>
|
||||||
|
|
||||||
|
// getopt.{cpp|hpp} is not part of libexiv2
|
||||||
#include "getopt.hpp"
|
#include "getopt.hpp"
|
||||||
|
|
||||||
#ifdef EXV_HAVE_UNISTD_H
|
#ifdef EXV_HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
@ -33,7 +36,6 @@
|
|||||||
#define Safe(x) (x?x:"unknown")
|
#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:";
|
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
|
||||||
class Params : public Util::Getopt {
|
class Params : public Util::Getopt {
|
||||||
@ -83,7 +85,7 @@ int main(int argc, char** const argv)
|
|||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
#if EXV_HAVE_UNISTD_H
|
#ifdef EXV_HAVE_UNISTD_H
|
||||||
std::cout << "standard getopt()" << std::endl;
|
std::cout << "standard getopt()" << std::endl;
|
||||||
do {
|
do {
|
||||||
n = ::getopt(argc,argv,::optstring);
|
n = ::getopt(argc,argv,::optstring);
|
||||||
|
|||||||
@ -33,6 +33,7 @@
|
|||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
// include local header files which are not part of libexiv2
|
||||||
#include "getopt.hpp"
|
#include "getopt.hpp"
|
||||||
#include "metacopy.hpp"
|
#include "metacopy.hpp"
|
||||||
|
|
||||||
|
|||||||
@ -27,9 +27,11 @@
|
|||||||
*/
|
*/
|
||||||
// *****************************************************************************
|
// *****************************************************************************
|
||||||
// included header files
|
// included header files
|
||||||
#include "config.h"
|
#include <exiv2/exiv2.hpp>
|
||||||
|
|
||||||
|
// include local header files which are not part of libexiv2
|
||||||
#include "exiv2app.hpp"
|
#include "exiv2app.hpp"
|
||||||
|
#include "getopt.hpp"
|
||||||
#include "actions.hpp"
|
#include "actions.hpp"
|
||||||
#include "utils.hpp"
|
#include "utils.hpp"
|
||||||
#include "convert.hpp"
|
#include "convert.hpp"
|
||||||
|
|||||||
@ -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!)
|
// 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;
|
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"};
|
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 > lengthof(editions) ) edition = 0 ;
|
||||||
if ( edition ) sprintf(version+::strlen(version)," (%s/%s)",editions[edition],bits==64?"x64":"x86");
|
if ( edition ) sprintf(version+::strlen(version)," (%s/%s)",editions[edition],bits==64?"x64":"x86");
|
||||||
#define __VERSION__ version
|
#define __VERSION__ version
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user