aboutsummaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Feature #5896nobu2012-05-241-2/+2
| | | | | | | | * vsnprintf.c (BSD_vfprintf): [EXPERIMENTAL] object representation in rb_enc_vsprintf(). [Feature #5896] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/win32.h (FD_SET): change function to macro.shirosaki2012-05-081-1/+16
| | | | | | | | | | | | | | | | | | | | | | | To avoid buffer overflow when smaller FD_SETSISE is used in ext libraries. * win32/win32.c (rb_w32_fdset): this function is not used anymore. But we leave this for compatibility. * win32/win32.c (rb_w32_select_with_thread): fix SEGV when smaller FD_SETSISE is used in ext libraries. Dereference of fd_set pointer causes SEGV. * test/-ext-/win32/test_fd_setsize.rb(TestFdSetSize): add tests for above. * ext/-test-/win32/fd_setsize/depend: ditto. * ext/-test-/win32/fd_setsize/extconf.rb: ditto. * ext/-test-/win32/fd_setsize/fd_setsize.c: ditto. [ruby-core:44588] [Bug #6352] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * win32/win32.c (gmtime_r, localtime_r): POSIX compliant reentrantnobu2012-04-161-0/+3
| | | | | | | versions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (rb_check_id_cstr): new function to check if ID isnobu2012-04-111-0/+1
| | | | | | | registered with NUL-terminated C string. * sprintf.c (rb_str_format): avoid inadvertent symbol creation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (rb_enc_raise): new function to raise an exception withnobu2012-04-101-0/+2
| | | | | | | | the message in the given encoding. patched by now (Nikolai Weibull) at [ruby-core:41160]. [Feature #5650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/win32.h (rb_w32_aspawn_flags): add the declaration ofshirosaki2012-04-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | new function. * process.c (enum): add EXEC_OPTION_PGROUP and move the position above for the usage in proc_spawn_n(). * process.c (proc_spawn_n): add an argument to pass new option `new_pgroup`. The option specifies CREATE_NEW_PROCESS_GROUP flag to CreateProcessW(). This flag is necessary for the usage of Process.kill on the subprocess on Windows. * process.c (rb_exec_arg_addopt): ditto. * process.c (rb_spawn_process): ditto. * process.c (documentation for rb_f_spawn): add documentation for new option `new_pgroup` of spawn. * test/ruby/test_process.rb (TestProcess#test_execopts_new_pgroup): add tests for option `new_pgroup`. * test/ruby/test_thread.rb (TestThreadGroup#test_thread_timer_and_interrupt): add option `new_pgroup: true` to spawn on Windows. It's needed for Process.kill on a subprocess. * win32/win32.c (CreateChild): add an argument to pass dwCreationFlags of CreateProcessW(). * win32/win32.c (rb_w32_spawn): ditto. * win32/win32.c (rb_w32_aspawn_flags): add new function to pass dwCreationFlags. * win32/win32.c (rb_w32_aspawn): refactor to move the content to rb_w32_aspawn_flags(). [ruby-core:43245][Bug #6131] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_update): pass pointer to key to the callback function.nobu2012-03-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_update): add existing parameter to the callback function.nobu2012-03-291-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (rb_str_to_inum): must be ASCII compatible encoding asnobu2012-03-231-0/+1
| | | | | | | well as String#hex and String#oct. [ruby-core:43566][Bug #6192] * string.c (rb_must_asciicompat): check if ASCII compatible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/win32.h (fstati64): fix macro conflicts.nobu2012-03-221-3/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * win32/win32.c (rb_w32_fstat, rb_w32_fstati64): convert FILETIMEnobu2012-03-221-2/+2
| | | | | | | | to time_t directly, not to be affected by TZ unnecessarily. * win32/win32.c (unixtime_to_filetime): convert time_t to FILETIME simply. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (rb_enum_values_pack): rename from enum_values_pack, andshugo2012-03-151-0/+1
| | | | | | | | | | | | | remove static. * enumerator.c (lazy_init_iterator, lazy_init_yielder, lazy_select_func, lazy_reject_func, lazy_grep_func): handle multiple values correctly. * enumerator.c (lazy_grep): change the behavior when a block is given, to be consistent with Enumerable#grep. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * win32/win32.c, include/ruby/win32.h (rb_w32_ugetenv): new API tousa2012-03-151-0/+1
| | | | | | | | | | | | | | accept and to return UTF-8 strings. * win32/win32.c (rb_w32_getenv): follow above change. * win32/win32.c (rb_w32_get_environ): returns UTF-8 environment area. * hash.c (env_str_new, rb_f_getenv, env_fetch): follow above changes. [Bug #5570] [ruby-core:40737] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h: Add rb_check_arity, rb_error_arity [#6085]marcandre2012-03-141-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * array.c: Use rb_check_arity / rb_error_arity * class.c: ditto * enumerator.c: ditto * eval.c: ditto * file.c: ditto * hash.c: ditto * numeric.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * re.c: ditto * signal.c: ditto * string.c: ditto * struct.c: ditto * transcode.c: ditto * vm_eval.c: ditto * vm_insnhelper.c: ditto & implementation of rb_error_arity * test/ruby/test_arity.rb: tests for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c: improve number of arguments error in case ofmarcandre2012-03-141-0/+1
| | | | | | | | | | optional parameters (issue #6085) * include/ruby/intern.h: define UNLIMITED_ARGUMENTS * test/ruby/test_arity.rb: test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_find_encoding): new function find encoding fromnobu2012-03-121-0/+1
| | | | | | | | | | arbitrary object as a pointer to rb_encoding, and return NULL if not found. * io.c (io_encoding_set): just warn unsupported encodings, but not exception. [ruby-core:40726] [Bug #5567] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c: add st_foreach_check for fixing iteration over packed tablenobu2012-03-101-0/+1
| | | | | | | | and st_delete_safe. patched by Sokolov Yura at https://github.com/ruby/ruby/pull/84 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c: fix packed num_entries on delete_safe. patched by Sokolovnobu2012-03-101-1/+4
| | | | | | | Yura at https://github.com/ruby/ruby/pull/84 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rb_load_failnobu2012-03-071-1/+0
| | | | | | | | * error.c (rb_load_fail): use path as a string, not char*. * internal.h: (rb_load_fail): moved from ruby/intern.h. * ruby.c (load_file_internal): fname cannot be NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (rb_loaderror_with_path): Adding the missing file as antenderlove2012-03-061-0/+1
| | | | | | | | | | | | | | | | | instance variable to the LoadError exception. * load.c: call rb_loaderror_with_path so that the missing path is added to the exception. * ruby.c: call rb_loaderror rather than raising our own LoadError exception. * include/ruby/intern.h: add declaration for rb_loaderror_with_path. * test/ruby/test_require.rb: add supporting test for LoadError#path method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (unpack_entries): use union instead of casted pointer.nobu2012-03-051-2/+7
| | | | | | | patched by Sokolov Yura <funny.falcon AT gmail.com>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (rb_file_const, rb_file_load_ok): moved functions fornobu2012-03-011-2/+0
| | | | | | internal use only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c, process.c, time.c, ext: use rb_sys_fail_str instead ofnobu2012-02-271-0/+1
| | | | | | | rb_sys_fail. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c: new functions to deal exceptions with string instances.nobu2012-02-241-0/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (__builtin_unreachable): check for clang.nobu2012-02-241-0/+3
| | | | | | | | [ruby-core:42849] * include/ruby/ruby.h (UNREACHABLE): fallback definition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * Merge Onigmo-5.13.1. [ruby-dev:45057] [Feature #5820]naruse2012-02-171-29/+61
| | | | | | | | | | https://github.com/k-takata/Onigmo cp reg{comp,enc,error,exec,parse,syntax}.c reg{enc,int,parse}.h cp oniguruma.h cp tool/enc-unicode.rb cp -r enc/ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_event_hook_func_t): add argument names.nobu2012-02-121-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_modify_expand): fix memory leak.nobu2012-02-081-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_enc_path_next, rb_enc_path_skip_prefix)nobu2012-01-252-6/+6
| | | | | | | | | | | | | | | (rb_enc_path_last_separator, rb_enc_path_end) (ruby_enc_find_basename, ruby_enc_find_extname): encoding-aware path handling functions. * file.c (rb_home_dir, file_expand_path, rb_realpath_internal) (rb_file_s_basename, rb_file_dirname, rb_file_s_extname) (rb_file_join): should respect the encodings of arguments than file system encoding. [ruby-dev:45145] [Bug #5919] * dir.c (check_dirname, ruby_glob0): ditto. * ext/pathname/pathname.c (path_sub_ext): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (rb_iter_break_value): new function to break a block withnobu2012-01-241-0/+1
| | | | | | the value. [ruby-dev:45132] [Feature #5895] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_Hash): add Kernel#Hash conversion method likematz2012-01-241-0/+1
| | | | | | Array() or Float(). a patch from Run Paint Run Run. Fix #3131 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (FIXNUM_P): simple flag should be int.nobu2012-01-211-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: use Bitmap Marking algorithm to avoid copy-on-write ofnari2012-01-071-2/+2
| | | | | | | | | | | | | | | | | memory pages. See [ruby-dev:45085] [Feature #5839] [ruby-core:41916]. * include/ruby/ruby.h : FL_MARK rename to FL_RESERVED1. * node.h : ditto. * debug.c : ditto. * object.c (rb_obj_clone): FL_MARK move to a bitmap. * class.c (rb_singleton_class_clone): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/version.h: RUBY_API_VERSION 2.0.0ayumin2012-01-061-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: fix #error pragma. LLP64 platform is supported.nagachika2011-12-282-2/+2
| | | | | | * include/ruby/st.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c (st_update): new function to lookup the given key andnobu2011-12-271-0/+1
| | | | | | | update the value. [ruby-dev:44998] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * win32/win32.c, include/ruby/win32.h (rb_w32_fd_is_text): new function.usa2011-12-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * win32/win32.c (init_stdhandle): set default mode of stdin as binmode. * io.c (set_binary_mode_with_seek_cur): new function to replace SET_BINARY_MODE_WITH_SEEK_CUR macro. now returns previous mode of the fd and take care of LF in rbuf. * io.c (do_writeconv): set text mode when needed. * io.c (io_read): need to change the mode of the IO to binmode temporally when the length for IO#read, because IO#read with length must behave so. * test/ruby/test_io_m17n.rb (TestIO_M17N#est_{read_with_length, read_with_length_binmode,get[cs]_and_read_with_binmode, read_with_binmode_and_get[cs],read_write_with_binmode}): tests for above changes. all patches are written by Hiroshi Shirosaki. [ruby-core:41496] [Feature #5714] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_check_to_int): new function to convert a VALUE tonobu2011-12-111-0/+1
| | | | | | | | an Integer if possible, but returns nil instead of raising an exception otherwise. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Silence stat redefinition warnings under win32luislavena2011-12-081-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/{subst.h,win32.h}, ext/socket/rubysocket.h: revertusa2011-12-052-93/+92
| | | | | | | | | r33876. [ruby-core:41475] [Bug #5706] * ext/socket/extconf.rb: the alternative hack for [Bug #5675]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Introduce NEED_READCONV and NEED_WRITECONV to replace universal newline ↵luislavena2011-12-041-1/+1
| | | | | | | | | decorator Use CRLF only when required to improve file reading and writing under Windows. Patch by Hiroshi Shirosaki. [ruby-core:40706] [Feature #5562] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/subst.h: reverted r33916, since some names in vm.inc conflict.nobu2011-12-011-30/+30
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/subst.h: removed arguments lists so that functionnobu2011-12-011-30/+30
| | | | | | | | calls with zero arguments can be substituted. aliasing in .def file has no effect for static library. [ruby-core:41370] [Bug#5681] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * win32/win32.c (rb_w32_inet_ntop): constified.nobu2011-11-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/win32.h (GetCurrentThreadHandle): remove unused API.nagachika2011-11-281-1/+0
| | | | | | follow r33881. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/subst.h: typo of r33876.usa2011-11-281-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/subst.h: moved Windows specific substitions fromnobu2011-11-282-92/+92
| | | | | | | win32.h. * ext/socket/rubysocket.h: include ruby/subst.h. [Bug #5675] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h(NUM2LONG, NUM2INT, NUM2SHORT, NUM2LL,kosaki2011-11-151-12/+24
| | | | | | | | | INT2NUM, UINT2NUM, LONG2NUM, ULONG2NUM, NUM2CHR): wrap by macros. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * fix ANSI C compliance of r33757ngoto2011-11-151-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/defines.h (FLUSH_REGISTER_WINDOWS): move sparc asm codengoto2011-11-151-15/+2
| | | | | | | | | | to a separete file sparc.c for preventing inlining optimization. Patched by Jurij Smakov. [Bug #5244] [ruby-core:40685] * sparc.c (rb_sparc_flush_register_windows): ditto. * configure.in: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e