Commit 71b7ed9f4f2c88fbdd0eb5a4796beb948fd8188c

Authored by Thorsten Schöning
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 529 void
530 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 535 _setmode(_fileno(stdout), _O_BINARY);
534 536 #endif
535 537 }
... ... @@ -537,7 +539,9 @@ QUtil::binary_stdout()
537 539 void
538 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 545 _setmode(_fileno(stdin), _O_BINARY);
542 546 #endif
543 547 }
... ... @@ -918,7 +922,9 @@ QUtil::read_lines_from_file(std::istream& in)
918 922 int
919 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 928 return _stricmp(s1, s2);
923 929 #else
924 930 return ::strcasecmp(s1, s2);
... ...