summaryrefslogtreecommitdiff
path: root/include/ruby
AgeCommit message (Collapse)Author
2011-12-05* include/ruby/{subst.h,win32.h}, ext/socket/rubysocket.h: revertusa
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
2011-12-04Introduce NEED_READCONV and NEED_WRITECONV to replace universal newline ↵luislavena
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
2011-12-01* include/ruby/subst.h: reverted r33916, since some names in vm.inc conflict.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-01* include/ruby/subst.h: removed arguments lists so that functionnobu
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
2011-11-29* win32/win32.c (rb_w32_inet_ntop): constified.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-28* include/ruby/win32.h (GetCurrentThreadHandle): remove unused API.nagachika
follow r33881. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-28* include/ruby/subst.h: typo of r33876.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-28* include/ruby/subst.h: moved Windows specific substitions fromnobu
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
2011-11-15* include/ruby/ruby.h(NUM2LONG, NUM2INT, NUM2SHORT, NUM2LL,kosaki
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
2011-11-15* fix ANSI C compliance of r33757ngoto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-15* include/ruby/defines.h (FLUSH_REGISTER_WINDOWS): move sparc asm codengoto
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
2011-11-15* include/ruby/ruby.h: get rid of gcc specific rb_long2int(),kosaki
NUM2LONG(), NUM2INT(), NUM2SHORT(), NUM2LL(), INT2NUM(), UINT2NUM(), LONG2NUM(), ULONG2NUM() and NUM2CHR() implementation. Because 1) They don't make any better code at all. 2) Inline function have a better debugger supoort. 3) If they become to make better code in the future, they might make cross compiler ABI compatibility issue. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14* include/ruby/ruby.h: add #ifdef comment.kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14* include/ruby/ruby.h: add NUM2SHORT(), NUM2USHORT() macros.kosaki
* numeric.c: ditto. * test/-ext-/num2int/test_num2int.rb: add testcases for NUM2SHORT(). * ext/-test-/num2int/num2int.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-08* include/ruby/ruby.h (rb_long2int): define as a macro always, sonobu
that cpp conditionals can tell if it is provided. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-07* include/ruby/encoding.h (ECONV_NEWLINE_DECORATOR_READ_MASK,usa
ECONV_NEWLINE_DECORATOR_WRITE_MASK): new macro. * io.c (rb_io_extract_modeenc, pipe_open, prep_stdio, argf_next_argv): set TEXTMODE_NEWLINE_DECORATOR_ON_WRITE for textmode on creating IO if the flag is available. * io.c (make_writeconv): drop decorators for reading. * io.c (make_readconv): drop decorators for writing. * io.c (do_writeconv): existing writeconv is not the condition to raise ArgumentError. should check textmode or not. * test/ruby/test_io_m17n.rb (TestIO_M17N#test_{cr,lf,crlf}_decorator_on_stdout): test above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-31* include/ruby/intern.h (rb_fd_fix_cloexec): renamed fromakr
rb_fd_set_cloexec. * io.c: follow the above renaming. * 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@33585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-31* win32/win32.c (setfl): extract from fcntl().usa
* win32/win32.c (dupfd): new function to support F_DUPFD. base on a patch written by akr. * win32/win32.c (fcntl): use above functions. * include/ruby/win32.h (F_DUPFD): define. [experimental] * include/ruby/win32.h (F_SETFL): change the value to correspond with other platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-30* include/ruby/intern.h (rb_cloexec_fcntl_dupfd): declared.akr
* io.c (rb_cloexec_fcntl_dupfd): new function. (nogvl_io_cntl): use rb_cloexec_fcntl_dupfd. * process.c (move_fds_to_avoid_crash): use rb_cloexec_fcntl_dupfd. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-30* include/ruby/intern.h (rb_cloexec_pipe): declared.akr
* 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-29* include/ruby/intern.h (rb_cloexec_dup2): declared.akr
* 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* include/ruby/intern.h (rb_cloexec_dup): declared.akr
* 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* include/ruby/intern.h (rb_cloexec_open): declared.akr
* 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-27* include/ruby/ruby.h (SIZE_MAX): define SIZE_MAX if not defined.naruse
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-25* include/ruby/defines.h: use "__sparc" instead of "sparc" andakr
"__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-22* include/ruby/intern.h (rb_fd_set_cloexec): declared.akr
* 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-21* numeric.c (rb_infinity, rb_nan): use union to prevent bus errorngoto
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-20* include/ruby/defines.h (flush_register_windows): use softwarenobu
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-14* include/ruby/intern.h (rb_ary_reverse): export.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-26* include/ruby/defines.h: remove NextStep, OpenStep, Rhapsodykosaki
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-08-30* win32/win32.c, include/ruby/intern.h (rb_w32_fd_copy): implementusa
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-05* include/ruby/win32.h (frexp, modf): original macros.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-04* include/ruby/missing.h: fix typo and so on.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-04* include/ruby/missing.h: define __syscall on OpenBSD as r32702.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-03Mark a code is GPL or not.naruse
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* util.c, include/ruby/util.h (ruby_add_suffix): remove the function.usa
[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-07-28See __APPLE__ for __syscall.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-27* include/ruby/missing.h: define __syscall if the platform hasnaruse
__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-26* parse.y (rb_check_id): make the given name a symbol or a string.nobu
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-23* error.c (rb_name_error_str): new function to raise NameErrornobu
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-22* object.c (rb_mod_{const,cvar}_defined, rb_obj_ivar_defined):nobu
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* parse.y (rb_is_global_id, rb_is_attrset_id): add missingnobu
predicates. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-20* include/ruby/intern.h (rb_update_max_fd): declaration moved fromakr
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-17* error.c (rb_check_trusted): new function to check an object isnobu
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-15* win32/win32.c, include/ruby/win32.h (rb_w32_io_cancelable_p): renamedusa
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-09* win32/win32.c (rb_w32_{read,write}): should be signed.nobu
Bug #5001 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-03* include/ruby/intern.h, thread_pthread.c (rb_reserved_fd_p,ko1
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-06-21* internal.h: move rb_thread_io_blocking_region() declarationkosaki
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-21revert r32183kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-21* internal.h: move rb_thread_io_blocking_region() declarationkosaki
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