Commit 71b7ed9f4f2c88fbdd0eb5a4796beb948fd8188c
Committed by
Jay Berkenbilt
1 parent
86287acf
"_setmode" and "_stricmp" are not available on Borland C++Builder, neither the c…
…lassic one nor newer ones based on CLANG.
Showing
1 changed file
with
9 additions
and
3 deletions
libqpdf/QUtil.cc
| @@ -529,7 +529,9 @@ QUtil::hex_decode(std::string const& input) | @@ -529,7 +529,9 @@ QUtil::hex_decode(std::string const& input) | ||
| 529 | void | 529 | void |
| 530 | QUtil::binary_stdout() | 530 | QUtil::binary_stdout() |
| 531 | { | 531 | { |
| 532 | -#ifdef _WIN32 | 532 | +#if defined(_WIN32) && defined(__BORLANDC__) |
| 533 | + setmode(_fileno(stdout), _O_BINARY); | ||
| 534 | +#elif defined(_WIN32) | ||
| 533 | _setmode(_fileno(stdout), _O_BINARY); | 535 | _setmode(_fileno(stdout), _O_BINARY); |
| 534 | #endif | 536 | #endif |
| 535 | } | 537 | } |
| @@ -537,7 +539,9 @@ QUtil::binary_stdout() | @@ -537,7 +539,9 @@ QUtil::binary_stdout() | ||
| 537 | void | 539 | void |
| 538 | QUtil::binary_stdin() | 540 | QUtil::binary_stdin() |
| 539 | { | 541 | { |
| 540 | -#ifdef _WIN32 | 542 | +#if defined(_WIN32) && defined(__BORLANDC__) |
| 543 | + setmode(_fileno(stdin), _O_BINARY); | ||
| 544 | +#elif defined(_WIN32) | ||
| 541 | _setmode(_fileno(stdin), _O_BINARY); | 545 | _setmode(_fileno(stdin), _O_BINARY); |
| 542 | #endif | 546 | #endif |
| 543 | } | 547 | } |
| @@ -918,7 +922,9 @@ QUtil::read_lines_from_file(std::istream& in) | @@ -918,7 +922,9 @@ QUtil::read_lines_from_file(std::istream& in) | ||
| 918 | int | 922 | int |
| 919 | QUtil::strcasecmp(char const *s1, char const *s2) | 923 | QUtil::strcasecmp(char const *s1, char const *s2) |
| 920 | { | 924 | { |
| 921 | -#ifdef _WIN32 | 925 | +#if defined(_WIN32) && defined(__BORLANDC__) |
| 926 | + return stricmp(s1, s2); | ||
| 927 | +#elif defined(_WIN32) | ||
| 922 | return _stricmp(s1, s2); | 928 | return _stricmp(s1, s2); |
| 923 | #else | 929 | #else |
| 924 | return ::strcasecmp(s1, s2); | 930 | return ::strcasecmp(s1, s2); |