| 1 |
Author: Nilesh Patra <[email protected]> |
| 2 |
Description: Fix va_list incompatibilities |
| 3 |
Index: ngmlr/src/Logging.cpp |
| 4 |
=================================================================== |
| 5 |
--- ngmlr.orig/src/Logging.cpp |
| 6 |
+++ ngmlr/src/Logging.cpp |
| 7 |
@@ -47,7 +47,8 @@ gzFile fp = 0; |
| 8 |
|
| 9 |
char const * lvlStr[] = { "", "[WARNING]", "[ERROR]", "" }; |
| 10 |
|
| 11 |
-void LogToFile(int lvl, char const * const title, char const * const s, va_list args) { |
| 12 |
+void LogToFile(int lvl, char const * const title, char const * const s, ...) { |
| 13 |
+ va_list args; |
| 14 |
if (!logToFile && !preInit) |
| 15 |
return; |
| 16 |
|
| 17 |
@@ -77,10 +78,12 @@ inline void rwl() { |
| 18 |
rwd = 0; |
| 19 |
} |
| 20 |
|
| 21 |
-void LogToConsole(bool color, int lvl, char const * const title, char const * const s, va_list args) { |
| 22 |
+void LogToConsole(bool color, int lvl, char const * const title, char const * const s, ...) { |
| 23 |
+ va_list args; |
| 24 |
if (lvl < filterlvl) |
| 25 |
return; |
| 26 |
|
| 27 |
+ int count; |
| 28 |
bool progress = lvl == 99; |
| 29 |
if (progress) |
| 30 |
lvl = 0; |
| 31 |
@@ -94,7 +97,8 @@ void LogToConsole(bool color, int lvl, c |
| 32 |
|
| 33 |
if (color) |
| 34 |
SetConsoleColor((ConsoleColor) (Message + (lvl * 2))); |
| 35 |
- if (args != 0) |
| 36 |
+ va_start(args, count); |
| 37 |
+ if (count != 0) |
| 38 |
vfprintf(stderr, s, args); |
| 39 |
else |
| 40 |
fprintf(stderr, "%s", s); |