Commit graph

262 commits

Author SHA1 Message Date
matz
ad723e6f24 * st.c (malloc): use xmalloc/xcalloc instead of plain
malloc/calloc, to detect memory allocation failure.  see
  <http://www.nongnu.org/failmalloc/>.

* gc.c (rb_memerror): should not raise empty nomem_error.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-14 17:12:47 +00:00
akr
fb5ff37bae * gc.c (gc_sweep): expand heap earlier.
reported by MORITA Naoyuki.  [ruby-dev:28960]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-10 10:26:45 +00:00
akr
00f6107621 * gc.c (id2ref): fix symbol test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-03-04 06:28:51 +00:00
akr
6828bbeae0 * gc.c: align VALUE with sizeof(RVALUE) globally.
(is_pointer_to_heap): check alignment out of loop.
  (id2ref): avoid collision between symbols and objects.
  (rb_obj_id): ditto.  moved from object.c.
  [ruby-talk:178364] [ruby-core:7401]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-03-02 10:46:17 +00:00
ocean
2b3243d7fa * gc.c: commited magic for reducing RVALUE size on windows. (24->20byte)
[ruby-core:7474]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-03-02 09:01:51 +00:00
matz
492490b857 * gc.c (add_heap): heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-03-01 23:12:06 +00:00
matz
8a3d25a790 * eval.c (rb_call0): argument update propagation. [ruby-dev:28044]
* env.h: remove argc member from struct FRAME.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-13 09:10:55 +00:00
eban
a24d4016ac * gc.c (gc_sweep): typo fix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-06 02:49:37 +00:00
akr
84be7576b8 * gc.c (garbage_collect): mark ruby_current_node.
if an exception is raised in a finalizer called by
  rb_gc_call_finalizer_at_exit, ruby_set_current_source may use
  collected ruby_current_node and mark_source_filename may corrupt
  memory.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-01-10 10:50:17 +00:00
nobu
5f0902a098 * gc.c (garbage_collect): mark objects refered from aborting threads.
[ruby-dev:28190]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-30 09:15:56 +00:00
akr
40d985b57b declare rb_gc_abort_threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-29 17:11:28 +00:00
nobu
d5639df795 * eval.c (rb_gc_mark_threads): leave unmarked threads which won't wake
up alone, and mark threads in the loading table.  [ruby-dev:28154]

* eval.c (rb_gc_abort_threads), gc.c (gc_sweep): kill unmarked
  threads.  [ruby-dev:28172]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-29 15:00:15 +00:00
nobu
89eb20764e * eval.c (rb_eval), gc.c (gc_mark_children), node.h (NEW_ALIAS,
NEW_VALIAS), parse.y (fitem): allow dynamic symbols to
  NODE_UNDEF and NODE_ALIAS.
  backported from trunk.  fixed: [ruby-dev:28105]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-26 13:33:14 +00:00
akr
bd0d0153a0 revert previous change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-16 04:58:51 +00:00
akr
65139d80fe refine "unknown data type" message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-16 04:49:46 +00:00
akr
f7d72f1e65 precedes registering global VALUE variables before initializing it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-12 03:36:49 +00:00
nobu
fa50f60316 * eval.c, gc.c, time.c: made internal symbols static. [ruby-dev:27435]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-18 17:36:20 +00:00
nobu
3b4216d2b5 * parse.y (rb_parser_malloc, rb_parser_free): manage parser stack on
heap.  [ruby-list:41199]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-08 09:57:12 +00:00
matz
38d5918439 * gc.c (obj_free): make message formant consistent with one from
gc_mark().  [ruby-talk:149668]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-07-27 14:29:13 +00:00
matz
a12c1e4bd2 revered all LLP64 modifies due to portability reason.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-07-27 03:07:02 +00:00
matz
f933f9d3a5 * gc.c (id2ref): must not assign pointers to long int. use
LONG_LONG instead if SIZEOF_LONG < SIZEOF_VOIDP.
  [ruby-talk:149645]

* ruby.h: use LONG_LONG to simplify the change.
  [ruby-talk:149645]

* eval.c (rb_f_throw): replace all '0x%lx' by '%p'.
  [ruby-talk:149553]

* missing/vsnprintf.c (BSD_vfprintf): '%p' need to handle 64bit
  size pointer.  [ruby-talk:149553]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-07-27 02:42:16 +00:00
