[macruby-changes] [5134] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Fri Jan 7 17:03:32 PST 2011


Revision: 5134
          http://trac.macosforge.org/projects/ruby/changeset/5134
Author:   lsansonetti at apple.com
Date:     2011-01-07 17:03:28 -0800 (Fri, 07 Jan 2011)
Log Message:
-----------
start cleaning up the public header files

Modified Paths:
--------------
    MacRuby/trunk/dir.c
    MacRuby/trunk/dln.c
    MacRuby/trunk/env.c
    MacRuby/trunk/ext/socket/socket.c
    MacRuby/trunk/file.c
    MacRuby/trunk/include/ruby/defines.h
    MacRuby/trunk/include/ruby/encoding.h
    MacRuby/trunk/include/ruby/intern.h
    MacRuby/trunk/include/ruby/io.h
    MacRuby/trunk/include/ruby/macruby.h
    MacRuby/trunk/include/ruby/missing.h
    MacRuby/trunk/include/ruby/mvm.h
    MacRuby/trunk/include/ruby/node.h
    MacRuby/trunk/include/ruby/objc.h
    MacRuby/trunk/include/ruby/re.h
    MacRuby/trunk/include/ruby/ruby.h
    MacRuby/trunk/include/ruby/signal.h
    MacRuby/trunk/include/ruby/st.h
    MacRuby/trunk/include/ruby/util.h
    MacRuby/trunk/marshal.c
    MacRuby/trunk/object.c
    MacRuby/trunk/parse.y
    MacRuby/trunk/process.c
    MacRuby/trunk/signal.c
    MacRuby/trunk/time.c
    MacRuby/trunk/variable.c

