From 34072696a8657fa8cf1a63e24036e281e7bdde27 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Thu, 18 Jun 2015 22:59:04 -0400 Subject: [PATCH] Fixed Windows compile issues --- src/openalpr/support/regex/onig_config.h | 8 ++++++++ src/openalpr/support/regex/oniguruma.h | 2 +- src/openalpr/support/regex/regenc.c | 5 ++++- src/openalpr/support/regex/regint.h | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/openalpr/support/regex/onig_config.h b/src/openalpr/support/regex/onig_config.h index f6b3ba9..90e6473 100644 --- a/src/openalpr/support/regex/onig_config.h +++ b/src/openalpr/support/regex/onig_config.h @@ -1,6 +1,10 @@ /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.in by autoheader. */ +#ifdef _WIN32 +#include "win32/onig_config.h" +#else + /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ @@ -120,3 +124,7 @@ /* Define to `unsigned int' if does not define. */ /* #undef size_t */ + + + +#endif \ No newline at end of file diff --git a/src/openalpr/support/regex/oniguruma.h b/src/openalpr/support/regex/oniguruma.h index adf4efc..af2abeb 100644 --- a/src/openalpr/support/regex/oniguruma.h +++ b/src/openalpr/support/regex/oniguruma.h @@ -81,7 +81,7 @@ extern "C" { #if defined(EXPORT) || defined(RUBY_EXPORT) #define ONIG_EXTERN extern __declspec(dllexport) #else -#define ONIG_EXTERN extern __declspec(dllimport) +#define ONIG_EXTERN extern #endif #endif #endif diff --git a/src/openalpr/support/regex/regenc.c b/src/openalpr/support/regex/regenc.c index 8090350..b5db6ae 100644 --- a/src/openalpr/support/regex/regenc.c +++ b/src/openalpr/support/regex/regenc.c @@ -29,7 +29,7 @@ #include "regint.h" -OnigEncoding OnigEncDefaultCharEncoding = ONIG_ENCODING_INIT_DEFAULT; +OnigEncoding OnigEncDefaultCharEncoding = NULL; extern int onigenc_init(void) @@ -40,6 +40,9 @@ onigenc_init(void) extern OnigEncoding onigenc_get_default_encoding(void) { + if (OnigEncDefaultCharEncoding == NULL) + OnigEncDefaultCharEncoding = ONIG_ENCODING_INIT_DEFAULT; + return OnigEncDefaultCharEncoding; } diff --git a/src/openalpr/support/regex/regint.h b/src/openalpr/support/regex/regint.h index 5038508..a901878 100644 --- a/src/openalpr/support/regex/regint.h +++ b/src/openalpr/support/regex/regint.h @@ -170,7 +170,7 @@ #include #endif -#if defined(HAVE_ALLOCA_H) && !defined(__GNUC__) +#if defined(HAVE_ALLOCA_H) && !defined(_WIN32) && !defined(__GNUC__) #include #endif