mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-11 14:50:06 +08:00
Merge branch 'master' of https://github.com/openalpr/openalpr
This commit is contained in:
@@ -36,7 +36,7 @@ const VariadicFunction2<bool, StringPiece*, const RE2&, RE2::Arg, RE2::ConsumeN>
|
|||||||
const VariadicFunction2<bool, StringPiece*, const RE2&, RE2::Arg, RE2::FindAndConsumeN> RE2::FindAndConsume = {};
|
const VariadicFunction2<bool, StringPiece*, const RE2&, RE2::Arg, RE2::FindAndConsumeN> RE2::FindAndConsume = {};
|
||||||
|
|
||||||
// This will trigger LNK2005 error in MSVC.
|
// This will trigger LNK2005 error in MSVC.
|
||||||
#ifndef COMPILER_MSVC
|
#ifndef WIN32
|
||||||
const int RE2::Options::kDefaultMaxMem; // initialized in re2.h
|
const int RE2::Options::kDefaultMaxMem; // initialized in re2.h
|
||||||
#endif // COMPILER_MSVC
|
#endif // COMPILER_MSVC
|
||||||
|
|
||||||
|
@@ -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
|
// the data in it upon use. The fix is to make a copy
|
||||||
// of the structure before using it and use that copy instead.
|
// of the structure before using it and use that copy instead.
|
||||||
va_list backup_ap;
|
va_list backup_ap;
|
||||||
|
|
||||||
|
#if defined(WIN32)
|
||||||
|
backup_ap = ap;
|
||||||
|
#else
|
||||||
va_copy(backup_ap, ap);
|
va_copy(backup_ap, ap);
|
||||||
|
#endif
|
||||||
int result = vsnprintf(space, sizeof(space), format, backup_ap);
|
int result = vsnprintf(space, sizeof(space), format, backup_ap);
|
||||||
va_end(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];
|
char* buf = new char[length];
|
||||||
|
|
||||||
// Restore the va_list before we use it again
|
// Restore the va_list before we use it again
|
||||||
|
#if defined(WIN32)
|
||||||
|
va_list backup_ap = ap;
|
||||||
|
#else
|
||||||
va_copy(backup_ap, ap);
|
va_copy(backup_ap, ap);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
result = vsnprintf_s(buf, length, length, format, backup_ap);
|
result = vsnprintf_s(buf, length, length, format, backup_ap);
|
||||||
#else
|
#else
|
||||||
|
@@ -1,12 +1,22 @@
|
|||||||
#ifndef TIMING_H
|
#ifndef OPENALPR_TIMING_H
|
||||||
#define TIMING_H
|
#define OPENALPR_TIMING_H
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#if WINDOWS
|
||||||
|
struct timespec
|
||||||
|
{
|
||||||
|
time_t tv_sec; // Seconds - >= 0
|
||||||
|
long tv_usec; // Nanoseconds - [0, 999999999]
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WINDOWS
|
#ifdef WINDOWS
|
||||||
// Import windows only stuff
|
// Import windows only stuff
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -17,13 +27,6 @@
|
|||||||
#include <mach/mach.h>
|
#include <mach/mach.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Support for Windows
|
|
||||||
#ifdef WINDOWS
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
#define timespec timeval
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace alpr
|
namespace alpr
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user