Modified: MacRuby/trunk/dir.c
===================================================================
--- MacRuby/trunk/dir.c	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/dir.c	2011-01-08 01:03:28 UTC (rev 5134)
@@ -746,7 +746,7 @@
 
     if (rb_block_given_p()) {
 	struct chdir_data args;
-	VALUE cwd = my_getcwd();
+	VALUE cwd = ruby_getcwd();
 
 	args.old_path = cwd;
 	GC_RETAIN(args.old_path);
@@ -774,7 +774,7 @@
 dir_s_getwd(VALUE dir, SEL sel)
 {
     rb_secure(4);
-    return my_getcwd();
+    return ruby_getcwd();
 }
 
 static void

Modified: MacRuby/trunk/dln.c
===================================================================
--- MacRuby/trunk/dln.c	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/dln.c	2011-01-08 01:03:28 UTC (rev 5134)
@@ -25,6 +25,9 @@
 
 #define FUNCNAME_PATTERN "Init_%s"
 
+// In file.c
+int eaccess(const char *path, int mode);
+
 static int
 init_funcname_len(char **buf, const char *file)
 {

Modified: MacRuby/trunk/env.c
===================================================================
--- MacRuby/trunk/env.c	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/env.c	2011-01-08 01:03:28 UTC (rev 5134)
@@ -150,8 +150,6 @@
 void
 ruby_setenv(const char *name, const char *value)
 {
-#undef setenv
-#undef unsetenv
     if (value != NULL) {
 	setenv(name, value, 1);
     }

Modified: MacRuby/trunk/ext/socket/socket.c
===================================================================
--- MacRuby/trunk/ext/socket/socket.c	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/ext/socket/socket.c	2011-01-08 01:03:28 UTC (rev 5134)
@@ -522,15 +522,11 @@
     rb_thread_fd_writable(fd);
   retry:
     if (!NIL_P(to)) {
-        TRAP_BEG;
 	n = sendto(fd, RSTRING_PTR(mesg), RSTRING_LEN(mesg), NUM2INT(flags),
 		   (struct sockaddr*)RSTRING_PTR(to), RSTRING_LEN(to));
-        TRAP_END;
     }
     else {
-        TRAP_BEG;
 	n = send(fd, RSTRING_PTR(mesg), RSTRING_LEN(mesg), NUM2INT(flags));
-        TRAP_END;
     }
     if (n < 0) {
 	if (rb_io_wait_writable(fd)) {
@@ -611,10 +607,8 @@
     if (rb_bstr_length(str) != buflen) {
 	rb_raise(rb_eRuntimeError, "buffer string modified");
     }
-    TRAP_BEG;
     slen = recvfrom(fd, rb_bstr_bytes(str), buflen, flags,
 	    (struct sockaddr *)buf, &alen);
-    TRAP_END;
 
     if (slen < 0) {
 	if (rb_io_wait_readable(fd)) {
@@ -1477,9 +1471,7 @@
 #if defined(_nec_ews)
     fd2 = accept(fd, sockaddr, len);
 #else
-    TRAP_BEG;
     fd2 = accept(fd, sockaddr, len);
-    TRAP_END;
 #endif
     if (fd2 < 0) {
 	switch (errno) {

Modified: MacRuby/trunk/file.c
===================================================================
--- MacRuby/trunk/file.c	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/file.c	2011-01-08 01:03:28 UTC (rev 5134)
@@ -2537,7 +2537,7 @@
         }
     }
 
-    curdir = my_getcwd();
+    curdir = ruby_getcwd();
     ptr = (char *)RSTRING_PTR(curdir);
     curdir_names = skiproot(ptr);
     resolved = rb_str_new(ptr, curdir_names - ptr);
@@ -3953,7 +3953,7 @@
     char *p = 0, *s;
 
     if (!is_absolute_path(p0)) {
-	VALUE newpath = my_getcwd();
+	VALUE newpath = ruby_getcwd();
 	rb_str_cat2(newpath, "/");
 	rb_str_cat2(newpath, p0);
 	path = newpath;

Modified: MacRuby/trunk/include/ruby/defines.h
===================================================================
--- MacRuby/trunk/include/ruby/defines.h	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/include/ruby/defines.h	2011-01-08 01:03:28 UTC (rev 5134)
@@ -1,21 +1,16 @@
-/************************************************
+/*
+ * This file is covered by the Ruby license. See COPYING for more details.
+ *
+ * Copyright (C) 2007-2010, Apple Inc. All rights reserved
+ * Copyright (C) 1993-2007 Yukihiro Matsumoto
+ */ 
 
-  defines.h -
-
-  $Author: nobu $
-  created at: Wed May 18 00:21:44 JST 1994
-
-************************************************/
-
 #ifndef RUBY_DEFINES_H
 #define RUBY_DEFINES_H 1
 
 #if defined(__cplusplus)
 extern "C" {
-#if 0
-} /* satisfy cc-mode */
 #endif
-#endif
 
 #define RUBY
 
@@ -108,17 +103,6 @@
 # define BDIGIT_DBL_SIGNED long
 #endif
 
-#ifdef __CYGWIN__
-#undef _WIN32
-#endif
-
-#if defined(MSDOS) || defined(_WIN32) || defined(__human68k__) || defined(__EMX__)
-#define DOSISH 1
-#ifndef _WIN32_WCE
-# define DOSISH_DRIVE_LETTER
-#endif
-#endif
-
 #if defined(__NeXT__) || defined(__APPLE__)
 /* Do not trust WORDS_BIGENDIAN from configure since -arch compiler flag may
    result in a different endian.  Instead trust __BIG_ENDIAN__ and
@@ -129,98 +113,16 @@
 #endif
 #endif
 
-#ifdef __NeXT__
-/* NextStep, OpenStep, Rhapsody */
-#ifndef S_IRUSR
-#define S_IRUSR 0000400        /* read permission, owner */
-#endif
-#ifndef S_IRGRP
-#define S_IRGRP 0000040        /* read permission, group */
-#endif
-#ifndef S_IROTH
-#define S_IROTH 0000004        /* read permission, other */
-#endif
-#ifndef S_IWUSR
-#define S_IWUSR 0000200        /* write permission, owner */
-#endif
-#ifndef S_IWGRP
-#define S_IWGRP 0000020        /* write permission, group */
-#endif
-#ifndef S_IWOTH
-#define S_IWOTH 0000002        /* write permission, other */
-#endif
-#ifndef S_IXUSR
-#define S_IXUSR 0000100        /* execute/search permission, owner */
-#endif
-#ifndef S_IXGRP
-#define S_IXGRP 0000010        /* execute/search permission, group */
-#endif
-#ifndef S_IXOTH
-#define S_IXOTH 0000001        /* execute/search permission, other */
-#endif
-#ifndef S_IRWXU
-#define S_IRWXU 0000700        /* read, write, execute permissions, owner */
-#endif
-#ifndef S_IRWXG
-#define S_IRWXG 0000070        /* read, write, execute permissions, group */
-#endif
-#ifndef S_IRWXO
-#define S_IRWXO 0000007        /* read, write, execute permissions, other */
-#endif
-#ifndef S_ISBLK
-#define S_ISBLK(mode)  (((mode) & (0170000)) == (0060000))
-#endif
-#ifndef S_ISCHR
-#define S_ISCHR(mode)  (((mode) & (0170000)) == (0020000))
-#endif
-#ifndef S_ISDIR
-#define S_ISDIR(mode)  (((mode) & (0170000)) == (0040000))
-#endif
-#ifndef S_ISFIFO
-#define S_ISFIFO(mode) (((mode) & (0170000)) == (0010000))
-#endif
-#ifndef S_ISREG
-#define S_ISREG(mode)  (((mode) & (0170000)) == (0100000))
-#endif
-#ifndef __APPLE__
-/* NextStep, OpenStep (but not Rhapsody) */
-#ifndef GETPGRP_VOID
-#define GETPGRP_VOID 1
-#endif
-#ifndef WNOHANG
-#define WNOHANG 01
-#endif
-#ifndef WUNTRACED
-#define WUNTRACED 02
-#endif
-#ifndef X_OK
-#define X_OK 1
-#endif
-#endif /* __APPLE__ */
-#endif /* NeXT */
-
-#ifdef _WIN32
-#include "ruby/win32.h"
-#endif
-
-#if defined(__VMS)
-#include "vms/vms.h"
-#endif
-
-#if defined(__BEOS__)
-#include <net/socket.h> /* intern.h needs fd_set definition */
-#endif
-
 #ifdef RUBY_EXPORT
-#undef RUBY_EXTERN
+# undef RUBY_EXTERN
 #endif
 
 #ifndef RUBY_EXTERN
-#define RUBY_EXTERN extern
+# define RUBY_EXTERN extern
 #endif
 
 #ifndef EXTERN
-#define EXTERN RUBY_EXTERN	/* deprecated */
+# define EXTERN RUBY_EXTERN	/* deprecated */
 #endif
 
 #ifndef RUBY_MBCHAR_MAXSIZE
@@ -228,76 +130,27 @@
         /* MB_CUR_MAX will not work well in C locale */
 #endif
 
-#if defined(sparc) || defined(__sparc__)
-static inline void
-flush_register_windows(void)
-{
-    asm
-#ifdef __GNUC__
-	volatile
-#endif
-# if defined(__sparc_v9__) || defined(__sparcv9) || defined(__arch64__)
-	("flushw")
-# else
-	("ta 0x03")
-# endif /* trap always to flush register windows if we are on a Sparc system */
-	;
-}
-#  define FLUSH_REGISTER_WINDOWS flush_register_windows()
-#elif defined(__ia64)
-void *rb_ia64_bsp(void);
-void rb_ia64_flushrs(void);
-#  define FLUSH_REGISTER_WINDOWS rb_ia64_flushrs()
-#else
-#  define FLUSH_REGISTER_WINDOWS ((void)0)
-#endif
-
-#if defined(DOSISH)
-#define PATH_SEP ";"
-#elif defined(riscos)
-#define PATH_SEP ","
-#else
 #define PATH_SEP ":"
-#endif
 #define PATH_SEP_CHAR PATH_SEP[0]
-
-#if defined(__human68k__)
-#define PATH_ENV "path"
-#else
 #define PATH_ENV "PATH"
-#endif
 
-#if defined(DOSISH) && !defined(__human68k__) && !defined(__EMX__)
-#define ENV_IGNORECASE
-#endif
+#define CASEFOLD_FILESYSTEM 0
 
-#ifndef CASEFOLD_FILESYSTEM
-# if defined DOSISH || defined __VMS
-#   define CASEFOLD_FILESYSTEM 1
-# else
-#   define CASEFOLD_FILESYSTEM 0
-# endif
-#endif
-
 #ifndef DLEXT_MAXLEN
-#define DLEXT_MAXLEN 4
+# define DLEXT_MAXLEN 4
 #endif
 
 #ifndef RUBY_PLATFORM
-#define RUBY_PLATFORM "unknown-unknown"
+# define RUBY_PLATFORM "unknown-unknown"
 #endif
 
-#define WITH_OBJC 1 /* TODO: this should be set by configure */
+#define WITH_OBJC 1
+#define __MACRUBY__ 1
 
 #define force_inline __attribute__((always_inline))
 
-#define __MACRUBY__ 1
-
 #if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
+} // extern "C" {
 #endif
-}  /* extern "C" { */
-#endif
 
 #endif /* RUBY_DEFINES_H */

Modified: MacRuby/trunk/include/ruby/encoding.h
===================================================================
--- MacRuby/trunk/include/ruby/encoding.h	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/include/ruby/encoding.h	2011-01-08 01:03:28 UTC (rev 5134)
@@ -1,14 +1,10 @@
-/**********************************************************************
+/*
+ * This file is covered by the Ruby license. See COPYING for more details.
+ *
+ * Copyright (C) 2007-2010, Apple Inc. All rights reserved
+ * Copyright (C) 2007 Yukihiro Matsumoto
+ */
 
-  encoding.h -
-
-  $Author: matz $
-  created at: Thu May 24 11:49:41 JST 2007
-
-  Copyright (C) 2007 Yukihiro Matsumoto
-
-**********************************************************************/
-
 #ifndef RUBY_ENCODING_H
 #define RUBY_ENCODING_H 1
 
@@ -20,8 +16,6 @@
 
 typedef struct rb_encoding rb_encoding;
 
-int rb_enc_replicate(const char *, rb_encoding *);
-int rb_define_dummy_encoding(const char *);
 int rb_enc_get_index(VALUE obj);
 void rb_enc_set_index(VALUE obj, int encindex);
 int rb_enc_find_index(const char *name);
@@ -31,19 +25,13 @@
 int rb_usascii_encindex(void);
 rb_encoding* rb_to_encoding(VALUE);
 rb_encoding* rb_enc_get(VALUE);
-rb_encoding* rb_enc_compatible(VALUE,VALUE);
-rb_encoding* rb_enc_check(VALUE,VALUE);
 VALUE rb_enc_associate_index(VALUE, int);
 VALUE rb_enc_associate(VALUE, rb_encoding*);
 VALUE rb_str_export_to_enc(VALUE str, rb_encoding *enc);
-void rb_enc_copy(VALUE dst, VALUE src);
 
 VALUE rb_enc_str_new(const char*, long, rb_encoding*);
-VALUE rb_enc_reg_new(const char*, long, rb_encoding*, int);
 PRINTF_ARGS(VALUE rb_enc_sprintf(rb_encoding *, const char*, ...), 2, 3);
 VALUE rb_enc_vsprintf(rb_encoding *, const char*, va_list);
-long rb_enc_strlen(const char*, const char*, rb_encoding*);
-char* rb_enc_nth(const char*, const char*, int, rb_encoding*);
 VALUE rb_enc_str_buf_cat(VALUE str, const char *ptr, long len, rb_encoding *enc);
 
 /* index -> rb_encoding */
@@ -60,39 +48,6 @@
 long rb_enc_mbminlen(rb_encoding *);
 long rb_enc_mbmaxlen(rb_encoding *);
 
-/* -> mbclen (no error notification: 0 < ret <= e-p, no exception) */
-int rb_enc_mbclen(const char *p, const char *e, rb_encoding *enc);
-
-/* -> chlen, invalid or needmore */
-int rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc);
-#define MBCLEN_CHARFOUND_P(ret)     ONIGENC_MBCLEN_CHARFOUND_P(ret)
-#define MBCLEN_CHARFOUND_LEN(ret)     ONIGENC_MBCLEN_CHARFOUND_LEN(ret)
-#define MBCLEN_INVALID_P(ret)       ONIGENC_MBCLEN_INVALID_P(ret)
-#define MBCLEN_NEEDMORE_P(ret)      ONIGENC_MBCLEN_NEEDMORE_P(ret)
-#define MBCLEN_NEEDMORE_LEN(ret)      ONIGENC_MBCLEN_NEEDMORE_LEN(ret)
-
-/* -> 0x00..0x7f, -1 */
-int rb_enc_ascget(const char *p, const char *e, int *len, rb_encoding *enc);
-
-/* -> code or raise exception */
-int rb_enc_codepoint(const char *p, const char *e, rb_encoding *enc);
-#define rb_enc_mbc_to_codepoint(p, e, enc) ONIGENC_MBC_TO_CODE(enc,(UChar*)(p),(UChar*)(e))
-
-/* -> codelen>0 or raise exception */
-int rb_enc_codelen(int code, rb_encoding *enc);
-
-/* code,ptr,encoding -> write buf */
-#define rb_enc_mbcput(c,buf,enc) ONIGENC_CODE_TO_MBC(enc,c,(UChar*)(buf))
-
-/* ptr, ptr, encoding -> prev_char */
-#define rb_enc_prev_char(s,p,enc) (char *)onigenc_get_prev_char_head(enc,(UChar*)(s),(UChar*)(p))
-/* ptr, ptr, encoding -> next_char */
-#define rb_enc_left_char_head(s,p,enc) (char *)onigenc_get_left_adjust_char_head(enc,(UChar*)(s),(UChar*)(p))
-#define rb_enc_right_char_head(s,p,enc) (char *)onigenc_get_right_adjust_char_head(enc,(UChar*)(s),(UChar*)(p))
-
-/* ptr, ptr, encoding -> newline_or_not */
-#define rb_enc_is_newline(p,end,enc)  ONIGENC_IS_MBC_NEWLINE(enc,(UChar*)(p),(UChar*)(end))
-
 #include <wctype.h>
 
 #define rb_enc_isctype(c,t,enc)	(iswctype(c,t))
@@ -106,17 +61,9 @@
 #define rb_enc_isdigit(c,enc)	(iswdigit(c))
 
 #define rb_enc_asciicompat(enc) (rb_enc_mbminlen(enc)==1 && !rb_enc_dummy_p(enc))
+#define rb_enc_str_asciicompat_p(str) rb_enc_asciicompat(rb_enc_get(str))
 
-int rb_enc_casefold(char *to, const char *p, const char *e, rb_encoding *enc);
-int rb_enc_toupper(int c, rb_encoding *enc);
-int rb_enc_tolower(int c, rb_encoding *enc);
 ID rb_intern3(const char*, long, rb_encoding*);
-ID rb_interned_id_p(const char *, long, rb_encoding *);
-int rb_enc_symname_p(const char*, rb_encoding*);
-int rb_enc_str_coderange(VALUE);
-long rb_str_coderange_scan_restartable(const char*, const char*, rb_encoding*, int*);
-int rb_enc_str_asciionly_p(VALUE);
-#define rb_enc_str_asciicompat_p(str) rb_enc_asciicompat(rb_enc_get(str))
 VALUE rb_enc_from_encoding(rb_encoding *enc);
 rb_encoding *rb_ascii8bit_encoding(void);
 rb_encoding *rb_utf8_encoding(void);
@@ -126,26 +73,23 @@
 rb_encoding *rb_default_internal_encoding(void);
 int rb_usascii_encindex(void);
 int rb_ascii8bit_encindex(void);
-VALUE rb_enc_default_external(void);
 void rb_enc_set_default_external(VALUE encoding);
-long rb_memsearch(const void*,long,const void*,long,rb_encoding*);
 
 RUBY_EXTERN VALUE rb_cEncoding;
 
 static inline int
 rb_enc_dummy_p(rb_encoding *enc)
 {
-    // TODO
     return Qfalse;
 }
 
 VALUE rb_str_transcode(VALUE str, VALUE to);
 
-// MRI compat.
+// CRuby compat.
 #define rb_external_str_new_with_enc rb_enc_str_new
 
 #if defined(__cplusplus)
-}
+} // extern "C" {
 #endif
 
 #endif /* RUBY_ENCODING_H */

Modified: MacRuby/trunk/include/ruby/intern.h
===================================================================
--- MacRuby/trunk/include/ruby/intern.h	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/include/ruby/intern.h	2011-01-08 01:03:28 UTC (rev 5134)
@@ -1,35 +1,25 @@
-/**********************************************************************
+/*
+ * This file is covered by the Ruby license. See COPYING for more details.
+ *
+ * Copyright (C) 2007-2010, Apple Inc. All rights reserved
+ * Copyright (C) 1993-2007 Yukihiro Matsumoto
+ * Copyright (C) 2000  Network Applied Communication Laboratory, Inc.
+ * Copyright (C) 2000  Information-technology Promotion Agency, Japan
+ */
 
-  intern.h -
-
-  $Author: nobu $
-  created at: Thu Jun 10 14:22:17 JST 1993
-
-  Copyright (C) 1993-2007 Yukihiro Matsumoto
-  Copyright (C) 2000  Network Applied Communication Laboratory, Inc.
-  Copyright (C) 2000  Information-technology Promotion Agency, Japan
-
-**********************************************************************/
-
 #ifndef RUBY_INTERN_H
 #define RUBY_INTERN_H 1
 
 #if defined(__cplusplus)
 extern "C" {
-#if 0
-} /* satisfy cc-mode */
 #endif
-#endif
 
-#ifdef HAVE_STDARG_PROTOTYPES
-# include <stdarg.h>
-#else
-# include <varargs.h>
-#endif
+#include <stdarg.h>
+
 #if RUBY_INCLUDED_AS_FRAMEWORK
-#include <MacRuby/ruby/st.h>
+# include <MacRuby/ruby/st.h>
 #else
-#include <ruby/st.h>
+# include <ruby/st.h>
 #endif
 
 /* 
@@ -75,6 +65,7 @@
 VALUE rb_get_values_at(VALUE, long, int, VALUE*, VALUE(*)(VALUE,long));
 void rb_ary_insert(VALUE, long, VALUE);
 VALUE rb_ary_equal(VALUE, VALUE);
+
 /* bignum.c */
 VALUE rb_big_clone(VALUE);
 void rb_big_2comp(VALUE);
@@ -116,6 +107,7 @@
 VALUE rb_big_lshift(VALUE, VALUE);
 VALUE rb_big_rshift(VALUE, VALUE);
 VALUE rb_big_uminus(VALUE x);
+
 /* rational.c */
 VALUE rb_rational_raw(VALUE, VALUE);
 #define rb_rational_raw1(x) rb_rational_raw(x, INT2FIX(1))
@@ -126,6 +118,7 @@
 VALUE rb_Rational(VALUE, VALUE);
 #define rb_Rational1(x) rb_Rational(x, INT2FIX(1))
 #define rb_Rational2(x,y) rb_Rational(x, y)
+
 /* complex.c */
 VALUE rb_complex_raw(VALUE, VALUE);
 #define rb_complex_raw1(x) rb_complex_raw(x, INT2FIX(0))
@@ -136,11 +129,10 @@
 VALUE rb_Complex(VALUE, VALUE);
 #define rb_Complex1(x) rb_Complex(x, INT2FIX(0))
 #define rb_Complex2(x,y) rb_Complex(x, y)
+
 /* class.c */
 VALUE rb_class_boot(VALUE);
 VALUE rb_class_new(VALUE);
-//VALUE rb_mod_init_copy(VALUE, VALUE);
-//VALUE rb_class_init_copy(VALUE, VALUE);
 VALUE rb_singleton_class_clone(VALUE);
 void rb_singleton_class_attached(VALUE,VALUE);
 VALUE rb_make_metaclass(VALUE, VALUE);
@@ -150,14 +142,8 @@
 VALUE rb_module_new(void);
 VALUE rb_define_module_id(ID);
 VALUE rb_mod_included_modules(VALUE);
-//VALUE rb_mod_include_p(VALUE, VALUE);
 VALUE rb_mod_ancestors(VALUE);
 VALUE rb_mod_ancestors_nocopy(VALUE);
-//VALUE rb_class_instance_methods(int, VALUE*, VALUE);
-//VALUE rb_class_public_instance_methods(int, VALUE*, VALUE);
-//VALUE rb_class_protected_instance_methods(int, VALUE*, VALUE);
-//VALUE rb_class_private_instance_methods(int, VALUE*, VALUE);
-//VALUE rb_obj_singleton_methods(int, VALUE*, VALUE);
 void rb_define_method_id(VALUE, ID, VALUE (*)(ANYARGS), int);
 void rb_frozen_class_p(VALUE);
 void rb_undef(VALUE, ID);
@@ -165,17 +151,19 @@
 void rb_define_private_method(VALUE, const char*, VALUE (*)(ANYARGS), int);
 void rb_define_singleton_method(VALUE, const char*, VALUE(*)(ANYARGS), int);
 VALUE rb_singleton_class(VALUE);
+
 /* compar.c */
 int rb_cmpint(VALUE, VALUE, VALUE);
 NORETURN(void rb_cmperr(VALUE, VALUE));
 VALUE rb_objs_cmp(VALUE x, VALUE y);
+
 /* cont.c */
 VALUE rb_fiber_new(VALUE (*)(ANYARGS), VALUE);
 VALUE rb_fiber_resume(VALUE fib, int argc, VALUE *args);
 VALUE rb_fiber_yield(int argc, VALUE *args);
 VALUE rb_fiber_current(void);
 VALUE rb_fiber_alive_p(VALUE);
-/* enum.c */
+
 /* error.c */
 VALUE rb_exc_new(VALUE, const char*, long);
 VALUE rb_exc_new2(VALUE, const char*);
@@ -189,12 +177,13 @@
 NORETURN(void rb_load_fail(const char*));
 NORETURN(void rb_error_frozen(const char*));
 void rb_check_frozen(VALUE);
+
 /* eval.c */
 VALUE rb_make_exception(int, VALUE *);
 int rb_sourceline(void);
 const char *rb_sourcefile(void);
 
-#if defined(NFDBITS) && defined(HAVE_RB_FD_INIT)
+#include <sys/types.h>
 typedef struct {
     int maxfd;
     fd_set *fdset;
@@ -212,22 +201,6 @@
 #define rb_fd_ptr(f)	((f)->fdset)
 #define rb_fd_max(f)	((f)->maxfd)
 
-#else
-
-typedef fd_set rb_fdset_t;
-#define rb_fd_zero(f)	FD_ZERO(f)
-#define rb_fd_set(n, f)	FD_SET(n, f)
-#define rb_fd_clr(n, f)	FD_CLR(n, f)
-#define rb_fd_isset(n, f) FD_ISSET(n, f)
-#define rb_fd_copy(d, s, n) (*(d) = *(s))
-#define rb_fd_ptr(f)	(f)
-#define rb_fd_init(f)	FD_ZERO(f)
-#define rb_fd_term(f)	(void)(f)
-#define rb_fd_max(f)	FD_SETSIZE
-#define rb_fd_select(n, rfds, wfds, efds, timeout)	select(n, rfds, wfds, efds, timeout)
-
-#endif
-
 NORETURN(void rb_exc_raise(VALUE));
 NORETURN(void rb_exc_fatal(VALUE));
 void rb_remove_method(VALUE, const char*);
@@ -290,6 +263,7 @@
 void rb_thread_atfork(void);
 void rb_thread_atfork_before_exec(void);
 VALUE rb_exec_recursive(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE);
+
 /* file.c */
 VALUE rb_file_expand_path(VALUE, VALUE);
 VALUE rb_file_absolute_path(VALUE, VALUE);
@@ -298,6 +272,7 @@
 VALUE rb_find_file(VALUE);
 #define rb_path_skip_prefix(path) (path)
 char *rb_path_end(const char *);
+
 /* gc.c */
 void ruby_set_stack_size(size_t);
 NORETURN(void rb_memerror(void));
@@ -308,9 +283,7 @@
 void rb_gc_copy_finalizer(VALUE,VALUE);
 void rb_gc_finalize_deferred(void);
 void rb_gc_call_finalizer_at_exit(void);
-//VALUE rb_gc_enable(void);
-//VALUE rb_gc_disable(void);
-//VALUE rb_gc_start(void);
+
 /* hash.c */
 void st_foreach_safe(struct st_table *, int (*)(ANYARGS), st_data_t);
 void rb_hash_foreach(VALUE, int (*)(ANYARGS), VALUE);
@@ -322,7 +295,6 @@
 VALUE rb_hash_aref(VALUE, VALUE);
 VALUE rb_hash_lookup(VALUE, VALUE);
 VALUE rb_hash_aset(VALUE, VALUE, VALUE);
-//VALUE rb_hash_delete_if(VALUE);
 VALUE rb_hash_delete(VALUE,VALUE);
 VALUE rb_hash_delete_key(VALUE,VALUE);
 VALUE rb_hash_has_key(VALUE hash, VALUE key);
@@ -334,6 +306,7 @@
 int rb_path_check(const char*);
 int rb_env_path_tainted(void);
 VALUE rb_env_clear(void);
+
 /* io.c */
 #define rb_defout rb_stdout
 RUBY_EXTERN VALUE rb_fs;
@@ -349,10 +322,12 @@
 void rb_write_error2(const char*, long);
 int rb_io_mode_modenum(const char *mode);
 void rb_close_before_exec(int lowfd, int maxhint, VALUE noclose_fds);
+
 /* marshal.c */
 VALUE rb_marshal_dump(VALUE, VALUE);
 VALUE rb_marshal_load(VALUE);
 void rb_marshal_define_compat(VALUE newclass, VALUE oldclass, VALUE (*dumper)(VALUE), VALUE (*loader)(VALUE, VALUE));
+
 /* numeric.c */
 void rb_num_zerodiv(void);
 VALUE rb_num_coerce_bin(VALUE, VALUE, ID);
@@ -364,6 +339,7 @@
 VALUE rb_fix_minus(VALUE x, VALUE y);
 VALUE rb_fix_uminus(VALUE num);
 VALUE rb_dbl_cmp(double, double);
+
 /* object.c */
 VALUE rb_send_dup(VALUE);
 int rb_eql(VALUE, VALUE);
@@ -374,7 +350,6 @@
 VALUE rb_obj_alloc(VALUE);
 VALUE rb_obj_clone(VALUE);
 VALUE rb_obj_dup(VALUE);
-//VALUE rb_obj_init_copy(VALUE,VALUE);
 VALUE rb_obj_taint(VALUE);
 VALUE rb_obj_tainted(VALUE);
 VALUE rb_obj_untaint(VALUE);
@@ -383,7 +358,6 @@
 VALUE rb_obj_untrusted(VALUE);
 VALUE rb_obj_freeze(VALUE);
 VALUE rb_obj_frozen_p(VALUE);
-//VALUE rb_obj_id(VALUE);
 VALUE rb_obj_class(VALUE);
 VALUE rb_class_inherited_p(VALUE, VALUE);
 VALUE rb_convert_type(VALUE,int,const char*,const char*);
@@ -397,6 +371,7 @@
 double rb_cstr_to_dbl(const char*, int);
 double rb_str_to_dbl(VALUE, int);
 VALUE rb_check_to_float(VALUE val);
+
 /* parse.y */
 RUBY_EXTERN int   ruby_sourceline;
 RUBY_EXTERN char *ruby_sourcefile;
@@ -415,6 +390,7 @@
 VALUE rb_lastline_get(void);
 void rb_lastline_set(VALUE);
 VALUE rb_sym_all_symbols(void);
+
 /* process.c */
 void rb_last_status_set(int status, rb_pid_t pid);
 VALUE rb_last_status_get(void);
@@ -437,13 +413,16 @@
 void rb_syswait(rb_pid_t pid);
 rb_pid_t rb_spawn(int, VALUE*);
 VALUE rb_detach_process(rb_pid_t pid);
+
 /* range.c */
 VALUE rb_range_new(VALUE, VALUE, int);
 VALUE rb_range_beg_len(VALUE, long*, long*, long, int);
 int rb_range_values(VALUE range, VALUE *begp, VALUE *endp, int *exclp);
+
 /* random.c */
 unsigned int rb_genrand_int32(void);
 double rb_genrand_real(void);
+
 /* re.c */
 VALUE rb_reg_compile(VALUE str, int options);
 VALUE rb_reg_check_preprocess(VALUE);
@@ -463,6 +442,7 @@
 int rb_reg_options(VALUE);
 void rb_set_kcode(const char*);
 const char* rb_get_kcode(void);
+
 /* ruby.c */
 #define rb_argv rb_get_argv()
 RUBY_EXTERN VALUE rb_argv0;
@@ -474,6 +454,7 @@
 void *ruby_process_options(int, char**);
 void ruby_init_loadpath(void);
 void ruby_incpush(const char*);
+
 /* signal.c */
 #ifdef POSIX_SIGNAL
 #define posix_signal ruby_posix_signal
@@ -484,11 +465,13 @@
 void rb_trap_exec(void);
 const char *ruby_signal_name(int);
 void ruby_default_signal(int);
+
 /* sprintf.c */
 VALUE rb_f_sprintf(int, const VALUE*);
 PRINTF_ARGS(VALUE rb_sprintf(const char*, ...), 1, 2);
 VALUE rb_vsprintf(const char*, va_list);
 VALUE rb_str_format(int, const VALUE *, VALUE);
+
 /* string.c */
 VALUE rb_str_new(const char*, long);
 VALUE rb_str_new2(const char*);
@@ -568,6 +551,7 @@
 VALUE rb_struct_members(VALUE);
 VALUE rb_struct_alloc_noinit(VALUE);
 VALUE rb_struct_define_without_accessor(const char *, VALUE, rb_alloc_func_t, ...);
+
 /* thread.c */
 VALUE rb_thgroup_add(VALUE group, VALUE thread);
 void rb_thread_remove_from_group(VALUE thread);
@@ -579,12 +563,13 @@
 VALUE rb_barrier_new(void);
 VALUE rb_barrier_wait(VALUE self);
 VALUE rb_barrier_release(VALUE self);
+
 /* time.c */
 VALUE rb_time_new(time_t, long);
 VALUE rb_time_nano_new(time_t, long);
 struct timeval rb_time_interval(VALUE num);
+
 /* variable.c */
-//VALUE rb_mod_name(VALUE);
 VALUE rb_class_path(VALUE);
 void rb_set_class_path(VALUE, VALUE, const char*);
 void rb_set_class_path2(VALUE, VALUE, const char*, VALUE);
@@ -609,11 +594,9 @@
 VALUE rb_iv_get(VALUE, const char*);
 VALUE rb_attr_get(VALUE, ID);
 VALUE rb_obj_instance_variables(VALUE);
-//VALUE rb_obj_remove_instance_variable(VALUE, VALUE);
 void *rb_mod_const_at(VALUE, void*);
 void *rb_mod_const_of(VALUE, void*);
 VALUE rb_const_list(void*);
-//VALUE rb_mod_constants(int, VALUE *, VALUE);
 VALUE rb_mod_remove_const(VALUE, VALUE);
 int rb_const_defined(VALUE, ID);
 int rb_const_defined_at(VALUE, ID);
@@ -622,31 +605,22 @@
 VALUE rb_const_get_at(VALUE, ID);
 VALUE rb_const_get_from(VALUE, ID);
 void rb_const_set(VALUE, ID, VALUE);
-//VALUE rb_mod_const_missing(VALUE,VALUE);
 VALUE rb_cvar_defined(VALUE, ID);
 void rb_cvar_set(VALUE, ID, VALUE);
 VALUE rb_cvar_get(VALUE, ID);
 void rb_cv_set(VALUE, const char*, VALUE);
 VALUE rb_cv_get(VALUE, const char*);
 void rb_define_class_variable(VALUE, const char*, VALUE);
-//VALUE rb_mod_class_variables(VALUE);
-//VALUE rb_mod_remove_cvar(VALUE, VALUE);
-/* objc.m */
+
 /* version.c */
 void ruby_show_version(void);
 void ruby_show_copyright(void);
 
 ID rb_frame_callee(void);
 VALUE rb_time_succ(VALUE);
-void Init_stack(VALUE*);
-void rb_frame_pop(void);
-int rb_frame_method_id_and_class(ID *idp, VALUE *klassp);
 
 #if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
+} // extern "C" {
 #endif
-}  /* extern "C" { */
-#endif
 
 #endif /* RUBY_INTERN_H */

Modified: MacRuby/trunk/include/ruby/io.h
===================================================================
--- MacRuby/trunk/include/ruby/io.h	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/include/ruby/io.h	2011-01-08 01:03:28 UTC (rev 5134)
@@ -1,23 +1,16 @@
-/**********************************************************************
+/*
+ * This file is covered by the Ruby license. See COPYING for more details.
+ *
+ * Copyright (C) 2007-2010, Apple Inc. All rights reserved
+ * Copyright (C) 1993-2007 Yukihiro Matsumoto
+ */
 
-  rubyio.h -
-
-  $Author: akr $
-  created at: Fri Nov 12 16:47:09 JST 1993
-
-  Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-**********************************************************************/
-
 #ifndef RUBY_IO_H
 #define RUBY_IO_H 1
 
 #if defined(__cplusplus)
 extern "C" {
-#if 0
-} /* satisfy cc-mode */
 #endif
-#endif
 
 #include <stdio.h>
 #include <errno.h>
@@ -58,16 +51,6 @@
 #define FMODE_TEXTMODE              0x00001000
 #define FMODE_SYNCWRITE (FMODE_SYNC|FMODE_WRITABLE)
 
-#ifndef SEEK_CUR
-# define SEEK_SET 0
-# define SEEK_CUR 1
-# define SEEK_END 2
-#endif
-
-#ifndef O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-
 VALUE rb_io_taint_check(VALUE);
 NORETURN(void rb_eof_error(void));
 
@@ -112,17 +95,14 @@
     }
 }
 
