Include vendor-specific header for isatty function

MS Windows doesn't contain POSIX functions in unistd.h, but rather has
its own versions in io.h.
This commit is contained in:
Roland Kaufmann 2018-06-26 09:14:12 +02:00
parent f7950ca458
commit 83b63213f4

View File

@ -23,7 +23,20 @@
#include <iostream>
#include <errno.h> // For errno
#include <stdio.h> // For fileno() and stdout
#if defined(_MSC_VER)
// MS put some POSIX-like functions in io.h, but prefix them with underscore
// since they are considered "vendor" and not standard functions.
#define _CRT_NONSTDC_NO_DEPRECATE
#include <io.h>
#define isatty _isatty
#elif defined(__MINGW32__)
// MinGW also has the isatty function in io.h instead of unistd.h, but without
// the underscore.
#include <io.h>
#else
#include <unistd.h> // For isatty()
#endif
namespace Opm {