#1126 Fixes submitted for msvc2003

v0.27.3
Robin Mills 9 years ago
parent 77f5549408
commit b46cac7790

@ -1,6 +1,7 @@
/**/ /**/
/* exv_msvc.h */ /* exv_msvc.h */
#pragma once
#ifndef _EXV_MSVC_H_ #ifndef _EXV_MSVC_H_
#define _EXV_MSVC_H_ #define _EXV_MSVC_H_
@ -50,7 +51,8 @@
#endif /* !EXV_COMMERCIAL_VERSION */ #endif /* !EXV_COMMERCIAL_VERSION */
/* Define Windows unicode path support. */ /* Define Windows unicode path support. */
/* #define EXV_UNICODE_PATH 1 */ /* #undef EXV_UNICODE_PATH */
/* Define to `const' or to empty, depending on the second argument of `iconv'. */ /* Define to `const' or to empty, depending on the second argument of `iconv'. */
/* #undef ICONV_ACCEPTS_CONST_INPUT */ /* #undef ICONV_ACCEPTS_CONST_INPUT */
@ -141,7 +143,7 @@
#define EXV_HAVE_LIBZ 1 #define EXV_HAVE_LIBZ 1
#if defined(_MSC_VER) && HAVE_LIBZ #if defined(_MSC_VER) && HAVE_LIBZ
#if (_MSC_VER < 1400) && !defined(vsnprintf) #if (_MSC_VER < 1400)// && !defined(vsnprintf)
#define vsnprintf _vsnprintf #define vsnprintf _vsnprintf
#endif #endif
#endif #endif
@ -201,9 +203,6 @@
/* Define to rpl_malloc if the replacement function should be used. */ /* Define to rpl_malloc if the replacement function should be used. */
/* #undef malloc */ /* #undef malloc */
/* Define to `int' if <sys/types.h> does not define. */
/* #undef HAVE_PID_T */
/* On Microsoft compilers pid_t has to be set to int. */ /* On Microsoft compilers pid_t has to be set to int. */
#ifndef HAVE_PID_T #ifndef HAVE_PID_T
typedef int pid_t; typedef int pid_t;
@ -215,5 +214,4 @@ typedef int pid_t;
/* Define to `unsigned' if <sys/types.h> does not define. */ /* Define to `unsigned' if <sys/types.h> does not define. */
/* #undef size_t */ /* #undef size_t */
#endif // _EXV_CONF_H_
#endif

