summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2011-09-03 22:14:06 +0900
committerFlorian Frank <flori@ping.de>2011-10-01 10:07:59 +0200
commitac161c37c5b14adfa3d847d12195a18bb6eff30a (patch)
tree517d6ad1e7ca78bb54ac49d6cc4487e1636f9200
parent56987b27d53765a57b20a0f2611b44a343616e09 (diff)
downloadjson-ac161c37c5b14adfa3d847d12195a18bb6eff30a.tar.gz
HAVE_RUBY_RE_H and HAVE_RUBY_RE_H are defined in ruby.h by default.
-rw-r--r--ext/json/ext/generator/extconf.rb7
-rw-r--r--ext/json/ext/generator/generator.h6
-rw-r--r--ext/json/ext/parser/extconf.rb3
-rw-r--r--ext/json/ext/parser/parser.h2
4 files changed, 3 insertions, 15 deletions
diff --git a/ext/json/ext/generator/extconf.rb b/ext/json/ext/generator/extconf.rb
index 149f22c..a9eae14 100644
--- a/ext/json/ext/generator/extconf.rb
+++ b/ext/json/ext/generator/extconf.rb
@@ -1,5 +1,4 @@
require 'mkmf'
-require 'rbconfig'
unless $CFLAGS.gsub!(/ -O[\dsz]?/, ' -O3')
$CFLAGS << ' -O3'
@@ -11,10 +10,4 @@ if CONFIG['CC'] =~ /gcc/
#end
end
-if RUBY_VERSION < "1.9"
- have_header("re.h")
-else
- have_header("ruby/re.h")
- have_header("ruby/encoding.h")
-end
create_makefile 'json/ext/generator'
diff --git a/ext/json/ext/generator/generator.h b/ext/json/ext/generator/generator.h
index f882ea0..1fdd351 100644
--- a/ext/json/ext/generator/generator.h
+++ b/ext/json/ext/generator/generator.h
@@ -7,11 +7,9 @@
#include "ruby.h"
-#if HAVE_RUBY_RE_H
+#ifdef HAVE_RUBY_RE_H
#include "ruby/re.h"
-#endif
-
-#if HAVE_RE_H
+#else
#include "re.h"
#endif
diff --git a/ext/json/ext/parser/extconf.rb b/ext/json/ext/parser/extconf.rb
index d2438cd..b09f122 100644
--- a/ext/json/ext/parser/extconf.rb
+++ b/ext/json/ext/parser/extconf.rb
@@ -1,5 +1,4 @@
require 'mkmf'
-require 'rbconfig'
unless $CFLAGS.gsub!(/ -O[\dsz]?/, ' -O3')
$CFLAGS << ' -O3'
@@ -11,6 +10,4 @@ if CONFIG['CC'] =~ /gcc/
#end
end
-have_header("re.h")
-have_header("ruby/st.h")
create_makefile 'json/ext/parser'
diff --git a/ext/json/ext/parser/parser.h b/ext/json/ext/parser/parser.h
index fc73810..da6fc5c 100644
--- a/ext/json/ext/parser/parser.h
+++ b/ext/json/ext/parser/parser.h
@@ -3,7 +3,7 @@
#include "ruby.h"
-#if HAVE_RE_H
+#ifndef HAVE_RUBY_RE_H
#include "re.h"
#endif