Граф коммитов

768 Коммитов

Автор SHA1 Сообщение Дата
akr 0d2a92e0b3 * include/ruby/intern.h (rb_cloexec_pipe): declared.
* io.c (rb_cloexec_pipe): new function.
  (rb_pipe): use rb_cloexec_pipe.

* thread_pthread.c (rb_thread_create_timer_thread): use
  rb_cloexec_pipe.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-30 12:13:05 +00:00
akr 0a9cb21e62 * include/ruby/intern.h (rb_cloexec_dup2): declared.
* io.c (rb_cloexec_dup2): new function.
  (io_reopen): use rb_cloexec_dup2.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-29 13:11:01 +00:00
akr 4ae2b92576 * include/ruby/intern.h (rb_cloexec_dup): declared.
* io.c (rb_cloexec_dup): new function.
  (ruby_dup): use rb_cloexec_dup.

* ext/pty/pty.c (pty_getpty): use rb_cloexec_dup.
  
* ext/openssl/ossl_bio.c (ossl_obj2bio): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-29 11:02:32 +00:00
akr 3ae3cd741d * include/ruby/intern.h (rb_cloexec_open): declared.
* io.c (fd_set_cloexec): extracted from rb_fd_set_cloexec.
  (rb_cloexec_open): new function.
  (sysopen_func): use rb_cloexec_open.
  (rb_sysopen_internal): use rb_update_max_fd instead of
  rb_fd_set_cloexec.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-29 02:33:28 +00:00