-// For MRI 1.9 compat.
+// For CRuby 1.9 compat.
 #define HAVE_RB_IO_T 1
 #define rb_io_check_writable rb_io_assert_writable
 #define rb_io_check_readable rb_io_assert_readable
 #define GetOpenFile(obj,fp) (fp = ExtractIOStruct(obj))
 
 #if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
+}  // extern "C" {
 #endif
-}  /* extern "C" { */
-#endif
 
 #endif /* RUBY_IO_H */

Modified: MacRuby/trunk/include/ruby/macruby.h
===================================================================
--- MacRuby/trunk/include/ruby/macruby.h	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/include/ruby/macruby.h	2011-01-08 01:03:28 UTC (rev 5134)
@@ -1,3 +1,8 @@
+/*
+ * This file is covered by the Ruby license. See COPYING for more details.
+ *
+ * Copyright (C) 2007-2010, Apple Inc. All rights reserved 
+ */
 
 #ifndef RUBY_MACRUBY_H
 #define RUBY_MACRUBY_H 1
@@ -4,10 +9,7 @@
 
 #if defined(__cplusplus)
 extern "C" {
-#if 0
-} /* satisfy cc-mode */
 #endif
-#endif
 
 #include "ruby.h"
 
@@ -75,34 +77,21 @@
 
 /* enumerator.c */
 VALUE rb_enumeratorize(VALUE, SEL, int, VALUE *);
