From 71a9359a36d6365c910ba9a78b80613b80fe5472 Mon Sep 17 00:00:00 2001 From: Matthias Wolf Date: Tue, 26 Sep 2023 13:58:10 +0000 Subject: [PATCH] Build fixes for MSVC. --- src/include/OS/dirent.h | 2 +- src/lib/InterViews/printer.cpp | 10 +++++----- src/lib/OS/host.cpp | 2 ++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/include/OS/dirent.h b/src/include/OS/dirent.h index 9525110..c25b939 100755 --- a/src/include/OS/dirent.h +++ b/src/include/OS/dirent.h @@ -41,7 +41,7 @@ #include #else #include -#if (defined(WIN32) && defined(__MWERKS__)) +#if defined(_MSC_VER) #define ffblk _finddata_t #define findfirst(a,b,c) _findfirst(a,b) #define findnext _findnext diff --git a/src/lib/InterViews/printer.cpp b/src/lib/InterViews/printer.cpp index 157fed9..1471d70 100644 --- a/src/lib/InterViews/printer.cpp +++ b/src/lib/InterViews/printer.cpp @@ -457,7 +457,7 @@ void Printer::character( out << "\\"; int old_width = out.width(3); char old_fill = out.fill('0'); - out << oct << c << dec; + out << std::oct << c << std::dec; out.width(old_width); out.fill(old_fill); #endif @@ -515,7 +515,7 @@ void Printer::stencil( out << "{currentfile picstr readhexstring pop} imagemask\n"; #ifndef __GNUC__ int old_width = out.width(1); - out << hex; + out << std::hex; #endif for (int iy = 0; iy < height; ++iy) { for (int ix = 0; ix < bytes; ++ix) { @@ -536,7 +536,7 @@ void Printer::stencil( out << "\n"; } #ifndef __GNUC__ - out << dec; + out << std::dec; out.width(old_width); #endif out << "grestore\n"; @@ -564,7 +564,7 @@ void Printer::image(const Raster* raster, Coord x, Coord y) { out << "{currentfile picstr readhexstring pop} image\n"; #ifndef __GNUC__ int old_width = out.width(1); - out << hex; + out << std::hex; #endif for (int iy = 0; iy < height; ++iy) { for (int ix = 0; ix < width; ++ix) { @@ -583,7 +583,7 @@ void Printer::image(const Raster* raster, Coord x, Coord y) { out << "\n"; } #ifndef __GNUC__ - out << dec; + out << std::dec; out.width(old_width); #endif out << "grestore\n"; diff --git a/src/lib/OS/host.cpp b/src/lib/OS/host.cpp index e1f9fc7..3ae6522 100755 --- a/src/lib/OS/host.cpp +++ b/src/lib/OS/host.cpp @@ -26,7 +26,9 @@ */ #include +#ifdef HAVE_UNISTD_H #include +#endif char Host::name_[100];