naruse bafe837658 * include/ruby/ruby.h (SIZE_MAX): define SIZE_MAX if not defined.
patched by The Written Word Inc. [ruby-core:40422] [Bug #5489]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-27 00:59:46 +00:00
akr 49f6242b34 * include/ruby/defines.h: use "__sparc" instead of "sparc" and
"__sparc__".

* dln.c: ditto.

  [ruby-dev:44694]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-25 12:54:21 +00:00
akr b574a4d4a1 * include/ruby/intern.h (rb_fd_set_cloexec): declared.
* io.c (rb_fd_set_cloexec): new function.
  (ruby_dup): call rb_fd_set_cloexec to set close-on-exec flag.
  (rb_sysopen_internal): ditto.
  (rb_pipe): ditto.
  (io_reopen): ditto.
  (io_cntl): ditto.

* process.c (rb_f_exec): change the default :close_others option to
  true.
  (rb_f_system): ditto.
  (move_fds_to_avoid_crash): call rb_fd_set_cloexec to set
  close-on-exec flag.
  (ruby_setsid): ditto.
  (rb_daemon): ditto.

* thread_pthread.c (rb_thread_create_timer_thread): call
  rb_fd_set_cloexec to set close-on-exec flag.

* ruby.c (load_file_internal): ditto.

* file.c (rb_file_s_truncate): ditto.
  (file_load_ok): ditto.

* random.c (fill_random_seed): ditto.

* ext/pty/pty.c (chfunc): ditto.
  (get_device_once): ditto.

* ext/openssl/ossl_bio.c (ossl_obj2bio): ditto.

* ext/socket/init.c (rsock_socket): ditto.
  (rsock_s_accept_nonblock): ditto.
  (rsock_s_accept): ditto.

* ext/socket/socket.c (rsock_sock_s_socketpair): ditto.

* ext/socket/ancdata.c (discard_cmsg): ditto.
  (make_io_for_unix_rights): ditto.

* ext/socket/unixsocket.c (unix_recv_io): ditto.

* ext/io/console/console.c (console_dev): ditto.

[ruby-core:38140] [Feature #5041]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-22 09:58:15 +00:00
ngoto 971769cd76 * numeric.c (rb_infinity, rb_nan): use union to prevent bus error
caused by misalignment.  [Bug #5469] [ruby-dev:44657]
* include/ruby/missing.h (INFINITY, NAN): ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-21 17:34:58 +00:00
nobu 9c49753182 * include/ruby/defines.h (flush_register_windows): use software
trap on Debian Sparc 32-bit userspace.  [Bug #5244]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-20 04:09:37 +00:00
nobu 3a0e582e1f * include/ruby/intern.h (rb_ary_reverse): export.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-14 02:19:39 +00:00
kosaki 20ae79b0c2 * include/ruby/defines.h: remove NextStep, OpenStep, Rhapsody
support. Last activity of their OSs are 7 years ago.
* configure.in: ditto.
* dir.c: ditto.
* ext/tk/extconf.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-26 00:19:03 +00:00
usa ee7d523631 * win32/win32.c, include/ruby/intern.h (rb_w32_fd_copy): implement
for rb_thread_select() in thread.c.  the use of rb_fd_copy() is
  introduced in r33117.
  [Bug #5229] [ruby-core:39102]

* thread.c (rb_thread_select): must call rb_fd_init() before using
  rb_fdset_t.  see the implementations of rb_fd_init()s if you want to
  know the reason.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-30 15:04:11 +00:00
nobu 543ecd95d5 * include/ruby/win32.h (frexp, modf): original macros.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-05 13:20:26 +00:00
nobu 11667b9c9a * include/ruby/missing.h: fix typo and so on.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-04 02:54:22 +00:00
naruse d04697df88 * include/ruby/missing.h: define __syscall on OpenBSD as r32702.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-04 02:32:19 +00:00
naruse d7c026d058 Mark a code is GPL or not.
This is made the comparison between current and initial commit.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-03 15:40:03 +00:00
usa f9e9eee677 * util.c, include/ruby/util.h (ruby_add_suffix): remove the function.
[Bug #5153] [ruby-core:38736]

* io.c (argf_next_argv): remove the call of above function.

* ext/-test-/add_suffix, test/-ext-/test_add_suffix.rb: remove the test
  extension module because this is only for testsing ruby_add_suffix().

* LEGAL: remove the mention about a part of util.c, because now we
  removed the part.

* io.c (argf_next_argv): now the new filename is not guranteed to
  use, so should check the return value of rename(2).

* test/ruby/test_argf.rb (TestArgf#test_inplace_rename_impossible):
  now we expect same result with other platforms on no_safe_rename
  platforms (=Windows).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-03 07:10:56 +00:00
naruse da6c57aa54 See __APPLE__ for __syscall.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-28 00:23:28 +00:00
naruse 9f2b8eafdd * include/ruby/missing.h: define __syscall if the platform has
__syscall in the library but doesn't define it in headers
  for example Mac OS X.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-27 08:58:38 +00:00
nobu 3fbc65d47f * parse.y (rb_check_id): make the given name a symbol or a string.
based on the second patch by Jeremy Evans at [ruby-core:38447]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26 16:05:27 +00:00
nobu 4dc1a21809 * error.c (rb_name_error_str): new function to raise NameError
with the name string but not ID.
* object.c, proc.c, variable.c: more removal of inadvertent symbol
  creation.  [Feature #5079]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-23 15:05:03 +00:00
nobu 34918aa832 * object.c (rb_mod_{const,cvar}_defined, rb_obj_ivar_defined):
avoid inadvertent symbol creation in reflection methods.  based
  on a patch by Jeremy Evans at [ruby-core:38367].  [Feature #5072]
* vm_method.c (rb_mod_method_defined)
  (rb_mod_{public,private,protected}_method_defined)
  (obj_respond_to): ditto.
* parse.y (rb_check_id): new function returns already interned ID
  or 0.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-22 12:06:42 +00:00
nobu c276b73804 * parse.y (rb_is_global_id, rb_is_attrset_id): add missing
predicates.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-22 11:44:53 +00:00
akr b41ccc4a9c * include/ruby/intern.h (rb_update_max_fd): declaration moved from
internal.h.

* file.c: ditto.

* io.c: call rb_update_max_fd for each new fds.

* process.c: ditto.

* random.c: ditto.

* ruby.c: ditto.

* ext/io/console/console.c: ditto.

* ext/openssl/ossl_bio.c: ditto.

* ext/pty/pty.c: ditto.

* ext/socket/init.c: ditto.

* ext/socket/socket.c: ditto.

* ext/socket/ancdata.c: ditto.

* ext/socket/unixsocket.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-20 13:26:10 +00:00
nobu e2fd80b3d3 * error.c (rb_check_trusted): new function to check an object is
trusted.
* struct.c (rb_struct_modify), time.c (time_modify): check by the
  above function to show proper class names.  [Bug #5036]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-17 07:26:45 +00:00
usa f15d0deaaf * win32/win32.c, include/ruby/win32.h (rb_w32_io_cancelable_p): renamed
from rb_w32_has_cancel_io().  now it takes a parameter as fd to check
  the fd is console or not, because we cannot cancel console input even
  if we have cancel_io function.

* io.c (WAIT_FD_IN_WIN32): call above function instead of the old one,
  so now we can kill the thread which calls STDIN.gets.
  the problem was reported by ko1 vir IRC.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-15 05:33:45 +00:00
nobu 63ab190151 * win32/win32.c (rb_w32_{read,write}): should be signed.
Bug #5001

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-09 06:59:23 +00:00
ko1 eb35bb0b35 * include/ruby/intern.h, thread_pthread.c (rb_reserved_fd_p,
RB_RESERVED_FD_P): added.  This C API is to limit to access
  fds which are used by RubyVM internal.  In this version of
  CRuby, return 1 if fd is communication pipe.
  If your application needs to close all file descriptors to
  preent resource leak, skip internal fds using this C API.
  We also define a macro RB_RESERVED_FD_P(fd).  So you can write
  #ifndef RB_RESERVED_FD_P
  #define RB_RESERVED_FD_P(fd) 0
  #endif
  for Ruby 1.9.2 or previous version to write compatible extensions.
  See [ruby-core:37727]
* thread_win32.c (rb_reserved_fd_p): added (return 0 for any fds).
* io.c (rb_io_initialize): raise ArgumentError if given fd is reserved by Ruby.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-03 21:56:59 +00:00
kosaki 908baefe7d * internal.h: move rb_thread_io_blocking_region() declaration
from intern.h to internal.h. It's still experimental API and
  need more discussion. [ruby-dev:43698]
* include/ruby/intern.h: ditto.

* ext/socket/rubysocket.h: include internal.h.
* ext/socket/depend: add internal.h dependency.
* ext/socket/extconf.rb: add $INCFLAGS to topdir.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-21 12:31:17 +00:00
kosaki b9d9ea62b4 revert r32183
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-21 11:52:24 +00:00
kosaki 97beed076f * internal.h: move rb_thread_io_blocking_region() declaration
from intern.h to internal.h. It's still experimental API and
  need more discussion.
* include/ruby/intern.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-21 10:57:53 +00:00
nobu 19f386674e * include/ruby/backward/classext.h: for evil gems. fixed #4803
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 03:05:11 +00:00
nobu 685444569c * fix for build on solaris 10.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-16 00:12:55 +00:00
usa 5574d874fb * include/ruby/{defines,missing}.h (rb_infinity, rb_nan): move from
defines.h to missing.h.  (couldn't use RUBY_EXTERN there.)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-06 06:11:37 +00:00
usa f0bd1c2174 * include/ruby/defines.h (rb_inifinity, rb_nan): export for Windows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-06 05:09:58 +00:00
usa 799fafc03b * include/ruby/missing.h, numeric.c (round): moved prototype of round()
from numeric.c to missing.h.  (note: round() is C99 feature, so ruby
  provides it if not exists in C runtime.)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-03 11:58:11 +00:00
nahi 7d20942bf6 * include/ruby/defines.h (CASEFOLD_FILESYSTEM): Revert r30508. Forgot to
include this file in the commit r31692. __APPLE__ is not
  CASEFOLD_FILESYSTEM again, from this time.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-23 01:04:07 +00:00
mrkn 4eb3654178 * bignum.c (dump_bignum, bigmul1_balance, big_split, biglsh_bang,
bigrsh_bang, big_split3, bigmul1_toom3, bigmul0): implement Toom3 (Toom-Cook)
  multiplication.
* include/ruby/defines.h: add format prefixes for BDIGIT and BDIGIT_DBL.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22 15:37:00 +00:00
nobu 52f5f410e4 * internal.h: add for internal use only.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-18 13:41:54 +00:00
kosaki d734c9dea2 * include/ruby/intern.h: resurrect old rb_fd_copy().
* thread.c (rb_fd_copy): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15 14:57:35 +00:00
kosaki 2b7996e839 * include/ruby/intern.h: remove rb_fd_copy() to rb_fd_dup() and
rb_w32_fdcopy() to rb_w32_fd_dup().
* win32/win32.c: ditto.
* thread.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15 14:51:09 +00:00
nobu 3a47cf3395 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15 11:55:52 +00:00
kosaki 3ad44e0aa1 introduce missing/setproctitle.c
* include/ruby/missing.h: add setproctitle() declaration.
* missing/setproctitle.c: added.
* configure.in: add check for missing/setproctitle.c.

* ruby.c (ruby_process_options): add to call compat_init_setproctitle().
* ruby.c (set_arg0): remove all platform specific code. it's
  moved to missing/setproctitle.c.
* ruby.c (origarg): remove len field. It's no longer used.
* ruby.c (get_arglen): removed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-14 10:49:47 +00:00
kosaki 9468e945c8 * thread.c (rb_fd_init): remove volatile qualifier.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-07 13:40:56 +00:00
kosaki 156ccab796 * thread.c (rb_fd_init_copy): new internal api. It provide efficient
copy constructor semantics.
* thread.c (do_select): use rb_fd_init_copy().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-07 13:36:08 +00:00
kosaki 249fe0e742 * thread.c (rb_wait_for_single_fd): new. poll(2) based backend for rb_wait_for_single_fd().
Now only Linux uses it.

The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-04 01:07:03 +00:00
kosaki 9be37ca7d5 * thread.c (rb_wait_for_single_fd): new.
* thread.c (select_single): select(2) based backend for rb_wait_for_single_fd().

* io.c (make_writeconv): use rb_wait_for_single_fd() instaed of
  rb_thread_fd_select().
* io.c (rb_io_wait_readable): ditto.
* thread.c (rb_thread_wait_fd_rw): ditto.

* io.c (wait_readable): removed.
* thread.c (init_set_fd): new helper function.
* include/ruby/io.h (RB_WAITFD_IN, RB_WAITFD_PRI, RB_WAITFD_OUT):
  new constant for rb_single_wait_fd().

The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-04 00:59:57 +00:00
nobu 88559ce46e * include/ruby/intern.h (rb_w32_fdcopy): add prototype. fixes
#4640

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-02 18:57:06 +00:00
kosaki 04202dc83d * win32/win32.c (rb_w32_fdcopy): New. This can copy even though
fdset size exceed FD_SETSIZE.
* include/ruby/intern.h (rb_fd_copy): use rb_w32_fdcopy()



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-30 14:11:34 +00:00
kosaki 225fa965bc * thread.c (rb_fd_copy): Change function argument. Now
rb_fd_copy() has fully copy semantics.
* include/ruby/intern.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-30 11:18:14 +00:00
kosaki 2d2544c8e6 * include/ruby/intern.h (rb_thread_select): mark as deprecated.
* ext/io/wait/wait.c (wait_readable): use rb_thread_fd_select
  instead of rb_thread_select.
* ext/socket/init.c (wait_connectable0): ditto.
* ext/readline/readline.c (readline_event): ditto.
* io.c (rb_io_wait_readable, wait_readable, rb_io_wait_writable,
  wait_writable): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-30 11:15:15 +00:00
kosaki 58e414b85e * include/ruby/win32.h: remove redundunt declaration of
rb_w32_time_subtract().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-29 15:43:55 +00:00
nobu 5f131b648d * thread_win32.c, include/ruby/win32.h: add prototypes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-29 12:12:52 +00:00
kosaki b4c5fad4b1 * thread_win32.c (native_cond_timedwait): New. r31373 caused
win32 build failure.

* thread_win32.c (__cond_timedwait, abs_timespec_to_timeout_ms):
  New helper functions.

* win32/win32.c (rb_w32_time_subtract): rename from subtract and
  remove static.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-29 04:18:29 +00:00
nobu 8fabd0c551 * include/ruby/win32.h (frexp, modf): fix suppressing warnings on
mingw.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-26 16:14:26 +00:00
nobu 8761467727 * io.c (validate_enc_binmode, rb_io_extract_modeenc): set newline
decorator according to open mode.
* transcode.c (rb_econv_prepare_options): new function, to prepare
  econv options with newline flags.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-26 15:55:21 +00:00
nobu 3b937bbdc4 * include/ruby/encoding.h (ECONV_NEWLINE_DECORATOR_MASK): add.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-26 15:54:14 +00:00
nobu fcfc113b04 * include/ruby/win32.h (ftruncate, truncate, ftello, fseeko): non-64
versions on mingw are useless because they use int32_t.  fixes #4564

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-26 15:50:09 +00:00
naruse 60aa9c809b * include/ruby/intern.h: pcc can't use __builtin_constant_p.
* vm_exec.c: change condition.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-23 17:34:58 +00:00
nobu d986500059 * include/ruby/win32.h (frexp, modf): wrongly declared as pure in
mingw math.h.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-14 12:21:09 +00:00
nobu f777225e09 * include/ruby/win32.h (ftruncate, truncate): mingw64 misses
prototypes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-14 12:21:04 +00:00
akr 77a12692ee * include/ruby/st.h: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-12 11:54:28 +00:00
usa c3b81f63e7 * include/ruby/win32.h: VC doesn't have ftruncate() and others, but
ruby needs HAVE_ macros to use our emulation functions.
  (fix the problem of 31262)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-12 01:39:39 +00:00
luislavena c2bfeaa244 Evaluate truncate, ftruncate and ftello existence
This corrects mingw-w64 compilation.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-11 16:38:10 +00:00
akr 4db93c3f41 * include/ruby/ruby.h: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-10 13:24:26 +00:00
akr eb7d68819f * include/ruby/util.h: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-09 09:02:03 +00:00
akr e6ef26ae4b * include/ruby/io.h: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-07 11:04:18 +00:00
akr d55cf83561 * include/ruby/intern.h: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-06 12:08:46 +00:00
akr a63105a45f * include/ruby/encoding.h: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-05 11:34:15 +00:00
nobu 9b66922d7f * numeric.c (flo_round): fix inaccurate results.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-22 23:07:36 +00:00
arton 11e4052295 * hash.c (ruby_setenv): check env process block size with OS ver.
* win32/win32.c: export rb_w32_osver for above patch.
* include/ruby/win32.h: declare rb_w32_osver for Win32 Libs.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-19 16:33:59 +00:00
nobu 247fdeedf8 * include/ruby/ruby.h (rb_funcall_passing_block): add prototype.
a patch by James M. Lawrence at [ruby-core:35501]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-17 15:54:22 +00:00
matz eb807d42ec * gc.c (rb_gc_set_params): allow GC parameter configuration by
environment variables.  based on a patch from funny-falcon at
  https://gist.github.com/856296, but honors safe level.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07 08:39:39 +00:00
nagachika eaf08203dd * include/ruby/intern.h: fix a typo of prototype declaration.
rb_mutex_try_lock -> rb_mutex_trylock [ruby-dev:43213]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-05 13:59:21 +00:00
arton e59654c24b * include/ruby/win32.h: define WIN32 if neither _WIN64 nor WIN32 defined. it forces to use push/pop for pack(4) pragma.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-28 15:15:32 +00:00
nobu 58b325366d * thread.c (rb_thread_io_blocking_region): new function to run
blocking region with GIL released, for fd.
* thread.c (rb_thread_fd_close): implement.  [ruby-core:35203]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-12 05:44:23 +00:00
naruse a3b4b499a5 * include/ruby/missing.h: don't use HAVE_STDDEF_H because it never
defined by configure though configure.bat defines it.

* include/ruby/ruby.h: move include stddef.h to defines.h

* include/ruby/defines.h: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-03 07:37:22 +00:00
naruse c008ca5ae6 * include/ruby/encoding.h (rb_enc_step_back): cast 4th argument 'n'
as int because Ruby usually treats length value as long but
  onigenc_step_back's 4th argument is int.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-03 00:38:55 +00:00
kosaki 6909ea443f * include/ruby/st.h (st_table): Added comment why we need __extension__.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-01 15:32:08 +00:00
tarui fb672259d9 * include/ruby/win32.h, win32/win32.c: add rb_w32_inet_ntop.
inet_ntop's minimum supported client is Vista.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-31 17:31:18 +00:00
nobu f989f7c7ea * string.c (rb_str_ellipsize): new function to ellipsize a string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-30 04:01:58 +00:00
nobu 4dcc883d06 * include/ruby/encoding.h (rb_enc_step_back): new function to step
back n characters.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-30 03:56:16 +00:00
kosaki eea774d029 * include/ruby/ruby.h: Added NUM2MODET() and MODET2NUM() default definition.
Because r30686 introduced win32 build failure.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-29 16:06:00 +00:00
nobu 8489ac41ca * include/ruby/ruby.h (ALLOCV): new API for exception-safe
temporary buffer.  [ruby-core:34844]
* string.c (rb_alloc_tmp_buffer, rb_free_tmp_buffer):
  implementation of the API.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-26 23:32:22 +00:00
nobu fea355647e * include/ruby/io.h: missing prototypes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-15 00:42:14 +00:00
nobu dd55661f56 * include/ruby/defines.h (CASEFOLD_FILESYSTEM): HFS+ is case
insensitive.
* load.c (loaded_feature_path, rb_feature_p, load_lock): on a
  case-insensitive filesystem, loaded features search should
  ignore case.  [ruby-core:34297]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-10 13:46:47 +00:00
nobu 65ea2eed78 * array.c (rb_ary_modify): export.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-05 20:25:50 +00:00
nobu c8aaf31fdd * array.c (rb_ary_resize): new utility function. [ruby-dev:42912]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-05 20:10:59 +00:00
nobu 2d5bd6b194 * intern.h (VALUE rb_ary_join): I have never seen this function
anywhere.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-01 01:59:14 +00:00
usa 90d5bcf910 * re.c (rb_reg_expr_str): need to escape if the coderage is invalid.
* error.c, include/ruby/intern.h (rb_compile_error_with_enc): new
	  function to raise syntax error, with source encoding'ed message.

	* parse.y (compile_error): use above function.
	  [ruby-core:33951] (#4217)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-28 09:43:49 +00:00
nobu 5bf72d1fa6 * transcode.c (transcode_loop): call default handler of the given
hash, method, proc or [] method as fallback.  [ruby-dev:42692]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-07 13:05:26 +00:00
nobu 2d4b0d6261 * hash.c (rb_hash_update_by): new API for Hash#update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-04 02:21:53 +00:00
shyouhei 51da92ea12 * vm.c (ruby_vm_at_exit): new API. This enables extension libs to
hook a VM termination.  Right now, because the VM we have is
	  process global, most extensions do not deallocate resources and
	  leave them to Operating System's reaping userland processes.  But
	  in a future we plan to have multiple VMs to run simultaneously in
	  a single process (MVM project).  At that stage we can no longer
	  rely on OSes and have to manage every resources to be reclaimed
	  properly.  So it is.  For a forward-compatibility reason this API
	  is introduced now, encouraging you to be as gentle as you can for
	  your resources; that is, tidy up your room.

	* include/ruby/vm.h: ditto.

	* vm_core.h (rb_vm_struct): new field.

	* vm.c (vm_init2): initialize above new field.

	* eval.c (ruby_cleanup): trigger those hooks.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-02 11:06:32 +00:00
usa dd4c394564 * include/ruby/win32.h (rb_w32_write_console): wrong prototype.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-29 05:20:08 +00:00
nobu c6e4767068 * include/ruby/io.h (rb_io_buffer_t): extract from rb_io_t.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-18 13:58:47 +00:00
nobu 8a7aad9952 * fix type warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-11 12:30:39 +00:00
nobu fe9f1e8cf8 * include/ruby/ruby.h (PRI_LL_PREFIX): format type specifier for
LONG_LONG may vary on platforms.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-11 11:49:54 +00:00
nobu b3c7867df7 * error.c (rb_syserr_new): new function to make SystemCallError
instance without errno.  [EXPERIMENTAL]
* error.c (rb_syserr_fail, rb_mod_syserr_fail): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-08 22:30:20 +00:00
naruse 64bd18c588 * include/ruby/oniguruma.h (ONIGENC_CTYPE_SPECIAL_MASK):
change mask from 128 to 256. [ruby-core:32931]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-28 11:07:25 +00:00
usa 6ef1aa7964 * include/ruby/ruby.h (NUM2LONG_internal): add cast to get rid of a
non GCC compiler warning. this is intentional type conversion.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-27 03:00:26 +00:00