-#define RETURN_ENUMERATOR(obj, argc, argv) do {				\
-	if (!rb_block_given_p())					\
-	    return rb_enumeratorize((VALUE)obj, sel, argc, argv);	\
+#define RETURN_ENUMERATOR(obj, argc, argv) \
+    do {	\
+	if (!rb_block_given_p()) { \
+	    return rb_enumeratorize((VALUE)obj, sel, argc, argv); \
+	} \
     } while (0)
 VALUE rb_f_notimplement(VALUE rcv, SEL sel);
 VALUE rb_method_call(VALUE, SEL, int, VALUE*);
 VALUE rb_file_directory_p(VALUE,SEL,VALUE);
 VALUE rb_obj_id(VALUE obj, SEL sel);
 
-#if WITH_OBJC
 void rb_objc_gc_register_thread(void);
 void rb_objc_gc_unregister_thread(void);
 void rb_objc_set_associative_ref(void *, void *, void *);
 void *rb_objc_get_associative_ref(void *, void *);
-# define rb_gc_mark_locations(x,y)
-# define rb_mark_tbl(x)
-# define rb_mark_set(x)
-# define rb_mark_hash(x)
-# define rb_gc_mark_maybe(x)
-# define rb_gc_mark(x)
-#else
-void rb_gc_mark_locations(VALUE*, VALUE*);
-void rb_mark_tbl(struct st_table*);
-void rb_mark_set(struct st_table*);
-void rb_mark_hash(struct st_table*);
-void rb_gc_mark_maybe(VALUE);
-void rb_gc_mark(VALUE);
-#endif
 
 VALUE rb_io_gets(VALUE, SEL);
 VALUE rb_io_getbyte(VALUE, SEL);
@@ -124,19 +113,7 @@
 void rb_range_extract(VALUE range, VALUE *begp, VALUE *endp, bool *exclude);
 VALUE rb_cvar_get2(VALUE klass, ID id, bool check);
 
-#if WITH_OBJC
-void rb_objc_alias(VALUE, ID, ID);
-VALUE rb_mod_objc_ancestors(VALUE);
 VALUE rb_require_framework(VALUE, SEL, int, VALUE *);
