+namespace
+{
+ inline bool CanUseColors()
+ {
+#ifdef INSPIRCD_DISABLE_COLORS
+ return false;
+#else
+ return isatty(fileno(stdout));
+#endif
+ }
+
+#ifdef _WIN32
+ inline WindowsStream& GetStreamHandle(std::ostream& os)
+ {
+ if (os.rdbuf() == std::cerr.rdbuf())
+ return StandardError;