nobu
150b98fd76 * gc.c (define_final): document fix: finalizers never get called
before target object is destroyed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-19 17:16:14 +00:00
nobu
4cee6b5a2b * gc.c (run_final): commit miss to add new variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-19 05:16:36 +00:00
nobu
cb2cf70aa1 * gc.c (run_final): reduce unnecessary object allocation during
finalization.

* gc.c (rb_gc_call_finalizer_at_exit): deferred finalizers list should
  be cleared before calling them.  fixed: [ruby-talk:145790]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-19 05:09:32 +00:00
akr
4456e39dc5 * eval.c (ruby_longjmp): new macro to call longjmp, setcontext, etc.
(ruby_setjmp): new macro to call setjmp, getcontext, etc.
  (ruby_setjmp): call setjmp before getcontext to avoid IA64 register
  stack problem.
  [ruby-talk:144939]

* gc.c (Init_stack): remove IA64_MAGIC_STACK_LIMIT.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-09 11:18:31 +00:00
matz
dcd87b140c * string.c (rb_str_new4): should propagate taintedness.
* struct.c (rb_struct_set): use original method name, not callee
  name, to retrieve member slot.  [ruby-core:04268]

* time.c (time_strftime): protect from format modification from GC
  finalizers.

* gc.c (rb_data_object_alloc): klass may be NULL.
  [ruby-list:40498]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-01-20 09:34:36 +00:00
akr
b9f527fd6d * gc.c (mark_locations_array): avoid core dump with -O3.
[ruby-dev:25424]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-01-07 09:08:19 +00:00
akr
6afa7415c7 gcc noinline attribute is available since gcc-3.1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-20 13:55:00 +00:00
akr
293534986f * gc.c (stack_end_address): new function to obtain stack end address.
stack_end_address calls __builtin_frame_address(0) to obtain the
  frame pointer of a stack frame of stack_end_address.  The address
  is the stack pointer of the caller's stack frame.
  (SET_STACK_END): use stack_end_address.
  This makes the conservative garbage collector to scan a stack frame
  of the garbage_collect function itself.  This is required because
  callee-save registers may be stored in the frame.
  [ruby-dev:25158]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-13 09:58:12 +00:00
matz
8afd99d671 * string.c (rb_str_locktmp): check STR_TMPLOCK flag before
locking.  [ruby-dev:24727]

* gc.c (gc_mark): stricter GC stack check.

* string.c (str_gsub): should have removed rb_str_unlocktmp(str).
  [ruby-dev:24708]

* string.c (str_gsub): string modify check no longer based on
  tmplock.  [ruby-dev:24706]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-05 16:01:53 +00:00
matz
d55db6b999 * gc.c (gc_mark): enable GC stack checking.
* string.c (str_gsub): lock strings temporarily.  [ruby-dev:24687]

* ext/socket/socket.c (s_recvfrom): tmplock input buffer.
  [ruby-dev:24705]

* array.c (rb_ary_uniq_bang): do not push frozen string from hash
  table.  [ruby-dev:24695]

* array.c (rb_ary_and): ditto.

* array.c (rb_ary_or): ditto.

* ext/enumerator/enumerator.c (each_cons_i): pass copy of an
  internal consequent array.  [ruby-talk:118691]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-04 01:20:51 +00:00
matz
d329ced71d * gc.c: cancel IA64 changes unnecessary for 1.8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-02 03:55:04 +00:00
usa
b98389e436 * gc.c: prototype; rb_io_fptr_finalize() doesn't return any value
at this version.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-27 09:50:03 +00:00
matz
55ec8ed295 * gc.c (gc_sweep): recover ruby_in_compile variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-27 09:16:20 +00:00
matz
ece87af00c * string.c (RESIZE_CAPA): check string attribute before modifying
capacity member of string structure.  [ruby-dev:24594]

* ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain
  performance.  [ruby-talk:117701]

* sprintf.c (rb_f_sprintf): raise ArgumentError for extra
  arguments, unless (digit)$ style used.

* ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain
  performance.  [ruby-talk:117701]

* sprintf.c (rb_f_sprintf): raise ArgumentError for extra
  arguments, unless (digit)$ style used.