@ -117,7 +117,12 @@ namespace Exiv2 {
bool tryenter() bool tryenter()
{ {
#ifdef MSDEV_2003
EnterCriticalSection(&lock_);
return true;
#else
return 0 != TryEnterCriticalSection(&lock_); return 0 != TryEnterCriticalSection(&lock_);
#endif
} }
private: private:

File diff suppressed because one or more lines are too long

@ -291,6 +291,9 @@ copy/y ..\..\..\zlib-1.2.3\projects\visualc6\Win32_DLL_Release\zlib1.dll $(OutDi
<File <File
RelativePath="..\..\src\image.cpp"> RelativePath="..\..\src\image.cpp">
</File> </File>
<File
RelativePath="..\..\src\ini.cpp">
</File>
<File <File
RelativePath="..\..\src\iptc.cpp"> RelativePath="..\..\src\iptc.cpp">
</File> </File>
@ -402,6 +405,9 @@ copy/y ..\..\..\zlib-1.2.3\projects\visualc6\Win32_DLL_Release\zlib1.dll $(OutDi
<File <File
RelativePath="..\..\src\version.cpp"> RelativePath="..\..\src\version.cpp">
</File> </File>
<File
RelativePath="..\..\src\webpimage.cpp">
</File>
<File <File
RelativePath="..\..\src\xmp.cpp"> RelativePath="..\..\src\xmp.cpp">
</File> </File>
@ -458,6 +464,9 @@ copy/y ..\..\..\zlib-1.2.3\projects\visualc6\Win32_DLL_Release\zlib1.dll $(OutDi
<File <File
RelativePath="..\..\include\exiv2\image.hpp"> RelativePath="..\..\include\exiv2\image.hpp">
</File> </File>
<File
RelativePath="..\..\src\ini_int.hpp">
</File>
<File <File
RelativePath="..\..\include\exiv2\iptc.hpp"> RelativePath="..\..\include\exiv2\iptc.hpp">
</File> </File>

@ -240,21 +240,21 @@ void Params::usage(std::ostream& os) const
std::string Params::printTarget(std::string before,int target,bool bPrint,std::ostream& out) std::string Params::printTarget(std::string before,int target,bool bPrint,std::ostream& out)
{ {
std::string t; std::string t;
if ( target & Params::ctExif ) t+= 'e'; if ( target & Params::ctExif ) t+= 'e';
if ( target & Params::ctXmpSidecar ) t+= 'X'; if ( target & Params::ctXmpSidecar ) t+= 'X';
if ( target & Params::ctXmpRaw ) t+= target & Params::ctXmpSidecar ? 'X' : 'R' ; if ( target & Params::ctXmpRaw ) t+= target & Params::ctXmpSidecar ? 'X' : 'R' ;
if ( target & Params::ctIptc ) t+= 'i'; if ( target & Params::ctIptc ) t+= 'i';
if ( target & Params::ctIccProfile ) t+= 'C'; if ( target & Params::ctIccProfile ) t+= 'C';
if ( target & Params::ctIptcRaw ) t+= 'I'; if ( target & Params::ctIptcRaw ) t+= 'I';
if ( target & Params::ctXmp ) t+= 'x'; if ( target & Params::ctXmp ) t+= 'x';
if ( target & Params::ctComment ) t+= 'c'; if ( target & Params::ctComment ) t+= 'c';
if ( target & Params::ctThumb ) t+= 't'; if ( target & Params::ctThumb ) t+= 't';
if ( target & Params::ctPreview ) t+= 'p'; if ( target & Params::ctPreview ) t+= 'p';
if ( target & Params::ctStdInOut ) t+= '-'; if ( target & Params::ctStdInOut ) t+= '-';
if ( bPrint ) out << before << " :" << t << std::endl; if ( bPrint ) out << before << " :" << t << std::endl;
return t; return t;
} }
void Params::help(std::ostream& os) const void Params::help(std::ostream& os) const
@ -1064,13 +1064,13 @@ namespace {
| Params::ctComment | Params::ctComment
| Params::ctXmp; break; | Params::ctXmp; break;
case 'X': case 'X':
Params::printTarget("X before",target); Params::printTarget("X before",target);
target |= Params::ctXmpSidecar|Params::ctExif | Params::ctIptc | Params::ctXmp ; // -eX target |= Params::ctXmpSidecar|Params::ctExif | Params::ctIptc | Params::ctXmp ; // -eX
Params::printTarget("X after1",target); Params::printTarget("X after1",target);
if ( i ) { // -eXX if ( i ) { // -eXX
target |= Params::ctXmpRaw ; target |= Params::ctXmpRaw ;
Params::printTarget("X after2",target); Params::printTarget("X after2",target);
target ^= Params::ctExif|Params::ctIptc|Params::ctXmp ; // turn off those bits target ^= Params::ctExif|Params::ctIptc|Params::ctXmp ; // turn off those bits
} }
Params::printTarget("X ending",target,false); Params::printTarget("X ending",target,false);
@ -1151,7 +1151,7 @@ namespace {
} }
int num = 0; int num = 0;
std::string line; std::string line;
while (std::getline(bStdin? std::cin : file, line)) { while (bStdin?std::getline(std::cin, line):std::getline(file, line)) {
ModifyCmd modifyCmd; ModifyCmd modifyCmd;
if (parseLine(modifyCmd, line, ++num)) { if (parseLine(modifyCmd, line, ++num)) {
modifyCmds.push_back(modifyCmd); modifyCmds.push_back(modifyCmd);

@ -599,6 +599,11 @@ namespace Exiv2 {
namespace Exiv2 { namespace Exiv2 {
namespace Internal { namespace Internal {
#ifdef MSDEV_2003
#undef vsnprintf
#define vsnprintf _vsnprintf
#endif
std::string stringFormat(const char* format, ...) std::string stringFormat(const char* format, ...)
{ {
std::string result; std::string result;

Loading…
Cancel
Save