-VALUE rb_objc_resolve_const_value(VALUE, VALUE, ID);
-ID rb_objc_missing_sel(ID, int);
-long rb_objc_flag_get_mask(const void *);
-void rb_objc_flag_set(const void *, int, bool);
-bool rb_objc_flag_check(const void *, int);
-long rb_objc_remove_flags(const void *obj);
-void rb_objc_methods(VALUE, Class);
-bool rb_objc_is_immutable(VALUE);
-#endif
 
 RUBY_EXTERN VALUE rb_cNSObject;
 RUBY_EXTERN VALUE rb_cRubyObject;
@@ -155,11 +132,12 @@
 RUBY_EXTERN VALUE rb_cPointer;
 RUBY_EXTERN VALUE rb_cTopLevel;
 
+long rb_objc_flag_get_mask(const void *);
+void rb_objc_flag_set(const void *, int, bool);
+bool rb_objc_flag_check(const void *, int);
+
 #if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
+}  // extern "C" {
 #endif
-}  /* extern "C" { */
-#endif
 
 #endif /* RUBY_MACRUBY_H */

Modified: MacRuby/trunk/include/ruby/missing.h
===================================================================
--- MacRuby/trunk/include/ruby/missing.h	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/include/ruby/missing.h	2011-01-08 01:03:28 UTC (rev 5134)
@@ -1,168 +1 @@
-/************************************************
-
-  missing.h - prototype for *.c in ./missing, and
-  	      for missing timeval struct
-
-  $Author: akr $
-  created at: Sat May 11 23:46:03 JST 2002
-
-************************************************/
-
-#ifndef RUBY_MISSING_H
-#define RUBY_MISSING_H 1
-
-#if defined(__cplusplus)
-extern "C" {
-#if 0
-} /* satisfy cc-mode */
-#endif
-#endif
-
-#if defined(HAVE_SYS_TIME_H)
-#  include <sys/time.h>
-#elif !defined(_WIN32)
-#  define time_t long
-struct timeval {
-    time_t tv_sec;	/* seconds */
-    long tv_usec;	/* microseconds */
-};
-#endif
-#if defined(HAVE_SYS_TYPES_H)
-#  include <sys/types.h>
-#endif
-
-#if !defined(HAVE_STRUCT_TIMESPEC)
-struct timespec {
-    time_t tv_sec;	/* seconds */
-    long tv_nsec;	/* nanoseconds */
-};
-#endif
-
-#ifndef HAVE_ACOSH
-extern double acosh(double);
-extern double asinh(double);
-extern double atanh(double);
-#endif
-
-#ifndef HAVE_CRYPT
-extern char *crypt(const char *, const char *);
-#endif
-
-#ifndef HAVE_DUP2
-extern int dup2(int, int);
-#endif
-
-#ifndef HAVE_EACCESS
-extern int eaccess(const char*, int);
-#endif
-
-#ifndef HAVE_FINITE
-extern int finite(double);
-#endif
-
-#ifndef HAVE_FLOCK
-extern int flock(int, int);
-#endif
-
-/*
-#ifndef HAVE_FREXP
-extern double frexp(double, int *);
-#endif
-*/
-
-#ifndef HAVE_HYPOT
-extern double hypot(double, double);
-#endif
-
-#ifndef HAVE_ERF
-extern double erf(double);
-extern double erfc(double);
-#endif
-
-#ifndef HAVE_TGAMMA
-extern double tgamma(double);
-#endif
-
-#ifndef HAVE_LGAMMA_R
-extern double lgamma_r(double, int *);
-#endif
-
-#ifndef HAVE_CBRT
-extern double cbrt(double);
-#endif
-
-#ifndef isinf
-# ifndef HAVE_ISINF
-#  if defined(HAVE_FINITE) && defined(HAVE_ISNAN)
-#  define isinf(x) (!finite(x) && !isnan(x))
-#  else
-extern int isinf(double);
-#  endif
-# endif
-#endif
-
-#ifndef HAVE_ISNAN
-extern int isnan(double);
-#endif
-
-/*
-#ifndef HAVE_MEMCMP
-extern int memcmp(const void *, const void *, size_t);
-#endif
-*/
-
-#ifndef HAVE_MEMMOVE
-extern void *memmove(void *, const void *, size_t);
-#endif
-
-/*
-#ifndef HAVE_MODF
-extern double modf(double, double *);
-#endif
-*/
-
-#ifndef HAVE_STRCHR
-extern char *strchr(const char *, int);
-extern char *strrchr(const char *, int);
-#endif
-
-#ifndef HAVE_STRERROR
-extern char *strerror(int);
-#endif
-
-#ifndef HAVE_STRFTIME
-extern size_t strftime(char *, size_t, const char *, const struct tm *);
-#endif
-
-#ifndef HAVE_STRSTR
-extern char *strstr(const char *, const char *);
-#endif
-
-/*
-#ifndef HAVE_STRTOL
-extern long strtol(const char *, char **, int);
-#endif
-*/
-
-#ifndef HAVE_VSNPRINTF
-# include <stdarg.h>
-extern int snprintf(char *, size_t n, char const *, ...);
-extern int vsnprintf(char *, size_t n, char const *, va_list);
-#endif
-
-#ifndef HAVE_STRLCPY
-extern size_t strlcpy(char *, const char*, size_t);
-#endif
-
-#ifndef HAVE_STRLCAT
-extern size_t strlcat(char *, const char*, size_t);
-#endif
-
-#if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
-#endif
-}  /* extern "C" { */
-#endif
-
-#endif /* RUBY_MISSING_H */
+/* This header exists for CRuby compatibility. */

Modified: MacRuby/trunk/include/ruby/mvm.h
===================================================================
--- MacRuby/trunk/include/ruby/mvm.h	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/include/ruby/mvm.h	2011-01-08 01:03:28 UTC (rev 5134)
@@ -1,18 +1 @@
-/**********************************************************************
-
-  ruby/mvm.h -
-
-  $Author: nobu $
-  created at: Sat May 31 15:17:36 2008
-
-  Copyright (C) 2008 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#ifndef RUBY_MVM_H
-#define RUBY_MVM_H 1
-
-typedef struct rb_vm_struct rb_vm_t;
-typedef struct rb_thread_struct rb_thread_t;
-
-#endif /* RUBY_MVM_H */
+/* This header exists for CRuby compatibility. */

Modified: MacRuby/trunk/include/ruby/node.h
===================================================================
--- MacRuby/trunk/include/ruby/node.h	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/include/ruby/node.h	2011-01-08 01:03:28 UTC (rev 5134)
@@ -1,23 +1,16 @@
-/**********************************************************************
+/*
+ * This file is covered by the Ruby license. See COPYING for more details.
+ *
+ * Copyright (C) 2007-2010, Apple Inc. All rights reserved
+ * Copyright (C) 1993-2007 Yukihiro Matsumoto
+ */
 
-  node.h -
-
-  $Author: matz $
-  created at: Fri May 28 15:14:02 JST 1993
-
-  Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-**********************************************************************/
-
 #ifndef RUBY_NODE_H
 #define RUBY_NODE_H 1
 
 #if defined(__cplusplus)
 extern "C" {
-#if 0
-} /* satisfy cc-mode */
 #endif
-#endif
 
 enum node_type {
     NODE_METHOD,
@@ -424,7 +417,8 @@
 #define NEW_DXSTR(s) NEW_NODE(NODE_DXSTR,GC_RETAIN(s),0,0)
 #define NEW_DSYM(s) NEW_NODE(NODE_DSYM,GC_RETAIN(s),0,0)
 #define NEW_EVSTR(n) NEW_NODE(NODE_EVSTR,0,(n),0)
-#if WITH_OBJC && __IN_PARSE_Y__
+#if __IN_PARSE_Y__
+/* named args support */
 # define NEW_CALL(r,m,a) process_named_args(NEW_NODE(NODE_CALL,r,m,a))
 # define NEW_FCALL(m,a) process_named_args(NEW_NODE(NODE_FCALL,0,m,a))
 # define NEW_VCALL(m) process_named_args(NEW_NODE(NODE_VCALL,0,m,0))
@@ -513,10 +507,7 @@
 VALUE rb_gvar_defined(struct global_entry *);
 
 #if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
+}  // extern "C" {
 #endif
-}  /* extern "C" { */
-#endif
 
 #endif /* RUBY_NODE_H */

Modified: MacRuby/trunk/include/ruby/objc.h
===================================================================
--- MacRuby/trunk/include/ruby/objc.h	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/include/ruby/objc.h	2011-01-08 01:03:28 UTC (rev 5134)
@@ -1,3 +1,11 @@
+/*
+ * This file is covered by the Ruby license. See COPYING for more details.
+ *
+ * Copyright (C) 2007-2010, Apple Inc. All rights reserved 
+ */
+
+#if __OBJC__
+
 #import <Foundation/Foundation.h>
 
 @interface MacRuby : NSObject
@@ -49,3 +57,5 @@
 - (id)performRubySelector:(SEL)sel withArguments:(id)firstArgument, ...;
 
 @end
+
+#endif /* __OBJC__ */

Modified: MacRuby/trunk/include/ruby/re.h
===================================================================
--- MacRuby/trunk/include/ruby/re.h	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/include/ruby/re.h	2011-01-08 01:03:28 UTC (rev 5134)
@@ -1,3 +1,10 @@
+/*
+ * This file is covered by the Ruby license. See COPYING for more details.
+ *
+ * Copyright (C) 2007-2010, Apple Inc. All rights reserved 
+ * Copyright (C) 1993-2007 Yukihiro Matsumoto
+ */
+
 #ifndef RUBY_RE_H
 #define RUBY_RE_H 1
 
@@ -8,7 +15,7 @@
 VALUE rb_reg_regcomp(VALUE);
 
 #if defined(__cplusplus)
-} // extern "C"
+} // extern "C" {
 #endif
 
-#endif // RUBY_RE_H
+#endif /* RUBY_RE_H */

Modified: MacRuby/trunk/include/ruby/ruby.h
===================================================================
--- MacRuby/trunk/include/ruby/ruby.h	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/include/ruby/ruby.h	2011-01-08 01:03:28 UTC (rev 5134)
@@ -1,36 +1,26 @@
-/**********************************************************************
+/*
+ * This file is covered by the Ruby license. See COPYING for more details.
+ *
+ * Copyright (C) 2007-2010, Apple Inc. All rights reserved
+ * Copyright (C) 1993-2008 Yukihiro Matsumoto
+ * Copyright (C) 2000  Network Applied Communication Laboratory, Inc.
+ * Copyright (C) 2000  Information-technology Promotion Agency, Japan
+ */
 