* eval.c (frame_free): Guy Decoux solved the leak problem.
  Thanks.  [ruby-core:03549]

* ext/zlib/zlib.c (zstream_append_input): clear klass for z->input
  to avoid potential vulnerability.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-27 02:46:54 +00:00
matz
2ec51ee0d5 * string.c (str_gsub): reentrant check. [ruby-dev:24432]
* backport all SEGV bug fixes from CVS HEAD.  [ruby-dev:24536]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-20 12:47:20 +00:00
matz
0dab65c00f * gc.c (run_final): wrong order of data. [ruby-dev:23948]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-27 16:07:58 +00:00
matz
adac65af93 * gc.c (define_final): should not disclose NODE* to Ruby world.
[ruby-dev:23957]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-23 07:52:38 +00:00
matz
6e918be6b1 * gc.c, parse.y, lib/cgi.rb, lib/date.rb: last minute backports from HEAD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-14 14:22:11 +00:00
nobu
4c20725d55 * eval.c (rb_eval_cmd, rb_thread_trap_eval): restore safe level.
* gc.c (define_final, run_final): preserve and restore safe level for
  finalizers.  [ruby-core:03058]

* signal.c (signal_exec, rb_trap_exit, trap): preserve and restore
  safe level for signal handlers.  [ruby-dev:23829]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-06-29 01:31:37 +00:00
