]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - conout.c
More cleanup
[xonotic/gmqcc.git] / conout.c
index f89d68c13ec10b2b71e681f60f007f3f0d0f61bd..bc55b04f3e7c9e4270b5cbd595a37ef1893a27e6 100644 (file)
--- a/conout.c
+++ b/conout.c
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-#include "gmqcc.h"
+#include <unistd.h>
 
-/*
- * isatty/STDERR_FILENO/STDOUT_FILNO
- * + some other things likewise.
- */
-#ifndef _WIN32
-#   include <unistd.h>
-#else
-#   include <io.h>
-    /*
-     * Windows and it's posix underscore bullshit.  We simply fix this
-     * with yay, another macro :P
-     */
-#   define isatty _isatty
-#endif
+#include "gmqcc.h"
+#include "platform.h"
 
 #define GMQCC_IS_STDOUT(X) ((FILE*)((void*)X) == stdout)
 #define GMQCC_IS_STDERR(X) ((FILE*)((void*)X) == stderr)
@@ -198,9 +186,9 @@ static con_t console;
  */
 static void con_enablecolor(void) {
     if (console.handle_err == stderr || console.handle_err == stdout)
-        console.color_err = !!(isatty(STDERR_FILENO));
+        console.color_err = !!(platform_isatty(STDERR_FILENO));
     if (console.handle_out == stderr || console.handle_out == stdout)
-        console.color_out = !!(isatty(STDOUT_FILENO));
+        console.color_out = !!(platform_isatty(STDOUT_FILENO));
 }
 
 /*