summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-10 03:06:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-10 03:06:15 +0000
commit2b592580bf65040373b55ff2ccc3b59a0a231a18 (patch)
tree642a6c82599486537c3136f32cac7a644c4bf4a3 /ext
parent1b8a677b235066d91994e3490e0bce5a098196a2 (diff)
* include/ruby: moved public headers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/bigdecimal/bigdecimal.c3
-rw-r--r--ext/digest/extconf.rb2
-rw-r--r--ext/dl/cptr.c7
-rw-r--r--ext/dl/dl.c5
-rw-r--r--ext/dl/extconf.rb4
-rw-r--r--ext/extmk.rb24
-rw-r--r--ext/iconv/iconv.c6
-rw-r--r--ext/json/ext/generator/generator.c4
-rw-r--r--ext/json/ext/parser/parser.c8
-rw-r--r--ext/json/ext/parser/parser.rl8
-rw-r--r--ext/openssl/extconf.rb2
-rw-r--r--ext/probeprofiler/extconf.rb2
-rw-r--r--ext/probeprofiler/probeprofiler.c2
-rw-r--r--ext/pty/pty.c16
-rw-r--r--ext/racc/cparse/cparse.c6
-rw-r--r--ext/racc/cparse/extconf.rb1
-rw-r--r--ext/readline/readline.c8
-rw-r--r--ext/ripper/depend8
-rw-r--r--ext/ripper/extconf.rb6
-rw-r--r--ext/sdbm/_sdbm.c2
-rw-r--r--ext/socket/depend8
-rw-r--r--ext/socket/getaddrinfo.c2
-rw-r--r--ext/socket/getnameinfo.c2
-rw-r--r--ext/socket/socket.c8
-rw-r--r--ext/stringio/depend4
-rw-r--r--ext/strscan/depend3
-rw-r--r--ext/strscan/strscan.c4
-rw-r--r--ext/syck/bytecode.c2
-rw-r--r--ext/syck/emitter.c2
-rw-r--r--ext/syck/handler.c2
-rw-r--r--ext/syck/implicit.c2
-rw-r--r--ext/syck/node.c2
-rw-r--r--ext/syck/rubyext.c2
-rw-r--r--ext/syck/syck.c2
-rw-r--r--ext/syck/syck.h2
-rw-r--r--ext/syck/token.c2
-rw-r--r--ext/syck/yaml2byte.c2
-rw-r--r--ext/syslog/syslog.c4
-rw-r--r--ext/tk/extconf.rb2
-rw-r--r--ext/tk/stubs.c2
-rw-r--r--ext/tk/tcltklib.c5
-rw-r--r--ext/tk/tkutil/extconf.rb1
-rw-r--r--ext/tk/tkutil/tkutil.c9
-rw-r--r--ext/win32ole/win32ole.c15
44 files changed, 111 insertions, 102 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index a4b769e..c9e7ceb 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -13,7 +13,7 @@
*
*/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
@@ -22,7 +22,6 @@
#include <float.h>
#include <math.h>
#include "math.h"
-#include "version.h"
/* #define ENABLE_NUMERIC_STRING */
diff --git a/ext/digest/extconf.rb b/ext/digest/extconf.rb
index cf9127e..a20ca8d 100644
--- a/ext/digest/extconf.rb
+++ b/ext/digest/extconf.rb
@@ -4,7 +4,7 @@
require "mkmf"
$INSTALLFILES = {
- "digest.h" => "$(RUBYARCHDIR)"
+ "digest.h" => "$(HDRDIR)"
}
create_makefile("digest")
diff --git a/ext/dl/cptr.c b/ext/dl/cptr.c
index abfd9e8..74a233b 100644
--- a/ext/dl/cptr.c
+++ b/ext/dl/cptr.c
@@ -2,10 +2,9 @@
* $Id$
*/
-#include <ruby.h>
-#include <rubyio.h>
+#include <ruby/ruby.h>
+#include <ruby/io.h>
#include <ctype.h>
-#include <version.h> /* for ruby version code */
#include "dl.h"
VALUE rb_cDLCPtr;
@@ -421,7 +420,7 @@ rb_dlptr_s_to_ptr(VALUE self, VALUE val)
rb_io_t *fptr;
FILE *fp;
GetOpenFile(val, fptr);
-#if RUBY_VERSION_CODE >= 190
+#if HAVE_RB_IO_STDIO_FILE
fp = rb_io_stdio_file(fptr);
#else
fp = fptr->f;
diff --git a/ext/dl/dl.c b/ext/dl/dl.c
index 015e76f..e4bd4d4 100644
--- a/ext/dl/dl.c
+++ b/ext/dl/dl.c
@@ -1,6 +1,5 @@
-#include <ruby.h>
-#include <rubyio.h>
-#include <version.h>
+#include <ruby/ruby.h>
+#include <ruby/io.h>
#include <ctype.h>
#include "dl.h"
diff --git a/ext/dl/extconf.rb b/ext/dl/extconf.rb
index 99419b2..8bac1e8 100644
--- a/ext/dl/extconf.rb
+++ b/ext/dl/extconf.rb
@@ -5,7 +5,7 @@ if( RbConfig::CONFIG['CC'] =~ /gcc/ )
end
$INSTALLFILES = [
- ["dl.h", "$(archdir)$(target_prefix)", ""],
+ ["dl.h", "$(HDRDIR)"],
]
$distcleanfiles << "callback.h"
@@ -26,5 +26,7 @@ else
end
if( check )
+ have_func("rb_io_stdio_file", "ruby/ruby.h")
+ $defs << %[-DRUBY_VERSION=\\"#{RUBY_VERSION}\\"]
create_makefile("dl")
end
diff --git a/ext/extmk.rb b/ext/extmk.rb
index a932a14..d4be9fc 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -112,10 +112,12 @@ def extmake(target)
Dir.chdir target
top_srcdir = $top_srcdir
topdir = $topdir
+ hdrdir = $hdrdir
mk_srcdir = CONFIG["srcdir"]
mk_topdir = CONFIG["topdir"]
prefix = "../" * (target.count("/")+1)
- $hdrdir = $top_srcdir = relative_from(top_srcdir, prefix)
+ $top_srcdir = relative_from(top_srcdir, prefix)
+ $hdrdir = relative_from(hdrdir, prefix)
$topdir = prefix + $topdir
$target = target
$mdir = target
@@ -130,8 +132,8 @@ def extmake(target)
RbConfig::CONFIG["hdrdir"] = $hdrdir
RbConfig::CONFIG["srcdir"] = $srcdir
RbConfig::CONFIG["topdir"] = $topdir
- CONFIG["hdrdir"] = ($hdrdir == top_srcdir) ? top_srcdir : "$(topdir)"+top_srcdir[2..-1]
- CONFIG["srcdir"] = "$(hdrdir)/ext/#{$mdir}"
+ CONFIG["hdrdir"] = ($hdrdir == top_srcdir) ? top_srcdir : "$(top_srcdir)/include"
+ CONFIG["srcdir"] = "$(top_srcdir)/ext/#{$mdir}"
CONFIG["topdir"] = $topdir
begin
$extconf_h = nil
@@ -200,8 +202,9 @@ def extmake(target)
CONFIG["srcdir"] = mk_srcdir
CONFIG["topdir"] = mk_topdir
CONFIG.delete("hdrdir")
- $hdrdir = $top_srcdir = top_srcdir
+ $top_srcdir = top_srcdir
$topdir = topdir
+ $hdrdir = hdrdir
Dir.chdir dir
end
begin
@@ -284,6 +287,7 @@ def parse_args()
$continue = $mflags.set?(?k)
if $extout
$extout = '$(topdir)/'+$extout
+ RbConfig::CONFIG["extout"] = CONFIG["extout"] = $extout
$extout_prefix = $extout ? "$(extout)$(target_prefix)/" : ""
$mflags << "extout=#$extout" << "extout_prefix=#$extout_prefix"
end
@@ -322,10 +326,10 @@ elsif sep = config_string('BUILD_FILE_SEPARATOR')
else
$ruby = '$(topdir)/miniruby' + EXEEXT
end
-$ruby << " -I'$(topdir)' -I'$(hdrdir)/lib'"
+$ruby << " -I'$(topdir)' -I'$(top_srcdir)/lib'"
$ruby << " -I'$(extout)/$(arch)' -I'$(extout)/common'" if $extout
-$ruby << " -I'$(hdrdir)/ext' -rpurelib.rb"
-$config_h = '$(topdir)/config.h'
+$ruby << " -I'$(top_srcdir)/ext' -rpurelib.rb"
+$config_h = '$(arch_hdrdir)/ruby/config.h'
ENV["RUBYLIB"] = "-"
ENV["RUBYOPT"] = "-rpurelib.rb"
@@ -404,12 +408,14 @@ dir = Dir.pwd
FileUtils::makedirs('ext')
Dir::chdir('ext')
-$hdrdir = $top_srcdir = relative_from(srcdir, $topdir = "..")
+hdrdir = $hdrdir
+$hdrdir = ($top_srcdir = relative_from(srcdir, $topdir = "..")) + "/include"
exts.each do |d|
extmake(d) or abort
end
-$hdrdir = $top_srcdir = srcdir
+$top_srcdir = srcdir
$topdir = "."
+$hdrdir = hdrdir
extinit = Struct.new(:c, :o) {
def initialize(src)
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index 27a4cf1..b6bc0a1 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -14,12 +14,12 @@
**********************************************************************/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include <errno.h>
#include <iconv.h>
#include <assert.h>
-#include "st.h"
-#include "intern.h"
+#include "ruby/st.h"
+#include "ruby/intern.h"
/*
* Document-class: Iconv
diff --git a/ext/json/ext/generator/generator.c b/ext/json/ext/generator/generator.c
index 60e0935..07e348a 100644
--- a/ext/json/ext/generator/generator.c
+++ b/ext/json/ext/generator/generator.c
@@ -1,8 +1,8 @@
/* vim: set cin et sw=4 ts=4: */
#include <string.h>
-#include "ruby.h"
-#include "st.h"
+#include "ruby/ruby.h"
+#include "ruby/st.h"
#include "unicode.h"
static VALUE mJSON, mExt, mGenerator, cState, mGeneratorMethods, mObject,
diff --git a/ext/json/ext/parser/parser.c b/ext/json/ext/parser/parser.c
index 7448e5f..3b84110 100644
--- a/ext/json/ext/parser/parser.c
+++ b/ext/json/ext/parser/parser.c
@@ -1,9 +1,9 @@
#line 1 "parser.rl"
-/* vim: set cin et sw=4 ts=4: */
+/* -*-c-*- vim: set cin et sw=4 ts=4: */
-#include "ruby.h"
-#include "re.h"
-#include "st.h"
+#include "ruby/ruby.h"
+#include "ruby/re.h"
+#include "ruby/st.h"
#include "unicode.h"
#define EVIL 0x666
diff --git a/ext/json/ext/parser/parser.rl b/ext/json/ext/parser/parser.rl
index 9ce8c6f..9e2a501 100644
--- a/ext/json/ext/parser/parser.rl
+++ b/ext/json/ext/parser/parser.rl
@@ -1,8 +1,8 @@
-/* vim: set cin et sw=4 ts=4: */
+/* -*-c-*- vim: set cin et sw=4 ts=4: */
-#include "ruby.h"
-#include "re.h"
-#include "st.h"
+#include "ruby/ruby.h"
+#include "ruby/re.h"
+#include "ruby/st.h"
#include "unicode.h"
#define EVIL 0x666
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index bc3f4fd..9356853 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -19,6 +19,8 @@ require "mkmf"
dir_config("openssl")
dir_config("kerberos")
+$defs << "-DRUBY_VERSION_CODE=#{RUBY_VERSION.gsub(/\D/, '')}"
+
message "=== OpenSSL for Ruby configurator ===\n"
##
diff --git a/ext/probeprofiler/extconf.rb b/ext/probeprofiler/extconf.rb
index 31cfc85..da94e65 100644
--- a/ext/probeprofiler/extconf.rb
+++ b/ext/probeprofiler/extconf.rb
@@ -1,2 +1,4 @@
require 'mkmf'
+$VPATH << "$(top_srcdir)"
+$INCFLAGS << " -I$(top_srcdir)"
create_makefile("probeprofiler")
diff --git a/ext/probeprofiler/probeprofiler.c b/ext/probeprofiler/probeprofiler.c
index 9ffb203..fba4d85 100644
--- a/ext/probeprofiler/probeprofiler.c
+++ b/ext/probeprofiler/probeprofiler.c
@@ -1,4 +1,4 @@
-#include <ruby.h>
+#include <ruby/ruby.h>
#include <yarvcore.h>
static void
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index 5847aff..d89cc7d 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -1,4 +1,4 @@
-#include "config.h"
+#include "ruby/config.h"
#ifdef RUBY_EXTCONF_H
#include RUBY_EXTCONF_H
#endif
@@ -25,9 +25,9 @@
#endif
#include <ctype.h>
-#include "ruby.h"
-#include "rubyio.h"
-#include "util.h"
+#include "ruby/ruby.h"
+#include "ruby/io.h"
+#include "ruby/util.h"
#include <signal.h>
#ifdef HAVE_SYS_STROPTS_H
@@ -192,7 +192,7 @@ pty_exec(VALUE v)
static void
establishShell(int argc, VALUE *argv, struct pty_info *info)
{
- int i,master,slave;
+ int master,slave;
rb_pid_t pid;
char *p,*getenv();
struct passwd *pwent;
@@ -240,9 +240,9 @@ establishShell(int argc, VALUE *argv, struct pty_info *info)
# else /* SETGRP_VOID */
if (setpgrp(0, getpid()) == -1)
rb_sys_fail("setpgrp()");
- if ((i = open("/dev/tty", O_RDONLY)) < 0)
- rb_sys_fail("/dev/tty");
- else {
+ {
+ int i = open("/dev/tty", O_RDONLY);
+ if (i < 0) rb_sys_fail("/dev/tty");
if (ioctl(i, TIOCNOTTY, (char *)0))
perror("ioctl(TIOCNOTTY)");
close(i);
diff --git a/ext/racc/cparse/cparse.c b/ext/racc/cparse/cparse.c
index e52d0da..d085158 100644
--- a/ext/racc/cparse/cparse.c
+++ b/ext/racc/cparse/cparse.c
@@ -11,8 +11,7 @@
*/
-#include "ruby.h"
-#include "version.h"
+#include "ruby/ruby.h"
/* -----------------------------------------------------------------------
Important Constants
@@ -65,9 +64,6 @@ static ID id_d_e_pop;
#ifndef LONG2NUM
# define LONG2NUM(i) INT2NUM(i)
#endif
-#if RUBY_VERSION_CODE >= 190
-# define HAVE_RB_BLOCK_CALL 1
-#endif
static ID value_to_id _((VALUE v));
static inline long num_to_long _((VALUE n));
diff --git a/ext/racc/cparse/extconf.rb b/ext/racc/cparse/extconf.rb
index dd953a7..3710f6f 100644
--- a/ext/racc/cparse/extconf.rb
+++ b/ext/racc/cparse/extconf.rb
@@ -1,4 +1,5 @@
# $Id$
require 'mkmf'
+have_func('rb_block_call', 'ruby/ruby.h')
create_makefile 'racc/cparse'
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 12837b5..169a196 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -5,7 +5,7 @@
#include RUBY_EXTCONF_H
#endif
-#include "config.h"
+#include "ruby/config.h"
#include <errno.h>
#include <stdio.h>
#include <ctype.h>
@@ -20,9 +20,9 @@
#include <editline/readline.h>
#endif
-#include "ruby.h"
-#include "rubyio.h"
-#include "rubysig.h"
+#include "ruby/ruby.h"
+#include "ruby/io.h"
+#include "ruby/signal.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
diff --git a/ext/ripper/depend b/ext/ripper/depend
index bd0f801..f74f7f0 100644
--- a/ext/ripper/depend
+++ b/ext/ripper/depend
@@ -1,11 +1,11 @@
GEN = $(srcdir)/tools/generate.rb
-SRC1 = $(hdrdir)/parse.y
+SRC1 = $(top_srcdir)/parse.y
SRC2 = $(srcdir)/eventids2.c
BISON = bison
src: ripper.c eventids1.c eventids2table.c
-ripper.o: ripper.c $(topdir)/lex.c eventids1.c $(srcdir)/eventids2.c eventids2table.c
+ripper.o: ripper.c lex.c eventids1.c eventids2.c eventids2table.c
.y.c:
$(BISON) -t -v -o$@ $<
@@ -13,8 +13,8 @@ ripper.o: ripper.c $(topdir)/lex.c eventids1.c $(srcdir)/eventids2.c eventids2ta
all: check
static: check
-ripper.y: $(srcdir)/tools/preproc.rb $(hdrdir)/parse.y
- $(RUBY) $(srcdir)/tools/preproc.rb $(hdrdir)/parse.y --output=$@
+ripper.y: $(srcdir)/tools/preproc.rb $(top_srcdir)/parse.y
+ $(RUBY) $(srcdir)/tools/preproc.rb $(top_srcdir)/parse.y --output=$@
check: $(GEN) $(SRC1) $(SRC2)
$(RUBY) $(GEN) --mode=check --ids1src=$(SRC1) --ids2src=$(SRC2)
diff --git a/ext/ripper/extconf.rb b/ext/ripper/extconf.rb
index 6b44073..a41a6af 100644
--- a/ext/ripper/extconf.rb
+++ b/ext/ripper/extconf.rb
@@ -12,8 +12,10 @@ def main
end
$objs = %w(ripper.o)
$cleanfiles.concat %w(ripper.y ripper.c ripper.E ripper.output eventids1.c eventids2table.c)
- $CPPFLAGS += ' -DRIPPER'
- $CPPFLAGS += ' -DRIPPER_DEBUG' if $debug
+ $defs << '-DRIPPER'
+ $defs << '-DRIPPER_DEBUG' if $debug
+ $VPATH << '$(topdir)' << '$(top_srcdir)'
+ $INCFLAGS << ' -I$(topdir) -I$(top_srcdir)'
create_makefile 'ripper'
end
diff --git a/ext/sdbm/_sdbm.c b/ext/sdbm/_sdbm.c
index f9a5888..7fdeb0d 100644
--- a/ext/sdbm/_sdbm.c
+++ b/ext/sdbm/_sdbm.c
@@ -12,7 +12,7 @@
#endif
#include "sdbm.h"
-#include "config.h"
+#include "ruby/config.h"
/*
* sdbm - ndbm work-alike hashed database library
diff --git a/ext/socket/depend b/ext/socket/depend
index 77d5b66..7577a69 100644
--- a/ext/socket/depend
+++ b/ext/socket/depend
@@ -1,6 +1,8 @@
-socket.o: socket.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h $(hdrdir)/rubyio.h $(hdrdir)/rubysig.h sockport.h constants.h
-getnameinfo.o: getnameinfo.c $(topdir)/config.h addrinfo.h sockport.h
-getaddrinfo.o: getaddrinfo.c $(topdir)/config.h addrinfo.h sockport.h
+socket.o: socket.c $(hdrdir)/ruby/ruby.h $(arch_hdrdir)/ruby/config.h \
+ $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/io.h $(hdrdir)/ruby/signal.h \
+ sockport.h constants.h
+getnameinfo.o: getnameinfo.c $(arch_hdrdir)/ruby/config.h addrinfo.h sockport.h
+getaddrinfo.o: getaddrinfo.c $(arch_hdrdir)/ruby/config.h addrinfo.h sockport.h
constants.h: $(srcdir)/mkconstants.rb
@echo "generating constants.h"
diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c
index 49fdf9b..d97012a 100644
--- a/ext/socket/getaddrinfo.c
+++ b/ext/socket/getaddrinfo.c
@@ -38,7 +38,7 @@
* - PF_UNSPEC case would be handled in getipnodebyname() with the AI_ALL flag.
*/
-#include "config.h"
+#include "ruby/config.h"
#include <sys/types.h>
#ifndef _WIN32
#include <sys/param.h>
diff --git a/ext/socket/getnameinfo.c b/ext/socket/getnameinfo.c
index 91e18e9..dcfdc6b 100644
--- a/ext/socket/getnameinfo.c
+++ b/ext/socket/getnameinfo.c
@@ -34,7 +34,7 @@
* but INRIA implementation returns EAI_xxx defined for getaddrinfo().
*/
-#include "config.h"
+#include "ruby/config.h"
#include <sys/types.h>
#ifndef _WIN32
#if defined(__BEOS__)
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index a69baac..aee4b21 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -10,10 +10,10 @@
************************************************/
-#include "ruby.h"
-#include "rubyio.h"
-#include "rubysig.h"
-#include "util.h"
+#include "ruby/ruby.h"
+#include "ruby/io.h"
+#include "ruby/signal.h"
+#include "ruby/util.h"
#include <stdio.h>
#include <sys/types.h>
diff --git a/ext/stringio/depend b/ext/stringio/depend
index cc9eae3..a052c73 100644
--- a/ext/stringio/depend
+++ b/ext/stringio/depend
@@ -1,2 +1,2 @@
-stringio.o: stringio.c $(hdrdir)/ruby.h $(topdir)/config.h \
- $(hdrdir)/defines.h $(hdrdir)/intern.h $(hdrdir)/rubyio.h
+stringio.o: stringio.c $(hdrdir)/ruby/ruby.h $(arch_hdrdir)/ruby/config.h \
+ $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/io.h
diff --git a/ext/strscan/depend b/ext/strscan/depend
index 2a4255e..76f6e0b 100644
--- a/ext/strscan/depend
+++ b/ext/strscan/depend
@@ -1,3 +1,2 @@
strscan.o: strscan.c $(hdrdir)/ruby.h $(hdrdir)/re.h $(hdrdir)/regex.h \
- $(hdrdir)/regint.h $(hdrdir)/oniguruma.h $(topdir)/config.h \
- $(hdrdir)/defines.h
+ $(hdrdir)/oniguruma.h $(topdir)/config.h $(hdrdir)/defines.h
diff --git a/ext/strscan/strscan.c b/ext/strscan/strscan.c
index f991a13..63a0f11 100644
--- a/ext/strscan/strscan.c
+++ b/ext/strscan/strscan.c
@@ -8,8 +8,8 @@
the Ruby License. For details, see the file COPYING.
*/
-#include "ruby.h"
-#include "re.h"
+#include "ruby/ruby.h"
+#include "ruby/re.h"
#define STRSCAN_VERSION "0.7.0"
diff --git a/ext/syck/bytecode.c b/ext/syck/bytecode.c
index 567aaf5..314ef22 100644
--- a/ext/syck/bytecode.c
+++ b/ext/syck/bytecode.c
@@ -8,7 +8,7 @@
*
* Copyright (C) 2003 why the lucky stiff
*/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include "syck.h"
#include "gram.h"
diff --git a/ext/syck/emitter.c b/ext/syck/emitter.c
index d3704f8..03bdaa2 100644
--- a/ext/syck/emitter.c
+++ b/ext/syck/emitter.c
@@ -9,7 +9,7 @@
* All Base64 code from Ruby's pack.c.
* Ruby is Copyright (C) 1993-2003 Yukihiro Matsumoto
*/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include <stdio.h>
#include <string.h>
diff --git a/ext/syck/handler.c b/ext/syck/handler.c
index b04c4e3..3ff1a4e 100644
--- a/ext/syck/handler.c
+++ b/ext/syck/handler.c
@@ -7,7 +7,7 @@
* Copyright (C) 2003 why the lucky stiff
*/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include "syck.h"
SYMID
diff --git a/ext/syck/implicit.c b/ext/syck/implicit.c
index cfd5d7b..df32d91 100644
--- a/ext/syck/implicit.c
+++ b/ext/syck/implicit.c
@@ -9,7 +9,7 @@
* Copyright (C) 2003 why the lucky stiff
*/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include "syck.h"
#define YYCTYPE char
diff --git a/ext/syck/node.c b/ext/syck/node.c
index 47bce64..99cc9c7 100644
--- a/ext/syck/node.c
+++ b/ext/syck/node.c
@@ -7,7 +7,7 @@
* Copyright (C) 2003 why the lucky stiff
*/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include "syck.h"
/*
diff --git a/ext/syck/rubyext.c b/ext/syck/rubyext.c
index 1966a2d..9a41c18 100644
--- a/ext/syck/rubyext.c
+++ b/ext/syck/rubyext.c
@@ -8,7 +8,7 @@
* Copyright (C) 2003-2005 why the lucky stiff
*/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include "syck.h"
#include <sys/types.h>
#include <time.h>
diff --git a/ext/syck/syck.c b/ext/syck/syck.c
index bab7ee5..20aaecc 100644
--- a/ext/syck/syck.c
+++ b/ext/syck/syck.c
@@ -6,7 +6,7 @@
*
* Copyright (C) 2003 why the lucky stiff
*/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include <stdio.h>
#include <string.h>
diff --git a/ext/syck/syck.h b/ext/syck/syck.h
index 8d878a4..0fdff8e 100644
--- a/ext/syck/syck.h
+++ b/ext/syck/syck.h
@@ -18,7 +18,7 @@
#include <stdio.h>
#include <ctype.h>
-#include "st.h"
+#include "ruby/st.h"
#if defined(__cplusplus)
extern "C" {
diff --git a/ext/syck/token.c b/ext/syck/token.c
index 3c6cd1a..0517ffc 100644
--- a/ext/syck/token.c
+++ b/ext/syck/token.c
@@ -8,7 +8,7 @@
*
* Copyright (C) 2003 why the lucky stiff
*/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include "syck.h"
#include "gram.h"
diff --git a/ext/syck/yaml2byte.c b/ext/syck/yaml2byte.c
index bcc428e..fd5caad 100644
--- a/ext/syck/yaml2byte.c
+++ b/ext/syck/yaml2byte.c
@@ -9,7 +9,7 @@
* WARNING WARNING WARNING --- THIS IS *NOT JUST* PLAYING
* ANYMORE! -- WHY HAS EMBRACED THIS AS THE REAL THING!
*/
-#include "ruby.h"
+#include "ruby/ruby.h"
#include <syck.h>
#include <assert.h>
#define YAMLBYTE_UTF8
diff --git a/ext/syslog/syslog.c b/ext/syslog/syslog.c
index d4945ae..4ac6459 100644
--- a/ext/syslog/syslog.c
+++ b/ext/syslog/syslog.c
@@ -7,8 +7,8 @@
* $Id$
*/
-#include "ruby.h"
-#include "util.h"
+#include "ruby/ruby.h"
+#include "ruby/util.h"
#include <syslog.h>
/* Syslog class */
diff --git a/ext/tk/extconf.rb b/ext/tk/extconf.rb
index 5ed86a8..1238990 100644
--- a/ext/tk/extconf.rb
+++ b/ext/tk/extconf.rb
@@ -307,6 +307,8 @@ if tcltk_framework ||
$INSTALLFILES << ["lib/tkextlib/SUPPORT_STATUS", "$(RUBYLIBDIR)", "lib"]
# create
+ $defs << %[-DRUBY_VERSION=\\"#{RUBY_VERSION}\\"]
+ $defs << %[-DRUBY_RELEASE_DATE=\\"#{RUBY_RELEASE_DATE}\\"]
create_makefile("tcltklib")
end
end
diff --git a/ext/tk/stubs.c b/ext/tk/stubs.c
index 426505f..d0aaf61 100644
--- a/ext/tk/stubs.c
+++ b/ext/tk/stubs.c
@@ -1,5 +1,5 @@
#include "stubs.h"
-#include "ruby.h"
+#include "ruby/ruby.h"
#include <tcl.h>
#include <tk.h>
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c
index 498944d..4f779c7 100644
--- a/ext/tk/tcltklib.c
+++ b/ext/tk/tcltklib.c
@@ -6,9 +6,8 @@
#define TCLTKLIB_RELEASE_DATE "2006-12-01"
-#include "ruby.h"
-#include "rubysig.h"
-#include "version.h"
+#include "ruby/ruby.h"
+#include "ruby/signal.h"
#undef EXTERN /* avoid conflict with tcl.h of tcl8.2 or before */
#include <stdio.h>
#ifdef HAVE_STDARG_PROTOTYPES
diff --git a/ext/tk/tkutil/extconf.rb b/ext/tk/tkutil/extconf.rb
index dd00d5d..51f7756 100644
--- a/ext/tk/tkutil/extconf.rb
+++ b/ext/tk/tkutil/extconf.rb
@@ -7,5 +7,6 @@ end
if has_tk
require 'mkmf'
+ have_func("rb_obj_instance_exec", "ruby.h")
create_makefile('tkutil')
end
diff --git a/ext/tk/tkutil/tkutil.c b/ext/tk/tkutil/tkutil.c
index 0b2597e..25c4af7 100644
--- a/ext/tk/tkutil/tkutil.c
+++ b/ext/tk/tkutil/tkutil.c
@@ -10,10 +10,9 @@
#define TKUTIL_RELEASE_DATE "2006-04-06"
-#include "ruby.h"
-#include "rubysig.h"
-#include "version.h"
-#include "st.h"
+#include "ruby/ruby.h"
+#include "ruby/signal.h"
+#include "ruby/st.h"
static VALUE cMethod;
@@ -59,7 +58,7 @@ tk_s_new(argc, argv, klass)
VALUE obj = rb_class_new_instance(argc, argv, klass);
if (rb_block_given_p()) {
-#if RUBY_VERSION_MAJOR == 1 && RUBY_VERSION_MINOR <= 8 /* ruby 1.8.x */
+#ifndef HAVE_RB_OBJ_INSTANCE_EXEC
rb_obj_instance_eval(0, 0, obj);
#else
rb_obj_instance_exec(1, &obj, obj);
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index c63401a..5b31898 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -16,8 +16,8 @@
modified for win32ole (ruby) by Masaki.Suketa <masaki.suketa@nifty.ne.jp>
*/
-#include "ruby.h"
-#include "st.h"
+#include "ruby/ruby.h"
+#include "ruby/st.h"
#include <ctype.h>
#include <windows.h>
#include <ocidl.h>
@@ -1076,8 +1076,8 @@ ole_set_safe_array(long n, SAFEARRAY *psa, long *pid, long *pub, VALUE val, long
val1 = ole_ary_m_entry(val, pid);
p = val2variant_ptr(val1, &var, vt);
if (is_all_index_under(pid, pub, dim) == Qtrue) {
- if (V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == NULL ||
- V_VT(&var) == VT_UNKNOWN && V_UNKNOWN(&var) == NULL) {
+ if ((V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == NULL) ||
+ (V_VT(&var) == VT_UNKNOWN && V_UNKNOWN(&var) == NULL)) {
rb_raise(eWIN32OLERuntimeError, "argument does not have IDispatch or IUnknown Interface");
}
hr = SafeArrayPutElement(psa, pid, p);
@@ -2669,7 +2669,7 @@ fole_s_set_locale(VALUE self, VALUE vlcid)
cWIN32OLE_lcid = lcid;
break;
default:
- rb_raise(eWIN32OLERuntimeError, "not installed locale: %d", lcid);
+ rb_raise(eWIN32OLERuntimeError, "not installed locale: %u", (unsigned int)lcid);
}
}
return Qnil;
@@ -7827,7 +7827,6 @@ folevariant_ary_aset(int argc, VALUE *argv, VALUE self)
{
struct olevariantdata *pvar;
SAFEARRAY *psa;
- VALUE val = Qnil;
VARIANT var;
VARTYPE vt;
long *pid;
@@ -7849,8 +7848,8 @@ folevariant_ary_aset(int argc, VALUE *argv, VALUE self)
VariantInit(&var);
vt = (V_VT(&(pvar->var)) & ~VT_ARRAY);
p = val2variant_ptr(argv[argc-1], &var, vt);
- if (V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == NULL ||
- V_VT(&var) == VT_UNKNOWN && V_UNKNOWN(&var) == NULL) {
+ if ((V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == NULL) ||
+ (V_VT(&var) == VT_UNKNOWN && V_UNKNOWN(&var) == NULL)) {
rb_raise(eWIN32OLERuntimeError, "argument does not have IDispatch or IUnknown Interface");
}
hr = SafeArrayPutElement(psa, pid, p);