X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=formatter.hpp;h=181e2d1539d5c14bc14e070db1325a31d2593ad4;hb=35c2793ac758997a0a1c2e558d384ab94754987d;hp=9f17c006afc05b7ecd309c4adc17013070873c34;hpb=4a826ed267c580a0f5e803ff7f05710c9d135b70;p=apitrace diff --git a/formatter.hpp b/formatter.hpp index 9f17c00..181e2d1 100644 --- a/formatter.hpp +++ b/formatter.hpp @@ -105,7 +105,7 @@ inline std::ostream& operator<<(std::ostream& os, const Attribute *attr) { } -#ifdef WIN32 +#ifdef _WIN32 #include @@ -155,12 +155,16 @@ public: #endif -inline Formatter *defaultFormatter(void) { -#ifdef WIN32 - return new WindowsFormatter; +inline Formatter *defaultFormatter(bool color = true) { + if (color) { +#ifdef _WIN32 + return new WindowsFormatter; #else - return new AnsiFormatter; + return new AnsiFormatter; #endif + } else { + return new Formatter; + } }