#1109 MinGW/32. Correction to r4538 for all versions of msvc.

v0.27.3
Robin Mills 9 years ago
parent df62afe552
commit c78a76c45c

@ -70,6 +70,11 @@ EXIV2_RCSID("@(#) $Id$")
# include <utime.h> # include <utime.h>
#endif #endif
#if !defined(__MINGW__) && !defined(_MSC_VER)
#define _fileno(a)
#define _setmod(a,b)
#endif
// ***************************************************************************** // *****************************************************************************
// local declarations // local declarations
namespace { namespace {
@ -247,9 +252,7 @@ namespace Action {
option = option == Exiv2::kpsNone ? Exiv2::kpsXMP : option; // drop option = option == Exiv2::kpsNone ? Exiv2::kpsXMP : option; // drop
case Params::pmIccProfile:{ case Params::pmIccProfile:{
option = option == Exiv2::kpsNone ? Exiv2::kpsIccProfile : option; option = option == Exiv2::kpsNone ? Exiv2::kpsIccProfile : option;
#ifdef __MINGW__
_setmode(_fileno(stdout),O_BINARY); _setmode(_fileno(stdout),O_BINARY);
#endif
rc = printStructure(std::cout,option); rc = printStructure(std::cout,option);
} break; } break;
} }
@ -1069,11 +1072,9 @@ namespace Action {
path_ = path; path_ = path;
int rc = 0; int rc = 0;
#ifdef __MINGW__
if ( Params::instance().target_ & Params::ctStdInOut ) { if ( Params::instance().target_ & Params::ctStdInOut ) {
_setmode(_fileno(stdout),O_BINARY); _setmode(_fileno(stdout),O_BINARY);
} }
#endif
if (!rc && Params::instance().target_ & Params::ctThumb) { if (!rc && Params::instance().target_ & Params::ctThumb) {
rc = writeThumbnail(); rc = writeThumbnail();
@ -1265,11 +1266,9 @@ namespace Action {
return -1; return -1;
} }
#ifdef __MINGW__
if ( Params::instance().target_ & Params::ctStdInOut ) { if ( Params::instance().target_ & Params::ctStdInOut ) {
_setmode(_fileno(stdin),O_BINARY); _setmode(_fileno(stdin),O_BINARY);
} }
#endif
int rc = 0; int rc = 0;
Timestamp ts; Timestamp ts;

@ -1493,7 +1493,7 @@ namespace Exiv2 {
if (prot == pStdin) { if (prot == pStdin) {
if (isatty(fileno(stdin))) if (isatty(fileno(stdin)))
throw Error(53); throw Error(53);
#ifdef _MSC_VER #if defined(_MSC_VER) || defined(__MINGW__)
// convert stdin to binary // convert stdin to binary
if (_setmode(_fileno(stdin), _O_BINARY) == -1) if (_setmode(_fileno(stdin), _O_BINARY) == -1)
throw Error(54); throw Error(54);

Loading…
Cancel
Save