From 0a776aff31b994f3c599cd006c8f270076b975fe Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Wed, 12 Aug 2015 23:27:09 -0400 Subject: [PATCH] updated re2 for Windows compile --- src/openalpr/support/re2/util/stringprintf.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/openalpr/support/re2/util/stringprintf.cc b/src/openalpr/support/re2/util/stringprintf.cc index 3c9c14b..5f1869f 100644 --- a/src/openalpr/support/re2/util/stringprintf.cc +++ b/src/openalpr/support/re2/util/stringprintf.cc @@ -14,7 +14,12 @@ static void StringAppendV(string* dst, const char* format, va_list ap) { // the data in it upon use. The fix is to make a copy // of the structure before using it and use that copy instead. va_list backup_ap; + + #if defined(WIN32) + backup_ap = ap; + #else va_copy(backup_ap, ap); + #endif int result = vsnprintf(space, sizeof(space), format, backup_ap); va_end(backup_ap); @@ -37,7 +42,12 @@ static void StringAppendV(string* dst, const char* format, va_list ap) { char* buf = new char[length]; // Restore the va_list before we use it again + #if defined(WIN32) + va_list backup_ap = ap; + #else va_copy(backup_ap, ap); + #endif + #ifdef WIN32 result = vsnprintf_s(buf, length, length, format, backup_ap); #else