diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-10 03:06:15 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-06-10 03:06:15 +0000 |
commit | 2b592580bf65040373b55ff2ccc3b59a0a231a18 (patch) | |
tree | 642a6c82599486537c3136f32cac7a644c4bf4a3 /ext | |
parent | 1b8a677b235066d91994e3490e0bce5a098196a2 (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')
44 files changed, 111 insertions, 102 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index a4b769e8cf..c9e7ceb2e4 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 cf9127ecc0..a20ca8d68f 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 abfd9e8d1c..74a233b527 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 015e76f09e..e4bd4d41e9 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 99419b2d7d..8bac1e83fb 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 a932a14414..d4be9fc538 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 27a4cf102e..b6bc0a11a5 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 60e09355f0..07e348aa12 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 7448e5fb7a..3b84110374 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 9ce8c6fc24..9e2a5015eb 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 bc3f4fd2ed..9356853e1d 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 31cfc85c06..da94e654d9 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 9ffb203673..fba4d85f46 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 5847aff2bd..d89cc7d457 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 e52d0da807..d085158f11 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 dd953a7e15..3710f6f7e7 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 12837b5ac2..169a196166 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 bd0f8010cf..f74f7f0fee 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 6b44073300..a41a6af2d8 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 f9a5888624..7fdeb0dbd0 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 77d5b66559..7577a6929a 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 49fdf9b597..d97012a3c5 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 91e18e916f..dcfdc6b35a 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 a69baac7bb..aee4b21567 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 cc9eae3f55..a052c73de7 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 2a4255e916..76f6e0b18b 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 f991a13ac4..63a0f1185e 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 567aaf52a8..314ef229fe 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 d3704f867b..03bdaa2dd7 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 b04c4e3c0e..3ff1a4e440 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 cfd5d7b3e6..df32d9194b 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 47bce64900..99cc9c7515 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 1966a2d334..9a41c18e8f 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 bab7ee5dc6..20aaecc9f0 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 8d878a4359..0fdff8e380 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 3c6cd1a9cf..0517ffc400 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 bcc428e1cd..fd5caadd85 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 d4945ae7b4..4ac645969d 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 5ed86a8b76..123899043a 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 426505f3ae..d0aaf61f31 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 498944d453..4f779c731e 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 dd00d5d535..51f775619c 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 0b2597ec1a..25c4af742d 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 c63401a7c8..5b31898318 100644 --- a/ext/win32ole/win32ole.c +++ b/ext/win32ole/win32ole.c @@ -16,8 +16,8 @@ modified for win32ole (ruby) by Masaki.Suketa <[email protected]> */ -#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); |