#1126 Fixes submitted for msvc2003

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

@ -1,219 +1,217 @@
/**/ /**/
/* exv_msvc.h */ /* exv_msvc.h */
#ifndef _EXV_MSVC_H_ #pragma once
#define _EXV_MSVC_H_ #ifndef _EXV_MSVC_H_
#define _EXV_MSVC_H_
/* Define to 1 if you want to use `libssh' for SshIO. */
/* #undef EXV_USE_SSH */ /* Define to 1 if you want to use `libssh' for SshIO. */
/* #undef EXV_USE_SSH */
/* Define to 1 if you want to use `libcurl' in httpIO. */
/* #undef EXV_USE_CURL */ /* Define to 1 if you want to use `libcurl' in httpIO. */
/* #undef EXV_USE_CURL */
/* Define to 1 if you have the `alarm' function. */
/* #undef EXV_HAVE_ALARM */ /* Define to 1 if you have the `alarm' function. */
/* #undef EXV_HAVE_ALARM */
/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
don't. */ /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
/* #undef EXV_HAVE_DECL_STRERROR_R */ don't. */
/* #undef EXV_HAVE_DECL_STRERROR_R */
/* Define to 1 if you have the `gmtime_r' function. */
/* #undef EXV_HAVE_GMTIME_R */ /* Define to 1 if you have the `gmtime_r' function. */
/* #undef EXV_HAVE_GMTIME_R */
/* Define to 1 if you have the <inttypes.h> header file. */
/* #undef EXV_HAVE_INTTYPES_H */ /* Define to 1 if you have the <inttypes.h> header file. */
/* #undef EXV_HAVE_INTTYPES_H */
/* Define to 1 if you have the <libintl.h> header file. */
#define EXV_HAVE_LIBINTL_H 1 /* Define to 1 if you have the <libintl.h> header file. */
#define EXV_HAVE_LIBINTL_H 1
/* Define to 1 if you require video support. */
/* #undef EXV_ENABLE_VIDEO */ /* Define to 1 if you require video support. */
/* #undef EXV_ENABLE_VIDEO */
/* Define to 1 if you require webready support. */
/* #undef EXV_ENABLE_WEBREADY */ /* Define to 1 if you require webready support. */
/* #undef EXV_ENABLE_WEBREADY */
#ifndef EXV_COMMERCIAL_VERSION
#ifndef EXV_COMMERCIAL_VERSION
/* Define to 1 to enable translation of Nikon lens names. */
#define EXV_HAVE_LENSDATA 1 /* Define to 1 to enable translation of Nikon lens names. */
#define EXV_HAVE_LENSDATA 1
/* Define to 1 if translation of program messages to the user's
native language is requested. */ /* Define to 1 if translation of program messages to the user's
/* #undef EXV_ENABLE_NLS */ native language is requested. */
/* #undef EXV_ENABLE_NLS */
/* Define to 1 if you have the `iconv' function. */
/* #undef EXV_HAVE_ICONV */ /* Define to 1 if you have the `iconv' function. */
/* #undef EXV_HAVE_ICONV */
/* Define to 1 to enable conversion of UCS2 encoded Windows tags to UTF-8. */
#define EXV_HAVE_PRINTUCS2 1 /* Define to 1 to enable conversion of UCS2 encoded Windows tags to UTF-8. */
#define EXV_HAVE_PRINTUCS2 1
#endif /* !EXV_COMMERCIAL_VERSION */
#endif /* !EXV_COMMERCIAL_VERSION */
/* Define Windows unicode path support. */
/* #define EXV_UNICODE_PATH 1 */ /* Define Windows unicode path support. */
/* #undef EXV_UNICODE_PATH */
/* Define to `const' or to empty, depending on the second argument of `iconv'. */
/* #undef ICONV_ACCEPTS_CONST_INPUT */
#if defined ICONV_ACCEPTS_CONST_INPUT /* Define to `const' or to empty, depending on the second argument of `iconv'. */
#define EXV_ICONV_CONST const /* #undef ICONV_ACCEPTS_CONST_INPUT */
#else #if defined ICONV_ACCEPTS_CONST_INPUT
#define EXV_ICONV_CONST #define EXV_ICONV_CONST const
#endif #else
#define EXV_ICONV_CONST
/* Define to 1 if you have the <regex.h> header file. */ #endif
/* #undef EXV_HAVE_REGEX */
/* Define to 1 if you have the <regex.h> header file. */
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and /* #undef EXV_HAVE_REGEX */
to 0 otherwise. */
/* #undef EXV_HAVE_MALLOC */ /* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
/* Define to 1 if you have the <malloc.h> header file. */ /* #undef EXV_HAVE_MALLOC */
/* #undef EXV_HAVE_MALLOC_H */
/* Define to 1 if you have the <malloc.h> header file. */
/* Define to 1 if you have the <memory.h> header file. */ /* #undef EXV_HAVE_MALLOC_H */
/* #undef EXV_HAVE_MEMORY_H */
/* Define to 1 if you have the <memory.h> header file. */
/* Define to 1 if you have the `memset' function. */ /* #undef EXV_HAVE_MEMORY_H */
#define EXV_HAVE_MEMSET 1
/* Define to 1 if you have the `memset' function. */
/* Define to 1 if your system has a GNU libc compatible `realloc' function, #define EXV_HAVE_MEMSET 1
and to 0 otherwise. */
#define EXV_HAVE_REALLOC 1 /* Define to 1 if your system has a GNU libc compatible `realloc' function,
and to 0 otherwise. */
/* Define to 1 if stdbool.h conforms to C99. */ #define EXV_HAVE_REALLOC 1
/* #undef EXV_HAVE_STDBOOL_H */
/* Define to 1 if stdbool.h conforms to C99. */
/* Define to 1 if you have the <stdint.h> header file. */ /* #undef EXV_HAVE_STDBOOL_H */
/* #undef EXV_HAVE_STDINT_H */
/* Define to 1 if you have the <stdint.h> header file. */
/* Define to 1 if you have the <stdlib.h> header file. */ /* #undef EXV_HAVE_STDINT_H */
/* #undef EXV_HAVE_STDLIB_H */
/* Define to 1 if you have the <stdlib.h> header file. */
/* Define to 1 if you have the `strchr' function. */ /* #undef EXV_HAVE_STDLIB_H */
#define EXV_HAVE_STRCHR 1
/* Define to 1 if you have the `strchr' function. */
/* Define to 1 if you have the `strerror' function. */ #define EXV_HAVE_STRCHR 1
#define EXV_HAVE_STRERROR 1
/* Define to 1 if you have the `strerror' function. */
/* Define to 1 if you have the `strerror_r' function. */ #define EXV_HAVE_STRERROR 1
/* #undef EXV_HAVE_STRERROR_R */
/* Define to 1 if you have the `strerror_r' function. */
/* Define to 1 if you have the <strings.h> header file. */ /* #undef EXV_HAVE_STRERROR_R */
/* #undef EXV_HAVE_STRINGS_H */
/* Define to 1 if you have the <strings.h> header file. */
/* Define to 1 if you have the <string.h> header file. */ /* #undef EXV_HAVE_STRINGS_H */
/* #undef EXV_HAVE_STRING_H */
/* Define to 1 if you have the <string.h> header file. */
/* Define to 1 if you have the `strtol' function. */ /* #undef EXV_HAVE_STRING_H */
#define EXV_HAVE_STRTOL 1
/* Define to 1 if you have the `strtol' function. */
/* Define to 1 if you have the `mmap' function. */ #define EXV_HAVE_STRTOL 1
/* #undef EXV_HAVE_MMAP */
/* Define to 1 if you have the `mmap' function. */
/* Define to 1 if you have the `munmap' function. */ /* #undef EXV_HAVE_MMAP */
/* #undef EXV_HAVE_MUNMAP */
/* Define to 1 if you have the `munmap' function. */
/* Define to 1 if you have the <sys/stat.h> header file. */ /* #undef EXV_HAVE_MUNMAP */
/* #undef EXV_HAVE_SYS_STAT_H */
/* Define to 1 if you have the <sys/stat.h> header file. */
/* Define to 1 if you have the <sys/time.h> header file. */ /* #undef EXV_HAVE_SYS_STAT_H */
/* #undef EXV_HAVE_SYS_TIME_H */
/* Define to 1 if you have the <sys/time.h> header file. */
/* Define to 1 if you have the <sys/types.h> header file. */ /* #undef EXV_HAVE_SYS_TIME_H */
/* #undef EXV_HAVE_SYS_TYPES_H */
/* Define to 1 if you have the <sys/types.h> header file. */
/* Define to 1 if you have the `timegm' function. */ /* #undef EXV_HAVE_SYS_TYPES_H */
/* #undef EXV_HAVE_TIMEGM */
/* Define to 1 if you have the `timegm' function. */
/* Define to 1 if you have the <unistd.h> header file. */ /* #undef EXV_HAVE_TIMEGM */
/* #undef EXV_HAVE_UNISTD_H */
/* Define to 1 if you have the <unistd.h> header file. */
/* Define to 1 if you have the `vprintf' function. */ /* #undef EXV_HAVE_UNISTD_H */
#define EXV_HAVE_VPRINTF 1
/* Define to 1 if you have the `vprintf' function. */
/* Define to 1 if you have the <wchar.h> header file. */ #define EXV_HAVE_VPRINTF 1
/* #undef EXV_HAVE_WCHAR_H */
/* Define to 1 if you have the <wchar.h> header file. */
/* Define to 1 if you have the <sys/mman.h> header file. */ /* #undef EXV_HAVE_WCHAR_H */
/* #undef EXV_HAVE_SYS_MMAN_H */
/* Define to 1 if you have the <sys/mman.h> header file. */
/* Define to 1 if you have the `zlib' library. */ /* #undef EXV_HAVE_SYS_MMAN_H */
#define EXV_HAVE_LIBZ 1
/* Define to 1 if you have the `zlib' library. */
#if defined(_MSC_VER) && HAVE_LIBZ #define EXV_HAVE_LIBZ 1
#if (_MSC_VER < 1400) && !defined(vsnprintf)
#define vsnprintf _vsnprintf #if defined(_MSC_VER) && HAVE_LIBZ
#endif #if (_MSC_VER < 1400)// && !defined(vsnprintf)
#endif #define vsnprintf _vsnprintf
#endif
/* Define to 1 if you have the <process.h> header file. */ #endif
#define EXV_HAVE_PROCESS_H 1
/* Define to 1 if you have the <process.h> header file. */
/* Define to 1 if you have the Adobe XMP Toolkit. */ #define EXV_HAVE_PROCESS_H 1
#define EXV_HAVE_XMP_TOOLKIT 1
/* Define to 1 if you have the Adobe XMP Toolkit. */
/* Define to 1 if the system has the type `_Bool'. */ #define EXV_HAVE_XMP_TOOLKIT 1
/* #undef EXV_HAVE__BOOL */
/* Define to 1 if the system has the type `_Bool'. */
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing /* #undef EXV_HAVE__BOOL */
slash. */
/* #undef EXV_LSTAT_FOLLOWS_SLASHED_SYMLINK */ /* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */
/* Define to the address where bug reports for this package should be sent. */ /* #undef EXV_LSTAT_FOLLOWS_SLASHED_SYMLINK */
#define EXV_PACKAGE_BUGREPORT "ahuggel@gmx.net"
/* Define to the address where bug reports for this package should be sent. */
/* Define to the name of this package. */ #define EXV_PACKAGE_BUGREPORT "ahuggel@gmx.net"
#define EXV_PACKAGE "exiv2"
/* Define to the name of this package. */
/* Define to the full name of this package. */ #define EXV_PACKAGE "exiv2"
#define EXV_PACKAGE_NAME "exiv2"
/* Define to the full name of this package. */
/* Define to the full name and version of this package. */ #define EXV_PACKAGE_NAME "exiv2"
#define EXV_PACKAGE_STRING "exiv2 0.25"
/* Define to the full name and version of this package. */
/* Define to the one symbol short name of this package. */ #define EXV_PACKAGE_STRING "exiv2 0.25"
#define EXV_PACKAGE_TARNAME "exiv2"
/* Define to the one symbol short name of this package. */
/* Define to the version of this package. */ #define EXV_PACKAGE_TARNAME "exiv2"
#define EXV_PACKAGE_VERSION "0.25"
/* Define to the version of this package. */
/* Define to 1 if you have the ANSI C header files. */ #define EXV_PACKAGE_VERSION "0.25"
#define STDC_HEADERS 1
/* Define to 1 if you have the ANSI C header files. */
/* Define to 1 if strerror_r returns char *. */ #define STDC_HEADERS 1
/* #undef STRERROR_R_CHAR_P */
/* Define to 1 if strerror_r returns char *. */
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ /* #undef STRERROR_R_CHAR_P */
#define TIME_WITH_SYS_TIME 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
/* Define to 1 if your <sys/time.h> declares `struct tm'. */ #define TIME_WITH_SYS_TIME 1
/* #undef TM_IN_SYS_TIME */
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
/* Define to empty if `const' does not conform to ANSI C. */ /* #undef TM_IN_SYS_TIME */
/* #undef const */
/* Define to empty if `const' does not conform to ANSI C. */
/* Define to `__inline__' or `__inline' if that's what the C compiler /* #undef const */
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus /* Define to `__inline__' or `__inline' if that's what the C compiler
/* #undef inline */ calls it, or to nothing if 'inline' is not supported under any name. */
#endif #ifndef __cplusplus
/* #undef inline */
/* Define to rpl_malloc if the replacement function should be used. */ #endif
/* #undef malloc */
/* Define to rpl_malloc if the replacement function should be used. */
/* Define to `int' if <sys/types.h> does not define. */ /* #undef malloc */
/* #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; #endif
#endif
/* Define to rpl_realloc if the replacement function should be used. */
/* Define to rpl_realloc if the replacement function should be used. */ /* #undef realloc */
/* #undef realloc */
/* 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