summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2011-09-03 22:14:06 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2011-09-03 22:14:06 +0900
commit37349f8b8062bc7f84a49c6649c8cc80c72046fa (patch)
tree2e765d5e68b5f975271873bc84de059342be0fc9
parent3dab4c5a6a97fac03dacf19446b9ff2a6b397591 (diff)
downloadjson-37349f8b8062bc7f84a49c6649c8cc80c72046fa.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