diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-07-17 02:23:52 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-07-17 02:23:52 +0000 |
commit | e98d5d4f66f51f34629392ef5831cc4667502216 (patch) | |
tree | dd786449619d584beeab06c4f89820a7c06df73c | |
parent | 865cd4fc392cb20b7959b4c425f5a2ec52c92df2 (diff) |
* eval.c (THREAD_ALLOC): th->thread should be initialized to NULL.
[ruby-talk:106657] The solution was found by Guy Decoux.
* file.c (rb_stat_dev_major): new methods File::Stat#dev_major and
#dev_minor. [ruby-core:03195]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | config.guess | 114 | ||||
-rw-r--r-- | eval.c | 1 | ||||
-rw-r--r-- | file.c | 48 | ||||
-rw-r--r-- | lib/yaml/rubytypes.rb | 20 |
5 files changed, 154 insertions, 39 deletions
@@ -3,6 +3,16 @@ Sat Jul 17 05:26:27 2004 Dave Thomas <dave@pragprog.com> * lib/rdoc/diagram.rb: Incorporate Micheal Neuman's client-side imagemao patch +Sat Jul 17 01:57:03 2004 Yukihiro Matsumoto <matz@ruby-lang.org> + + * eval.c (THREAD_ALLOC): th->thread should be initialized to NULL. + [ruby-talk:106657] The solution was found by Guy Decoux. + +Fri Jul 16 22:30:28 2004 Michael Neumann <mneumann@ntecs.de> + + * file.c (rb_stat_dev_major): new methods File::Stat#dev_major and + #dev_minor. [ruby-core:03195] + Fri Jul 16 15:23:53 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> * eval.c (return_jump, break_jump): raise unexpceted local jump diff --git a/config.guess b/config.guess index 906abc422f..dd1688b7b5 100644 --- a/config.guess +++ b/config.guess @@ -197,15 +197,24 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; + amd64:OpenBSD:*:*) + echo x86_64-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + cats:OpenBSD:*:*) + echo arm-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + luna88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; @@ -221,9 +230,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; - pegasos:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; @@ -239,10 +245,24 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit 0 ;; + macppc:MirBSD:*:*) + echo powerppc-unknown-mirbsd${UNAME_RELEASE} + exit 0 ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit 0 ;; alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then + case $UNAME_RELEASE in + *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU @@ -280,11 +300,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac + # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha*:OpenVMS:*:*) echo alpha-hp-vms @@ -405,6 +426,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; @@ -821,16 +845,19 @@ EOF echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux + echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) - echo cris-axis-linux + echo cris-axis-linux-gnu exit 0 ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux + echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build @@ -849,7 +876,7 @@ EOF #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux" && exit 0 + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; mips64:Linux:*:*) eval $set_cc_for_build @@ -868,13 +895,13 @@ EOF #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux" && exit 0 + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) - echo powerpc-unknown-linux + echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux + echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -888,33 +915,33 @@ EOF esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux ;; - PA8*) echo hppa2.0-unknown-linux ;; - *) echo hppa-unknown-linux ;; + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux + echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux + echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux + echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux + echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux + echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so @@ -929,20 +956,47 @@ EOF p'` case "$ld_supported_targets" in elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux" + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-aout" + echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) - echo "${UNAME_MACHINE}-pc-linux-coff" + echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") - # Either a pre-BFD a.out linker (linux-oldld) or + # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-oldld" + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <features.h> + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) @@ -1042,7 +1096,7 @@ EOF M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; - M68*:*:R3V[567]*:*) + M68*:*:R3V[5678]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) OS_REL='' @@ -1146,7 +1200,7 @@ EOF *86) UNAME_PROCESSOR=i686 ;; powerpc) UNAME_PROCESSOR=powerpc ;; esac - echo ${UNAME_PROCESSOR}-apple-darwin + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` @@ -11166,6 +11166,7 @@ rb_thread_group(thread) th->priority = 0;\ th->thgroup = thgroup_default;\ th->locals = 0;\ + th->thread = 0;\ } while (0) static rb_thread_t @@ -192,6 +192,52 @@ rb_stat_dev(self) return INT2NUM(get_stat(self)->st_dev); } +/* + * call-seq: + * stat.dev_major => fixnum + * + * Returns the major part of <code>File_Stat#dev</code> or + * <code>nil</code>. + * + * File.stat("/dev/fd1").dev_major #=> 2 + * File.stat("/dev/tty").dev_major #=> 5 + */ + +static VALUE +rb_stat_dev_major(self) + VALUE self; +{ +#if defined(major) + long dev = get_stat(self)->st_dev; + return ULONG2NUM(major(dev)); +#else + return Qnil; +#endif +} + +/* + * call-seq: + * stat.dev_minor => fixnum + * + * Returns the minor part of <code>File_Stat#dev</code> or + * <code>nil</code>. + * + * File.stat("/dev/fd1").dev_minor #=> 1 + * File.stat("/dev/tty").dev_minor #=> 0 + */ + +static VALUE +rb_stat_dev_minor(self) + VALUE self; +{ +#if defined(minor) + long dev = get_stat(self)->st_dev; + return ULONG2NUM(minor(dev)); +#else + return Qnil; +#endif +} + /* * call-seq: @@ -4148,6 +4194,8 @@ Init_File() rb_define_method(rb_cStat, "<=>", rb_stat_cmp, 1); rb_define_method(rb_cStat, "dev", rb_stat_dev, 0); + rb_define_method(rb_cStat, "dev_major", rb_stat_dev_major, 0); + rb_define_method(rb_cStat, "dev_minor", rb_stat_dev_minor, 0); rb_define_method(rb_cStat, "ino", rb_stat_ino, 0); rb_define_method(rb_cStat, "mode", rb_stat_mode, 0); rb_define_method(rb_cStat, "nlink", rb_stat_nlink, 0); diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb index adebf9439e..bd91bc039d 100644 --- a/lib/yaml/rubytypes.rb +++ b/lib/yaml/rubytypes.rb @@ -271,7 +271,7 @@ end YAML.add_ruby_type( /^exception/ ) { |type, val| type, obj_class = YAML.read_type_class( type, Exception ) - o = YAML.object_maker( obj_class, { 'mesg' => val.delete( 'message' ) }, true ) + o = YAML.object_maker( obj_class, { 'mesg' => val.delete( 'message' ) } ) val.each_pair { |k,v| o.instance_variable_set("@#{k}", v) } @@ -290,7 +290,7 @@ class String ( self.count( "^ -~", "^\r\n" ) / self.size > 0.3 || self.count( "\x00" ) > 0 ) end def to_yaml_type - "!ruby/string#{ if self.class != ::String; ":#{ self.class }"; end }" + "!ruby/string#{ ":#{ self.class }" if self.class != ::String }" end def to_yaml_fold nil @@ -315,8 +315,8 @@ class String } elsif self.is_binary_data? out.binary_base64( self ) - elsif self =~ /^ |#{YAML::ESCAPE_CHAR}| $/ - complex = false + # elsif self =~ /^ |#{YAML::ESCAPE_CHAR}| $/ + # complex = false else out.node_text( self, to_yaml_fold ) end @@ -326,7 +326,7 @@ class String self elsif empty? "''" - elsif self =~ /^[^#{YAML::WORD_CHAR}]| \#|#{YAML::ESCAPE_CHAR}|[#{YAML::SPACE_INDICATORS}]( |$)| $|\n|\'/ + elsif self =~ /^[^#{YAML::WORD_CHAR}\/]| \#|#{YAML::ESCAPE_CHAR}|[#{YAML::SPACE_INDICATORS}]( |$)| $|\n|\'/ "\"#{YAML.escape( self )}\"" elsif YAML.detect_implicit( self ) != 'str' "\"#{YAML.escape( self )}\"" @@ -371,7 +371,7 @@ end symbol_proc = Proc.new { |type, val| if String === val - val = YAML::load( "--- #{val}") if val =~ /^["'].*["']$/ + val = YAML::load( "--- #{val}") if val =~ /^["'].*['"]$/ val.intern else raise YAML::Error, "Invalid Symbol: " + val.inspect @@ -392,7 +392,9 @@ class Range end def to_yaml( opts = {} ) YAML::quick_emit( self.object_id, opts ) { |out| - if self.begin.is_complex_yaml? or self.end.is_complex_yaml? or not to_yaml_properties.empty? + if self.begin.is_complex_yaml? or self.begin.respond_to? :to_str or + self.end.is_complex_yaml? or self.end.respond_to? :to_str or + not to_yaml_properties.empty? out.map( to_yaml_type ) { |map| map.add( 'begin', self.begin ) map.add( 'end', self.end ) @@ -414,9 +416,9 @@ end YAML.add_ruby_type( /^range/ ) { |type, val| type, obj_class = YAML.read_type_class( type, ::Range ) - inr = '(\w+|[+-]*\d+(?:\.\d+)?|"(?:[^\\"]|\\.)*")' + inr = %r'(\w+|[+-]?\d+(?:\.\d+)?(?:e[+-]\d+)?|"(?:[^\\"]|\\.)*")' opts = {} - if String === val and val =~ /^#{inr}(\.{2,3})#{inr}$/ + if String === val and val =~ /^#{inr}(\.{2,3})#{inr}$/o r1, rdots, r2 = $1, $2, $3 opts = { 'begin' => YAML.load( "--- #{r1}" ), |