-  ruby/ruby.h -
-
-  $Author: nobu $
-  created at: Thu Jun 10 14:26:32 JST 1993
-
-  Copyright (C) 1993-2008 Yukihiro Matsumoto
-  Copyright (C) 2000  Network Applied Communication Laboratory, Inc.
-  Copyright (C) 2000  Information-technology Promotion Agency, Japan
-
-**********************************************************************/
-
 #ifndef RUBY_RUBY_H
 #define RUBY_RUBY_H 1
 
 #if defined(__cplusplus)
 extern "C" {
-#if 0
-} /* satisfy cc-mode */
 #endif
-#endif
 
 #ifndef RUBY_LIB
-#if RUBY_INCLUDED_AS_FRAMEWORK
-#include <MacRuby/ruby/config.h>
-#else
-#include "ruby/config.h"
+# if RUBY_INCLUDED_AS_FRAMEWORK
+#  include <MacRuby/ruby/config.h>
+# else
+#  include "ruby/config.h"
+# endif
 #endif
-#ifdef RUBY_EXTCONF_H
-#include RUBY_EXTCONF_H
-#endif
-#endif
 
 #define NORETURN_STYLE_NEW 1
 #ifndef NORETURN
@@ -44,55 +34,30 @@
 #endif
 
 #ifdef __GNUC__
-#define PRINTF_ARGS(decl, string_index, first_to_check) \
-  decl __attribute__((format(printf, string_index, first_to_check)))
+# define PRINTF_ARGS(decl, string_index, first_to_check) \
+    decl __attribute__((format(printf, string_index, first_to_check)))
 #else
-#define PRINTF_ARGS(decl, string_index, first_to_check) decl
+# define PRINTF_ARGS(decl, string_index, first_to_check) decl
 #endif
 
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#ifdef HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
-
-#ifdef HAVE_INTRINSICS_H
-# include <intrinsics.h>
-#endif
-
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-
+#include <stdlib.h>
+#include <string.h>
+#include <inttypes.h>
 #include <stddef.h>
 #include <stdio.h>
+#include <sys/time.h>
 
 #if RUBY_INCLUDED_AS_FRAMEWORK
-#include <MacRuby/ruby/defines.h>
+# include <MacRuby/ruby/defines.h>
 #else
-#include "defines.h"
+# include "defines.h"
 #endif
 
-#if defined(HAVE_ALLOCA_H)
 #include <alloca.h>
-#else
-#  ifdef _AIX
-#pragma alloca
-#  endif
-#endif
 
-#if defined(__VMS)
-# pragma builtins
-# define alloca __alloca
-#endif
-
 #if SIZEOF_LONG == SIZEOF_VOIDP
 typedef unsigned long VALUE;
-#define ID unsigned long
+# define ID unsigned long
 # define SIGNED_VALUE long
 # define SIZEOF_VALUE SIZEOF_LONG
 # define PRIdVALUE "ld"
@@ -117,52 +82,8 @@
 # error ---->> ruby requires sizeof(void*) == sizeof(long) to be compiled. <<----
 #endif
 
+#include <limits.h>
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# ifndef LONG_MAX
-#  ifdef HAVE_LIMITS_H
-#   include <limits.h>
-#  else
-    /* assuming 32bit(2's compliment) long */
-#   define LONG_MAX 2147483647
-#  endif
-# endif
-# ifndef LONG_MIN
-#  define LONG_MIN (-LONG_MAX-1)
-# endif
-# ifndef CHAR_BIT
-#  define CHAR_BIT 8
-# endif
-#endif
-
-#ifdef HAVE_LONG_LONG
-# ifndef LLONG_MAX
-#  ifdef LONG_LONG_MAX
-#   define LLONG_MAX  LONG_LONG_MAX
-#  else
-#   ifdef _I64_MAX
-#    define LLONG_MAX _I64_MAX
-#   else
-    /* assuming 64bit(2's complement) long long */
-#    define LLONG_MAX 9223372036854775807LL
-#   endif
-#  endif
-# endif
-# ifndef LLONG_MIN
-#  ifdef LONG_LONG_MIN
-#   define LLONG_MIN  LONG_LONG_MIN
-#  else
-#   ifdef _I64_MIN
-#    define LLONG_MIN _I64_MIN
-#   else
-#    define LLONG_MIN (-LLONG_MAX-1)
-#   endif
-#  endif
-# endif
-#endif
-
 #define FIXNUM_MAX (LONG_MAX>>2)
 #define FIXNUM_MIN RSHIFT((long)LONG_MIN,2)
 
@@ -178,12 +99,10 @@
 
 #define TIMET2NUM(t) LONG2NUM(t)
 
-#ifdef HAVE_LONG_LONG
 #define LL2NUM(v) rb_ll2inum(v)
 #define ULL2NUM(v) rb_ull2inum(v)
-#endif
 
-#if SIZEOF_OFF_T > SIZEOF_LONG && defined(HAVE_LONG_LONG)
+#if SIZEOF_OFF_T > SIZEOF_LONG
 # define OFFT2NUM(v) LL2NUM(v)
 #elif SIZEOF_OFF_T == SIZEOF_LONG
 # define OFFT2NUM(v) LONG2NUM(v)
@@ -191,7 +110,7 @@
 # define OFFT2NUM(v) INT2NUM(v)
 #endif
 
-#if SIZEOF_SIZE_T > SIZEOF_LONG && defined(HAVE_LONG_LONG)
+#if SIZEOF_SIZE_T > SIZEOF_LONG
 # define SIZET2NUM(v) ULL2NUM(v)
 #elif SIZEOF_SIZE_T == SIZEOF_LONG
 # define SIZET2NUM(v) ULONG2NUM(v)
@@ -200,22 +119,22 @@
 #endif
 
 #ifndef PIDT2NUM
-#define PIDT2NUM(v) LONG2NUM(v)
+# define PIDT2NUM(v) LONG2NUM(v)
 #endif
 #ifndef NUM2PIDT
-#define NUM2PIDT(v) NUM2LONG(v)
+# define NUM2PIDT(v) NUM2LONG(v)
 #endif
 #ifndef UIDT2NUM
-#define UIDT2NUM(v) LONG2NUM(v)
+# define UIDT2NUM(v) LONG2NUM(v)
 #endif
 #ifndef NUM2UIDT
-#define NUM2UIDT(v) NUM2LONG(v)
+# define NUM2UIDT(v) NUM2LONG(v)
 #endif
 #ifndef GIDT2NUM
-#define GIDT2NUM(v) LONG2NUM(v)
+# define GIDT2NUM(v) LONG2NUM(v)
 #endif
 #ifndef NUM2GIDT
-#define NUM2GIDT(v) NUM2LONG(v)
+# define NUM2GIDT(v) NUM2LONG(v)
 #endif
 
 #define FIX2LONG(x) RSHIFT((SIGNED_VALUE)x,2)
@@ -439,21 +358,20 @@
 #define NUM2ULONG(x) rb_num2ulong((VALUE)x)
 #if SIZEOF_INT < SIZEOF_LONG
 long rb_num2int(VALUE);
-#define NUM2INT(x) (FIXNUM_P(x)?FIX2INT(x):rb_num2int((VALUE)x))
+# define NUM2INT(x) (FIXNUM_P(x)?FIX2INT(x):rb_num2int((VALUE)x))
 long rb_fix2int(VALUE);
-#define FIX2INT(x) rb_fix2int((VALUE)x)
+# define FIX2INT(x) rb_fix2int((VALUE)x)
 unsigned long rb_num2uint(VALUE);
-#define NUM2UINT(x) rb_num2uint(x)
+# define NUM2UINT(x) rb_num2uint(x)
 unsigned long rb_fix2uint(VALUE);
-#define FIX2UINT(x) rb_fix2uint(x)
+# define FIX2UINT(x) rb_fix2uint(x)
 #else
-#define NUM2INT(x) ((int)NUM2LONG(x))
-#define NUM2UINT(x) ((unsigned int)NUM2ULONG(x))
-#define FIX2INT(x) ((int)FIX2LONG(x))
-#define FIX2UINT(x) ((unsigned int)FIX2ULONG(x))
+# define NUM2INT(x) ((int)NUM2LONG(x))
+# define NUM2UINT(x) ((unsigned int)NUM2ULONG(x))
+# define FIX2INT(x) ((int)FIX2LONG(x))
+# define FIX2UINT(x) ((unsigned int)FIX2ULONG(x))
 #endif
 
-#ifdef HAVE_LONG_LONG
 LONG_LONG rb_num2ll(VALUE);
 unsigned LONG_LONG rb_num2ull(VALUE);
 static inline long long
@@ -461,17 +379,16 @@
 {
     return FIXNUM_P(obj) ? FIX2LONG(obj) : rb_num2ll(obj);
 }
-# define NUM2LL(x) __num2ll((VALUE)x)
-# define NUM2ULL(x) rb_num2ull((VALUE)x)
-#endif
+#define NUM2LL(x) __num2ll((VALUE)x)
+#define NUM2ULL(x) rb_num2ull((VALUE)x)
 
-#if defined(HAVE_LONG_LONG) && SIZEOF_OFF_T > SIZEOF_LONG
+#if SIZEOF_OFF_T > SIZEOF_LONG
 # define NUM2OFFT(x) ((off_t)NUM2LL(x))
 #else
 # define NUM2OFFT(x) NUM2LONG(x)
 #endif
 
-#if defined(HAVE_LONG_LONG) && SIZEOF_SIZE_T > SIZEOF_LONG
+#if SIZEOF_SIZE_T > SIZEOF_LONG
 # define NUM2SIZET(x) ((size_t)NUM2ULL(x))
 #else
 # define NUM2SIZET(x) NUM2ULONG(x)
@@ -570,9 +487,6 @@
 
 #define DATA_PTR(dta) (RDATA(dta)->data)
 
-/*
-#define RUBY_DATA_FUNC(func) ((void (*)(void*))func)
-*/
 typedef void (*RUBY_DATA_FUNC)(void*);
 
 VALUE rb_data_object_alloc(VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC);
@@ -864,15 +778,6 @@
 
 VALUE rb_require(const char*);
 