matz
68a117d8e2 * eval.c (rb_thread_atfork): remove "fork terminates thread"
warning.  [ruby-dev:

* object.c (rb_obj_clone): backport FL_FINALIZE patch from 1.9.
  [ruby-core:02786][ruby-core:03067]

* ext/socket/socket.c (sock_sockaddr): Socket#gethostbyname()
  should give us packed address, not struct sockaddr.
  [ruby-core:03053]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-06-24 23:31:29 +00:00
nobu
35ec0ad3f3 * gc.c (stack_grow_direction): memoize the direction.
* gc.c (Init_stack): should always move to end of VALUE.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-06-16 07:01:32 +00:00
nobu
69ad78e282 * gc.c (rb_gc_copy_finalizer): typo. [ruby-core:02774]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-12 10:11:34 +00:00
dave
1b0b3ec338 Add RDoc comments
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-22 06:20:14 +00:00
matz
6228cbe5ef dln.c: remove last second typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-20 16:59:09 +00:00
matz
6a3f682ff7 * eval.c (thread_timer): use timer by sub-thread and nanosleep.
[ruby-talk:87519]

* gc.c (Init_stack): no stack adjustment for THREAD_SAFE.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-13 09:13:39 +00:00
matz
f449c04a36 * io.c (read_all): should return given string even if data read is
empty.  [ruby-dev:22207]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-10 08:26:36 +00:00
matz
5eaf7e5816 * gc.c (gc_mark): explicitly check mark recursion levels, instead
of unreliable stack length.

* file.c (path_check_1): honor sticky bits always.
  [ruby-talk:86273]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-28 14:23:33 +00:00
knu
868d5ba485 * eval.c, gc.c: FreeBSD/ia64 currently does not have a way for a
process to get the base address for the RSE backing store, so
  hardcode it for the moment.
  [submitted by: Marcel Moolenaar <marcel@FreeBSD.org>]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-27 13:08:27 +00:00
matz
6212cfb9c5 * gc.c (Init_stack): stack region is far smaller than usual if
pthread is used.

* marshal.c (w_extended): singleton methods should not be checked
  when dumping via marshal_dump() or _dump(). [ruby-talk:85909]

* file.c (getcwdofdrv): avoid using getcwd() directly, use
  my_getcwd() instead.

* merged NeXT, OpenStep, Rhapsody ports patch from Eric Sunshine
  <sunshine@sunshineco.com>.  [ruby-core:01596]

* marshal.c (w_object): LINK check earlier than anything else,
  i.e. do not dump TYPE_IVAR for already dumped objects.
  (ruby-bugs PR#1220)

* eval.c (rb_eval): call "inherited" only when a new class is
  generated; not on reopening.

* eval.c (eval): prepend error position in evaluating string to

* configure.in: revived NextStep, OpenStep, and Rhapsody ports which
  had become unbuildable; enhanced --enable-fat-binary option so that
  it accepts a list of desired architectures (rather than assuming a
  fixed list), or defaults to a platform-appropriate list if user does
  not provide an explicit list; made the default list of architectures
  for MAB (fat binary) more comprehensive; now uses -fno-common even
  when building the interpreter (in addition to using it for
  extensions), thus allowing the interpreter to be embedded into a
  plugin module of an external project (in addition to allowing
  embedding directly into an application); added checks for
  <netinet/in_systm.h> (needed by `socket' extension) and getcwd(); now
  ensures that -I/usr/local/include is employed when extensions'
  extconf.rb scripts invoke have_header() since extension checks on
  NextStep and OpenStep will fail without it if the desired resource
  resides in the /usr/local tree; fixed formatting of --help message.

* Makefile.in: $(LIBRUBY_A) rule now deletes the archive before
  invoking $(AR) since `ar' on Apple/NeXT can not "update" MAB archives
  (see configure's --enable-fat-binary option); added rule for new
  missing/getcwd.c.

* defines.h: fixed endian handling during MAB build (see configure's
  --enable-fat-binary option) to ensure that all portions of the
  project see the correct WORDS_BIGENDIAN value (some extension modules
  were getting the wrong endian setting); added missing constants
  GETPGRP_VOID, WNOHANG, WUNTRACED, X_OK, and type pid_t for NextStep
  and OpenStep; removed unnecessary and problematic HAVE_SYS_WAIT_H
  define in NeXT section.

* dir.c: do not allow NAMLEN() macro to trust dirent::d_namlen on
  NextStep since, on some installations, this value always resolves
  uselessly to zero.

* dln.c: added error reporting to NextStep extension loader since the
  previous behavior of failing silently was not useful; now ensures
  that NSLINKMODULE_OPTION_BINDNOW compatibility constant is defined
  for OpenStep and Rhapsody; no longer includes <mach-o/dyld.h> twice
  on Rhapsody since this header lacks multiple-include protection,
  which resulted in "redefinition" compilation errors.

* main.c: also create hard reference to objc_msgSend() on NeXT
  platforms (in addition to Apple platforms).

* lib/mkmf.rb: now exports XCFLAGS from configure script to extension
  makefiles so that extensions can be built MAB (see configure's
  --enable-fat-binary option); also utilize XCFLAGS in cc_command()
  (but not cpp_command() because MAB flags are incompatible with
  direct invocation of `cpp').

* ext/curses/extconf.rb: now additionally checks for presence of these
  curses functions which are not present on NextStep or Openstep:
  bkgd(), bkgdset(), color(), curs(), getbkgd(), init(), scrl(), set(),
  setscrreg(), wattroff(), wattron(), wattrset(), wbkgd(), wbkgdset(),
  wscrl(), wsetscrreg()

* ext/curses/curses.c: added appropriate #ifdef's for additional set of
  curses functions now checked by extconf.rb; fixed curses_bkgd() and
  window_bkgd() to correctly return boolean result rather than numeric
  result; fixed window_getbkgd() to correctly signal an error by
  returning nil rather than -1.

* ext/etc/etc.c: setup_passwd() and setup_group() now check for null
  pointers before invoking rb_tainted_str_new2() upon fields extracted
  from `struct passwd' and `struct group' since null pointers in some
  fields are common on NextStep/OpenStep (especially so for the
  `pw_comment' field) and rb_tainted_str_new2() throws an exception
  when it receives a null pointer.

* ext/pty/pty.c: include "util.h" for strdup()/ruby_strdup() for
  platforms such as NextStep and OpenStep which lack strdup().

* ext/socket/getaddrinfo.c: cast first argument of getservbyname(),
  gethostbyaddr(), and gethostbyname() from (const char*) to non-const
  (char*) for older platforms such as NextStep and OpenStep.

* ext/socket/socket.c: include "util.h" for strdup()/ruby_strdup() for
  platforms such as NextStep and OpenStep which lack strdup(); include
  <netinet/in_systm.h> if present for NextStep and OpenStep; cast first
  argument of gethostbyaddr() and getservbyname() from (const char*) to
  non-const (char*) for older platforms.

* ext/syslog/syslog.c: include "util.h" for strdup()/ruby_strdup() for
  platforms such as NextStep and OpenStep which lack strdup().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-22 04:00:03 +00:00