/*
- * Copyright (C) 2012
+ * Copyright (C) 2012, 2013
* Dale Weiler
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* Doing colored output on windows is fucking stupid. The linux way is
* the real way. So we emulate it on windows :)
*/
-#ifdef _MSC_VER
+#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
WWHITE
};
-static int win_fputs(const char *str, FILE *h) {
+static int win_fputs(FILE *h, const char *str) {
/* state for translate */
int acolor;
int wcolor;
state = -1;
}
} else {
- file_putc(*str, h);
+ file_putc(h, *str);
length ++;
}
str++;
*/
static int con_write(FILE *handle, const char *fmt, va_list va) {
int ln;
- #ifndef _MSC_VER
+ #ifndef _WIN32
ln = vfprintf(handle, fmt, va);
#else
{
char data[4096];
memset(data, 0, sizeof(data));
vsnprintf(data, sizeof(data), fmt, va);
- ln = (GMQCC_IS_DEFINE(handle)) ? win_fputs(data, handle) : file_puts(data, handle);
+ ln = (GMQCC_IS_DEFINE(handle)) ? win_fputs(handle, data) : file_puts(handle, data);
}
#endif
return ln;