Fixed Windows compile issues

This commit is contained in:
Matt Hill
2015-06-18 22:59:04 -04:00
parent e50b5d74e6
commit 34072696a8
4 changed files with 14 additions and 3 deletions

View File

@@ -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 <sys/types.h> does not define. */
/* #undef size_t */
#endif

View File

@@ -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

View File

@@ -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;
}

View File

@@ -170,7 +170,7 @@
#include <stdlib.h>
#endif
#if defined(HAVE_ALLOCA_H) && !defined(__GNUC__)
#if defined(HAVE_ALLOCA_H) && !defined(_WIN32) && !defined(__GNUC__)
#include <alloca.h>
#endif