-#ifdef __ia64
-void ruby_init_stack(VALUE*, void*);
-#define ruby_init_stack(addr) ruby_init_stack(addr, rb_ia64_bsp())
-#else
-void ruby_init_stack(VALUE*);
-#endif
-#define RUBY_INIT_STACK \
-    VALUE variable_in_this_stack_frame; \
-    ruby_init_stack(&variable_in_this_stack_frame);
 void ruby_init(void);
 void *ruby_options(int, char**);
 int ruby_run_node(void *);
@@ -1035,52 +940,19 @@
 }
 
 #if RUBY_INCLUDED_AS_FRAMEWORK
-#include <MacRuby/ruby/missing.h>
-#include <MacRuby/ruby/intern.h>
-#include <MacRuby/ruby/objc.h>
+# include <MacRuby/ruby/missing.h>
+# include <MacRuby/ruby/intern.h>
+# include <MacRuby/ruby/objc.h>
 #else
-#include "ruby/missing.h"
-#include "ruby/intern.h"
+# include "ruby/missing.h"
+# include "ruby/intern.h"
 #endif
 
-#if defined(EXTLIB) && defined(USE_DLN_A_OUT)
-/* hook for external modules */
-static char *dln_libs_to_be_linked[] = { EXTLIB, 0 };
-#endif
-
 void ruby_sysinit(int *, char ***);
 
 #define RUBY_VM 1 /* YARV */
 #define HAVE_NATIVETHREAD
-int ruby_native_thread_p(void);
 
-#define RUBY_EVENT_NONE     0x00
-#define RUBY_EVENT_LINE     0x01
-#define RUBY_EVENT_CLASS    0x02
-#define RUBY_EVENT_END      0x04
-#define RUBY_EVENT_CALL     0x08
-#define RUBY_EVENT_RETURN   0x10
-#define RUBY_EVENT_C_CALL   0x20
-#define RUBY_EVENT_C_RETURN 0x40
-#define RUBY_EVENT_RAISE    0x80
-#define RUBY_EVENT_ALL      0xff
-#define RUBY_EVENT_VM      0x100
-#define RUBY_EVENT_SWITCH  0x200
-
-typedef unsigned int rb_event_flag_t;
-typedef void (*rb_event_hook_func_t)(rb_event_flag_t, VALUE data, VALUE, ID, VALUE klass);
-
-typedef struct rb_event_hook_struct {
-    rb_event_flag_t flag;
-    rb_event_hook_func_t func;
-    VALUE data;
-    struct rb_event_hook_struct *next;
-} rb_event_hook_t;
-
-void rb_add_event_hook(rb_event_hook_func_t func, rb_event_flag_t events,
-		       VALUE data);
-int rb_remove_event_hook(rb_event_hook_func_t func);
-
 /* locale insensitive functions */
 
 #define rb_isascii(c) ((unsigned long)(c) < 128)
@@ -1120,9 +992,7 @@
 #define STRTOUL(str, endptr, base) (ruby_strtoul(str, endptr, base))
 
 #if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
+}  // extern "C" {
 #endif
-}  /* extern "C" { */
-#endif
+
 #endif /* RUBY_RUBY_H */

Modified: MacRuby/trunk/include/ruby/signal.h
===================================================================
--- MacRuby/trunk/include/ruby/signal.h	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/include/ruby/signal.h	2011-01-08 01:03:28 UTC (rev 5134)
@@ -1,71 +1,21 @@
-/**********************************************************************
+/*
+ * This file is covered by the Ruby license. See COPYING for more details.
+ *
+ * Copyright (C) 2007-2010, Apple Inc. All rights reserved 
+ * Copyright (C) 1993-2007 Yukihiro Matsumoto
+ */
 
-  rubysig.h -
+#ifndef RUBY_SIGNAL_H
+#define RUBY_SIGNAL_H 1
 
-  $Author: akr $
-  created at: Wed Aug 16 01:15:38 JST 1995
-
-  Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-**********************************************************************/
-
-#ifndef RUBYSIG_H
-#define RUBYSIG_H 1
-
 #if defined(__cplusplus)
 extern "C" {
-#if 0
-} /* satisfy cc-mode */
 #endif
-#endif
 
-#include <errno.h>
-
 typedef RETSIGTYPE (*sighandler_t)(int);
 
-typedef int rb_atomic_t;
-
-# define ATOMIC_TEST(var) ((var) ? ((var) = 0, 1) : 0)
-# define ATOMIC_SET(var, val) ((var) = (val))
-# define ATOMIC_INC(var) (++(var))
-# define ATOMIC_DEC(var) (--(var))
-
-# define TRAP_BEG do {\
-    int trap_immediate = rb_trap_immediate;\
-    rb_trap_immediate = 1
-
-# define TRAP_END \
-    rb_trap_immediate = trap_immediate;\
-} while (0)
-
-# define RUBY_CRITICAL(statements) do {\
-    int trap_immediate = rb_trap_immediate;\
-    rb_trap_immediate = 0;\
-    statements;\
-    rb_trap_immediate = trap_immediate;\
-} while (0)
-RUBY_EXTERN rb_atomic_t rb_trap_immediate;
-
-RUBY_EXTERN int rb_prohibit_interrupt;
-#define DEFER_INTS (rb_prohibit_interrupt++)
-#define ALLOW_INTS do {\
-    rb_prohibit_interrupt--;\
-} while (0)
-#define ENABLE_INTS (rb_prohibit_interrupt--)
-
-VALUE rb_with_disable_interrupt(VALUE(*)(ANYARGS),VALUE);
-
-RUBY_EXTERN rb_atomic_t rb_trap_pending;
-void rb_trap_restore_mask(void);
-
-RUBY_EXTERN int rb_thread_critical;
-void rb_thread_schedule(void);
-
 #if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
+} // extern "C" {
 #endif
-}  /* extern "C" { */
-#endif
 
-#endif /* RUBYSIG_H */
+#endif /* RUBY_SIGNAL_H */

Modified: MacRuby/trunk/include/ruby/st.h
===================================================================
--- MacRuby/trunk/include/ruby/st.h	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/include/ruby/st.h	2011-01-08 01:03:28 UTC (rev 5134)
@@ -7,10 +7,7 @@
 
 #if defined(__cplusplus)
 extern "C" {
-#if 0
-} /* satisfy cc-mode */
 #endif
-#endif
 
 #if SIZEOF_LONG == SIZEOF_VOIDP
 typedef unsigned long st_data_t;
@@ -28,9 +25,6 @@
 #  define CHAR_BIT 8
 # endif
 #endif
-#ifndef _
-# define _(args) args
-#endif
 #ifndef ANYARGS
 # ifdef __cplusplus
 #   define ANYARGS ...
@@ -91,10 +85,7 @@
 int st_strncasecmp(const char *s1, const char *s2, size_t n);
 
 #if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
+}  // extern "C" {
 #endif
-}  /* extern "C" { */
-#endif
 
 #endif /* RUBY_ST_H */

Modified: MacRuby/trunk/include/ruby/util.h
===================================================================
--- MacRuby/trunk/include/ruby/util.h	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/include/ruby/util.h	2011-01-08 01:03:28 UTC (rev 5134)
@@ -1,84 +1,38 @@
-/**********************************************************************
+/*
+ * This file is covered by the Ruby license. See COPYING for more details.
+ *
+ * Copyright (C) 2007-2010, Apple Inc. All rights reserved 
+ * Copyright (C) 1993-2007 Yukihiro Matsumoto
+ */
 
-  util.h -
-
-  $Author: nobu $
-  created at: Thu Mar  9 11:55:53 JST 1995
-
-  Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-**********************************************************************/
-
 #ifndef RUBY_UTIL_H
 #define RUBY_UTIL_H 1
 
 #if defined(__cplusplus)
 extern "C" {
-#if 0
-} /* satisfy cc-mode */
 #endif
-#endif
 
-#ifndef _
-#ifdef __cplusplus
-# ifndef  HAVE_PROTOTYPES
-#  define HAVE_PROTOTYPES 1
-# endif
-# ifndef  HAVE_STDARG_PROTOTYPES
-#  define HAVE_STDARG_PROTOTYPES 1
-# endif
-#endif
-#ifdef HAVE_PROTOTYPES
-# define _(args) args
-#else
-# define _(args) ()
-#endif
-#ifdef HAVE_STDARG_PROTOTYPES
-# define __(args) args
-#else
-# define __(args) ()
-#endif
-#endif
-
-#define scan_oct ruby_scan_oct
 unsigned long ruby_scan_oct(const char *, int, int *);
-#define scan_hex ruby_scan_hex
 unsigned long ruby_scan_hex(const char *, int, int *);
+#define scan_oct ruby_scan_oct
+#define scan_hex ruby_scan_hex
 
-#if defined(MSDOS) || defined(__CYGWIN32__) || defined(_WIN32)
-void ruby_add_suffix(VALUE str, const char *suffix);
-#endif
-
 void ruby_qsort(void *, const int, const int,
-		int (*)(const void *, const void *, void *), void *);
+	int (*)(const void *, const void *, void *), void *);
 
 void ruby_setenv(const char *, const char *);
 void ruby_unsetenv(const char *);
-#undef setenv
-#undef unsetenv
-#define setenv(name,val) ruby_setenv(name,val)
-#define unsetenv(name,val) ruby_unsetenv(name);
 
 char *ruby_strdup(const char *);
-#if !WITH_OBJC
-#undef strdup
-#define strdup(s) ruby_strdup(s)
-#endif
 
 VALUE ruby_getcwd(void);
-#define my_getcwd() ruby_getcwd()
 
 double ruby_strtod(const char *, char **);
-#undef strtod
-#define strtod(s,e) ruby_strtod(s,e)
 
 void ruby_each_words(const char *, void (*)(const char*, int, void*), void *);
 
 #if defined(__cplusplus)
-#if 0
-{ /* satisfy cc-mode */
+} // extern "C" {
 #endif
-}  /* extern "C" { */
-#endif
 
 #endif /* RUBY_UTIL_H */

Modified: MacRuby/trunk/marshal.c
===================================================================
--- MacRuby/trunk/marshal.c	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/marshal.c	2011-01-08 01:03:28 UTC (rev 5134)
@@ -106,24 +106,6 @@
 static st_table *compat_allocator_tbl;
 static VALUE compat_allocator_tbl_wrapper;
 
