1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-06 06:30:19 +00:00

- fix build after ruby API change

This commit is contained in:
Dirk Meyer 2010-01-13 14:23:19 +00:00
parent 01bb4b3b91
commit 5dff7640ff
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=247817
3 changed files with 8 additions and 4 deletions

View File

@ -62,4 +62,8 @@ CONFIGURE_ENV+= EXTRA_LDFLAGS="${EXTRA_LDFLAGS} -pthread"
.endif
.endif
.if ${RUBY_RELVERSION} == 1.9.1
CFLAGS+= -DWITH_RUBY_19
.endif
.include <bsd.port.post.mk>

View File

@ -8,7 +8,7 @@
#include "eruby.h"
#include "config.h"
+#if defined(RFLOAT_VALUE)
+#if defined(DWITH_RUBY_19)
+#include "ruby/regex.h"
+#undef ismbchar
+#define ismbchar(c,e,enc) ((mbclen(c,e,enc)) != 1)
@ -24,7 +24,7 @@
}
s++;
goto again;
+#if !defined(RFLOAT_VALUE)
+#if !defined(DWITH_RUBY_19)
case 'K':
s++;
if (*s == '\0') {
@ -83,7 +83,7 @@
if (prevc < 0) output_literal(compiler, "print \"");
output_char(compiler, c);
prevc = c;
+#if defined(RFLOAT_VALUE)
+#if defined(DWITH_RUBY_19)
+ if (ismbchar(c,c+4,OnigEncDefaultCharEncoding)) {
+ int i, len = mbclen(c,c,OnigEncDefaultCharEncoding) - 1;
+#else

View File

@ -4,7 +4,7 @@
#endif
#include "ruby.h"
+#if defined(RFLOAT_VALUE)
+#if defined(DWITH_RUBY_19)
+#define RUBY_VERSION_CODE 190
+#endif
+#if RUBY_VERSION_CODE < 190