summaryrefslogtreecommitdiff
path: root/src/report.cc
diff options
context:
space:
mode:
authorEvan Mallory <schmave@gmail.com>2016-09-17 13:29:09 -0400
committerEvan Mallory <schmave@gmail.com>2016-09-17 14:22:38 -0400
commitc193cc3a5b4dbf39e19744cf4d30e616298eaa86 (patch)
tree5f837949c367f435d947833c6f52e37473357ee6 /src/report.cc
parenta3b573e1107729e743c96da8ed9272361ba6ae31 (diff)
downloadfork-ledger-c193cc3a5b4dbf39e19744cf4d30e616298eaa86.tar.gz
fork-ledger-c193cc3a5b4dbf39e19744cf4d30e616298eaa86.tar.bz2
fork-ledger-c193cc3a5b4dbf39e19744cf4d30e616298eaa86.zip
Fix build under msys32; add Appveyor continuous build
* Appveyor is a continuous integration platform for Windows that is free for open source projects. See latest test build here: https://ci.appveyor.com/project/Evan/ledger/build/artifacts * Changed WIN32 to _WIN32 because this article http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system claims that it is defined by the greatest number of compilers. * Modified HAVE_ISATTY and other system defines so that system.hh compiles when cmake fails to find the relevant function. * Add missing include in test/unit/t_value.cc Almost all tests fail when you run them on msys32. I will address that in a future PR.
Diffstat (limited to 'src/report.cc')
-rw-r--r--src/report.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/report.cc b/src/report.cc
index 9e480ea5..78ccac51 100644
--- a/src/report.cc
+++ b/src/report.cc
@@ -57,7 +57,7 @@ void report_t::normalize_options(const string& verb)
// Patch up some of the reporting options based on what kind of
// command it was.
-#if HAVE_ISATTY
+#ifdef HAVE_ISATTY
if (! HANDLED(force_color)) {
if (! HANDLED(no_color) && isatty(STDOUT_FILENO))
HANDLER(color).on("?normalize");
@@ -181,14 +181,14 @@ void report_t::normalize_options(const string& verb)
}
long cols = 0;
-#if HAVE_IOCTL
+#ifdef HAVE_IOCTL
struct winsize ws;
#endif
if (HANDLED(columns_))
cols = lexical_cast<long>(HANDLER(columns_).value);
else if (const char * columns = std::getenv("COLUMNS"))
cols = lexical_cast<long>(columns);
-#if HAVE_IOCTL
+#ifdef HAVE_IOCTL
else if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) != -1)
cols = ws.ws_col;
#endif