Author: Nilesh Patra Description: Fix va_list incompatibilities Index: ngmlr/src/Logging.cpp =================================================================== --- ngmlr.orig/src/Logging.cpp +++ ngmlr/src/Logging.cpp @@ -47,7 +47,8 @@ gzFile fp = 0; char const * lvlStr[] = { "", "[WARNING]", "[ERROR]", "" }; -void LogToFile(int lvl, char const * const title, char const * const s, va_list args) { +void LogToFile(int lvl, char const * const title, char const * const s, ...) { + va_list args; if (!logToFile && !preInit) return; @@ -77,10 +78,12 @@ inline void rwl() { rwd = 0; } -void LogToConsole(bool color, int lvl, char const * const title, char const * const s, va_list args) { +void LogToConsole(bool color, int lvl, char const * const title, char const * const s, ...) { + va_list args; if (lvl < filterlvl) return; + int count; bool progress = lvl == 99; if (progress) lvl = 0; @@ -94,7 +97,8 @@ void LogToConsole(bool color, int lvl, c if (color) SetConsoleColor((ConsoleColor) (Message + (lvl * 2))); - if (args != 0) + va_start(args, count); + if (count != 0) vfprintf(stderr, s, args); else fprintf(stderr, "%s", s);