-static int
-mark_marshal_compat_i(st_data_t key, st_data_t value)
-{
-#if !WITH_OBJC
-    marshal_compat_t *p = (marshal_compat_t *)value;
-#endif
-    rb_gc_mark(p->newclass);
-    rb_gc_mark(p->oldclass);
-    return ST_CONTINUE;
-}
-
-static void
-mark_marshal_compat_t(void *tbl)
-{
-    if (!tbl) return;
-    st_foreach(tbl, mark_marshal_compat_i, 0);
-}
-
 static rb_alloc_func_t
 rb_get_alloc_func(VALUE klass)
 {
@@ -177,18 +159,6 @@
     }
 }
 
-static void
-mark_dump_arg(void *ptr)
-{
-#if !WITH_OBJC
-    struct dump_arg *p = ptr;
-    if (!ptr)
-        return;
-#endif
-    rb_mark_set(p->data);
-    rb_mark_hash(p->compat_tbl);
-}
-
 static VALUE
 class2path(VALUE klass)
 {
@@ -1009,7 +979,7 @@
     GC_WB(&arg->data, st_init_numtable());
     arg->taint = Qfalse;
     GC_WB(&arg->compat_tbl, st_init_numtable());
-    GC_WB(&arg->wrapper, Data_Wrap_Struct(rb_cData, mark_dump_arg, 0, arg));
+    GC_WB(&arg->wrapper, Data_Wrap_Struct(rb_cData, NULL, 0, arg));
     arg->encodings = 0;
     GC_WB(&c_arg->obj, obj);
     GC_WB(&c_arg->arg, arg);
@@ -1436,7 +1406,7 @@
 	    }
 	    else {
 		char *e;
-		d = strtod(ptr, &e);
+		d = ruby_strtod(ptr, &e);
 		d = load_mantissa(d, e, strlen(ptr) - (e - ptr));
 	    }
 	    v = DOUBLE2NUM(d);
@@ -1774,7 +1744,7 @@
     GC_WB(&arg->src, port);
     arg->offset = 0;
     GC_WB(&arg->compat_tbl, st_init_numtable());
-    GC_WB(&arg->compat_tbl_wrapper, Data_Wrap_Struct(rb_cData, NULL/*rb_mark_tbl*/, 0, arg->compat_tbl));
+    GC_WB(&arg->compat_tbl_wrapper, Data_Wrap_Struct(rb_cData, NULL, 0, arg->compat_tbl));
 
     major = r_byte(arg);
     minor = r_byte(arg);
@@ -1861,7 +1831,7 @@
 
     compat_allocator_tbl = st_init_numtable();
     compat_allocator_tbl_wrapper =
-	Data_Wrap_Struct(rb_cData, mark_marshal_compat_t, 0, compat_allocator_tbl);
+	Data_Wrap_Struct(rb_cData, NULL, 0, compat_allocator_tbl);
     GC_RETAIN(compat_allocator_tbl_wrapper);
 }
 

Modified: MacRuby/trunk/object.c
===================================================================
--- MacRuby/trunk/object.c	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/object.c	2011-01-08 01:03:28 UTC (rev 5134)
@@ -2625,7 +2625,7 @@
 	return 0.0;
     }
 
-    d = strtod(p, &end);
+    d = ruby_strtod(p, &end);
     if (errno == ERANGE) {
 	OutOfRange();
 	rb_warning("Float %.*s%s out of range", w, p, ellipsis);
@@ -2668,7 +2668,7 @@
 	    return 0.0;
 	}
 
-	d = strtod(p, &end);
+	d = ruby_strtod(p, &end);
 	if (errno == ERANGE) {
 	    OutOfRange();
 	    rb_warning("Float %.*s%s out of range", w, p, ellipsis);

Modified: MacRuby/trunk/parse.y
===================================================================
--- MacRuby/trunk/parse.y	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/parse.y	2011-01-08 01:03:28 UTC (rev 5134)
@@ -7112,7 +7112,7 @@
 		yyerror(tmp);
 	    }
 	    if (is_float) {
-		double d = strtod(tok(), 0);
+		double d = ruby_strtod(tok(), 0);
 		if (errno == ERANGE) {
 		    rb_warningS("Float %s out of range", tok());
 		    errno = 0;
@@ -9370,38 +9370,10 @@
 }
 
 #ifdef RIPPER
-#define parser_mark ripper_parser_mark
 #define parser_free ripper_parser_free
 #endif
 
 static void
-parser_mark(void *ptr)
-{
-#if !WITH_OBJC
-    struct parser_params *p = (struct parser_params*)ptr;
-#endif
-
-    rb_gc_mark((VALUE)p->parser_lex_strterm);
-    rb_gc_mark(p->parser_lex_input);
-    rb_gc_mark(p->parser_lex_lastline);
-    rb_gc_mark(p->parser_lex_nextline);
-#ifndef RIPPER
-    rb_gc_mark((VALUE)p->parser_eval_tree_begin) ;
-    rb_gc_mark((VALUE)p->parser_eval_tree) ;
-    rb_gc_mark(p->debug_lines);
-#else
-    rb_gc_mark(p->parser_ruby_sourcefile_string);
-    rb_gc_mark(p->delayed);
-    rb_gc_mark(p->value);
-    rb_gc_mark(p->result);
-    rb_gc_mark(p->parsing_thread);
-#endif
-#ifdef YYMALLOC
-    rb_gc_mark((VALUE)p->heap);
-#endif
-}
-
-static void
 parser_free(void *ptr)
 {
     struct parser_params *p = (struct parser_params*)ptr;
@@ -9512,7 +9484,7 @@
     }
 #endif
 
-    return Data_Wrap_Struct(c, parser_mark, parser_free, p);
+    return Data_Wrap_Struct(c, NULL, parser_free, p);
 }
 
 VALUE
@@ -9866,7 +9838,7 @@
 
     p = ALLOC_N(struct parser_params, 1);
     MEMZERO(p, struct parser_params, 1);
-    self = Data_Wrap_Struct(klass, parser_mark, parser_free, p);
+    self = Data_Wrap_Struct(klass, NULL, parser_free, p);
     p->value = self;
     return self;
 }

Modified: MacRuby/trunk/process.c
===================================================================
--- MacRuby/trunk/process.c	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/process.c	2011-01-08 01:03:28 UTC (rev 5134)
@@ -601,7 +601,6 @@
     struct waitpid_arg *arg = data;
 #endif
 
-    TRAP_BEG;
 #if defined NO_WAITPID
     result = wait(data);
 #elif defined HAVE_WAITPID
@@ -609,7 +608,6 @@
 #else  /* HAVE_WAIT4 */
     result = wait4(arg->pid, arg->st, arg->flags, NULL);
 #endif
-    TRAP_END;
     return (VALUE)result;
 }
 
@@ -2122,7 +2120,7 @@
     obj = rb_ary_entry(options, EXEC_OPTION_CHDIR);
     if (!NIL_P(obj)) {
         if (!NIL_P(soptions)) {
-            VALUE cwd = my_getcwd();
+            VALUE cwd = ruby_getcwd();
             rb_ary_store(soptions, EXEC_OPTION_CHDIR,
                          hide_obj(cwd));
         }

Modified: MacRuby/trunk/signal.c
===================================================================
--- MacRuby/trunk/signal.c	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/signal.c	2011-01-08 01:03:28 UTC (rev 5134)
@@ -288,30 +288,12 @@
     return INT2FIX(i - 1);
 }
 
-rb_atomic_t rb_trap_pending;
-rb_atomic_t rb_trap_immediate;
-int rb_prohibit_interrupt = 1;
-
 VALUE
 rb_get_trap_cmd(int sig)
 {
     return rb_vm_trap_cmd_for_signal(sig);
 }
 
-void
-rb_gc_mark_trap_list(void)
-{
-#ifndef MACOS_UNUSE_SIGNAL
-    int i;
-
-    for (i = 0; i < NSIG; i++) {
-	if (rb_vm_trap_cmd_for_signal(i)) {
-	    rb_gc_mark(rb_vm_trap_cmd_for_signal(i));
-	}
-    }
-#endif /* MACOS_UNUSE_SIGNAL */
-}
-
 sighandler_t
 ruby_signal(int signum, sighandler_t handler)
 {
@@ -388,7 +370,7 @@
 void
 rb_trap_exit(void)
 {
-#ifndef MACOS_UNUSE_SIGNAL
+#if 0//ndef MACOS_UNUSE_SIGNAL
     VALUE trap_exit;
     int safe;
 

Modified: MacRuby/trunk/time.c
===================================================================
--- MacRuby/trunk/time.c	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/time.c	2011-01-08 01:03:28 UTC (rev 5134)
@@ -2073,7 +2073,6 @@
 static VALUE
 time_strftime(VALUE time, SEL sel, VALUE format)
 {
-    void rb_enc_copy(VALUE, VALUE);
     struct time_object *tobj;
     char buffer[SMALLBUF], *buf = buffer;
     const char *fmt;
@@ -2117,9 +2116,6 @@
     }
     str = rb_str_new(buf, len);
     if (buf != buffer) xfree(buf);
-#if !WITH_OBJC
-    rb_enc_copy(str, format);
-#endif
     return str;
 }
 

Modified: MacRuby/trunk/variable.c
===================================================================
--- MacRuby/trunk/variable.c	2011-01-08 00:41:44 UTC (rev 5133)
+++ MacRuby/trunk/variable.c	2011-01-08 01:03:28 UTC (rev 5134)
@@ -451,9 +451,7 @@
 static void
 val_marker(VALUE data)
 {
-    if (data) {
-	rb_gc_mark_maybe(data);
-    }
+    // Do nothing.
 }
 
 static VALUE
@@ -478,9 +476,7 @@
 static void
 var_marker(VALUE *var)
 {
-    if (var != NULL) {
-	rb_gc_mark_maybe(*var);
-    }
+    // Do nothing.
 }
 
 void
@@ -489,30 +485,6 @@
     rb_name_error(id, "%s is a read-only variable", rb_id2name(id));
 }
 
-static int
-mark_global_entry(ID key, struct global_entry *entry)
-{
-    struct trace_var *trace;
-    struct global_variable *var = entry->var;
-
-    (*var->marker)(var->data);
-    trace = var->trace;
-    while (trace) {
-	if (trace->data) {
-	    rb_gc_mark_maybe(trace->data);
-	}
-	trace = trace->next;
-    }
-    return ST_CONTINUE;
-}
-
-void
-rb_gc_mark_global_tbl(void)
-{
-    if (rb_global_tbl)
-        st_foreach_safe(rb_global_tbl, mark_global_entry, 0);
-}
-
 static ID
 global_id(const char *name)
 {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110107/c12638c0/attachment-0001.html>


More information about the macruby-changes mailing list