ruby-changes:9971
From: matz <ko1@a...>
Date: Thu, 15 Jan 2009 10:54:04 +0900 (JST)
Subject: [ruby-changes:9971] Ruby:r21513 (trunk): * symbian/README.SYMBIAN: symbian support added. great appreciate
matz 2009-01-15 10:53:08 +0900 (Thu, 15 Jan 2009) New Revision: 21513 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21513 Log: * symbian/README.SYMBIAN: symbian support added. great appreciate to <alexandre.zavorine at symbian.com>. Modified files: trunk/ChangeLog trunk/dln.c trunk/file.c trunk/io.c trunk/process.c trunk/ruby.c trunk/signal.c Index: ChangeLog =================================================================== --- ChangeLog (revision 21512) +++ ChangeLog (revision 21513) @@ -1,3 +1,8 @@ +Thu Jan 15 10:45:52 2009 Yukihiro Matsumoto <matz@r...> + + * symbian/README.SYMBIAN: symbian support added. great appreciate + to <alexandre.zavorine at symbian.com>. + Thu Jan 15 00:06:12 2009 Nobuyoshi Nakada <nobu@r...> * enc/trans/gb18030.trans: get rid of a 1.9 feature for cross Index: io.c =================================================================== --- io.c (revision 21512) +++ io.c (revision 21513) @@ -4479,9 +4479,12 @@ int status; struct popen_arg arg; char errmsg[80] = { '\0' }; -#elif defined(_WIN32) - volatile VALUE argbuf; - char **args = NULL; +#else +#if defined(_WIN32) + int openmode = rb_io_modestr_oflags(modestr); + const char *exename = NULL; + volatile VALUE cmdbuf; +#endif struct rb_exec_arg sarg; int pair[2], write_pair[2]; #endif @@ -6245,7 +6248,11 @@ chmod(fn, st.st_mode); #endif if (st.st_uid!=st2.st_uid || st.st_gid!=st2.st_gid) { +#ifdef __SYMBIAN32__ + chown(fn, st.st_uid, st.st_gid); +#else fchown(fw, st.st_uid, st.st_gid); +#endif } #endif rb_stdout = prep_io(fw, FMODE_WRITABLE, rb_cFile, fn); Index: dln.c =================================================================== --- dln.c (revision 21512) +++ dln.c (revision 21513) @@ -1268,6 +1268,16 @@ # define RTLD_GLOBAL 0 #endif +#if defined __SYMBIAN32__ + { /* Need backslash in the path again */ + char *p; + for (p = (char *)file; *p; p++) { + if (*p == '/') { + *p = '\\'; + } + } + } +#endif /* Load file */ if ((handle = (void*)dlopen(file, RTLD_LAZY|RTLD_GLOBAL)) == NULL) { error = dln_strerror(); @@ -1275,6 +1285,10 @@ } init_fct = (void(*)())dlsym(handle, buf); +#if defined __SYMBIAN32__ + if (init_fct == NULL) + init_fct = (void(*)())dlsym(handle, "1"); /* Some Symbian versions do not support symbol table in DLL, ordinal numbers only */ +#endif if (init_fct == NULL) { error = DLN_ERROR(); dlclose(handle); Index: process.c =================================================================== --- process.c (revision 21512) +++ process.c (revision 21513) @@ -1097,7 +1097,9 @@ exit(status); #else before_exec(); +#ifndef __SYMBIAN32__ execl("/bin/sh", "sh", "-c", str, (char *)NULL); +#endif preserving_errno(after_exec()); #endif return -1; Index: ruby.c =================================================================== --- ruby.c (revision 21512) +++ ruby.c (revision 21513) @@ -182,7 +182,7 @@ } #endif -#if defined _WIN32 || defined __CYGWIN__ +#if defined _WIN32 || defined __CYGWIN__ || defined __SYMBIAN32__ static VALUE rubylib_mangled_path(const char *s, unsigned int l) { @@ -331,7 +331,7 @@ ruby_push_include(path, expand_include_path); } -#if defined DOSISH || defined __CYGWIN__ +#if (defined DOSISH || defined __CYGWIN__) && !defined __SYMBIAN32__ #define LOAD_RELATIVE 1 #endif Index: signal.c =================================================================== --- signal.c (revision 21512) +++ signal.c (revision 21513) @@ -409,7 +409,7 @@ #endif typedef RETSIGTYPE (*sighandler_t)(int); -#ifdef SA_SIGINFO +#if defined SA_SIGINFO && !defined __SYMBIAN32__ typedef void ruby_sigaction_t(int, siginfo_t*, void*); #define SIGINFO_ARG , siginfo_t *info, void *ctx #else @@ -535,7 +535,7 @@ void rb_disable_interrupt(void) { -#ifndef _WIN32 +#if !defined(_WIN32) && !defined(__SYMBIAN32__) sigset_t mask; sigfillset(&mask); sigdelset(&mask, SIGVTALRM); @@ -547,7 +547,7 @@ void rb_enable_interrupt(void) { -#ifndef _WIN32 +#if !defined(_WIN32) && !defined(__SYMBIAN32__) sigset_t mask; sigemptyset(&mask); pthread_sigmask(SIG_SETMASK, &mask, NULL); Index: file.c =================================================================== --- file.c (revision 21512) +++ file.c (revision 21513) @@ -1998,7 +1998,7 @@ o = NIL_P(owner) ? -1 : NUM2INT(owner); g = NIL_P(group) ? -1 : NUM2INT(group); GetOpenFile(obj, fptr); -#if defined(__CYGWIN32__) || defined(_WIN32) || defined(__EMX__) +#if defined(__CYGWIN32__) || defined(_WIN32) || defined(__EMX__) || defined(__SYMBIAN32__) if (NIL_P(fptr->pathv)) return Qnil; if (chown(RSTRING_PTR(fptr->pathv), o, g) == -1) rb_sys_fail_path(fptr->pathv); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/