* symbian/README.SYMBIAN: symbian support added. great appreciate

to <alexandre.zavorine at symbian.com>.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2009-01-15 01:53:08 +00:00
parent e24346d6c6
commit c6af6b1b94
7 changed files with 37 additions and 9 deletions

View File

@ -1,3 +1,8 @@
Thu Jan 15 10:45:52 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
* symbian/README.SYMBIAN: symbian support added. great appreciate
to <alexandre.zavorine at symbian.com>.
Thu Jan 15 00:06:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> Thu Jan 15 00:06:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* enc/trans/gb18030.trans: get rid of a 1.9 feature for cross * enc/trans/gb18030.trans: get rid of a 1.9 feature for cross

14
dln.c
View File

@ -1268,6 +1268,16 @@ dln_load(const char *file)
# define RTLD_GLOBAL 0 # define RTLD_GLOBAL 0
#endif #endif
#if defined __SYMBIAN32__
{ /* Need backslash in the path again */
char *p;
for (p = (char *)file; *p; p++) {
if (*p == '/') {
*p = '\\';
}
}
}
#endif
/* Load file */ /* Load file */
if ((handle = (void*)dlopen(file, RTLD_LAZY|RTLD_GLOBAL)) == NULL) { if ((handle = (void*)dlopen(file, RTLD_LAZY|RTLD_GLOBAL)) == NULL) {
error = dln_strerror(); error = dln_strerror();
@ -1275,6 +1285,10 @@ dln_load(const char *file)
} }
init_fct = (void(*)())dlsym(handle, buf); 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) { if (init_fct == NULL) {
error = DLN_ERROR(); error = DLN_ERROR();
dlclose(handle); dlclose(handle);

2
file.c
View File

@ -1998,7 +1998,7 @@ rb_file_chown(VALUE obj, VALUE owner, VALUE group)
o = NIL_P(owner) ? -1 : NUM2INT(owner); o = NIL_P(owner) ? -1 : NUM2INT(owner);
g = NIL_P(group) ? -1 : NUM2INT(group); g = NIL_P(group) ? -1 : NUM2INT(group);
GetOpenFile(obj, fptr); 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 (NIL_P(fptr->pathv)) return Qnil;
if (chown(RSTRING_PTR(fptr->pathv), o, g) == -1) if (chown(RSTRING_PTR(fptr->pathv), o, g) == -1)
rb_sys_fail_path(fptr->pathv); rb_sys_fail_path(fptr->pathv);

13
io.c
View File

@ -4479,9 +4479,12 @@ pipe_open(struct rb_exec_arg *eargp, VALUE prog, const char *modestr, int fmode,
int status; int status;
struct popen_arg arg; struct popen_arg arg;
char errmsg[80] = { '\0' }; char errmsg[80] = { '\0' };
#elif defined(_WIN32) #else
volatile VALUE argbuf; #if defined(_WIN32)
char **args = NULL; int openmode = rb_io_modestr_oflags(modestr);
const char *exename = NULL;
volatile VALUE cmdbuf;
#endif
struct rb_exec_arg sarg; struct rb_exec_arg sarg;
int pair[2], write_pair[2]; int pair[2], write_pair[2];
#endif #endif
@ -6245,7 +6248,11 @@ argf_next_argv(VALUE argf)
chmod(fn, st.st_mode); chmod(fn, st.st_mode);
#endif #endif
if (st.st_uid!=st2.st_uid || st.st_gid!=st2.st_gid) { 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); fchown(fw, st.st_uid, st.st_gid);
#endif
} }
#endif #endif
rb_stdout = prep_io(fw, FMODE_WRITABLE, rb_cFile, fn); rb_stdout = prep_io(fw, FMODE_WRITABLE, rb_cFile, fn);

View File

@ -1097,7 +1097,9 @@ rb_proc_exec(const char *str)
exit(status); exit(status);
#else #else
before_exec(); before_exec();
#ifndef __SYMBIAN32__
execl("/bin/sh", "sh", "-c", str, (char *)NULL); execl("/bin/sh", "sh", "-c", str, (char *)NULL);
#endif
preserving_errno(after_exec()); preserving_errno(after_exec());
#endif #endif
return -1; return -1;

4
ruby.c
View File

@ -182,7 +182,7 @@ translate_char(char *p, int from, int to)
} }
#endif #endif
#if defined _WIN32 || defined __CYGWIN__ #if defined _WIN32 || defined __CYGWIN__ || defined __SYMBIAN32__
static VALUE static VALUE
rubylib_mangled_path(const char *s, unsigned int l) rubylib_mangled_path(const char *s, unsigned int l)
{ {
@ -331,7 +331,7 @@ ruby_incpush_expand(const char *path)
ruby_push_include(path, expand_include_path); ruby_push_include(path, expand_include_path);
} }
#if defined DOSISH || defined __CYGWIN__ #if (defined DOSISH || defined __CYGWIN__) && !defined __SYMBIAN32__
#define LOAD_RELATIVE 1 #define LOAD_RELATIVE 1
#endif #endif

View File

@ -409,7 +409,7 @@ static struct {
#endif #endif
typedef RETSIGTYPE (*sighandler_t)(int); typedef RETSIGTYPE (*sighandler_t)(int);
#ifdef SA_SIGINFO #if defined SA_SIGINFO && !defined __SYMBIAN32__
typedef void ruby_sigaction_t(int, siginfo_t*, void*); typedef void ruby_sigaction_t(int, siginfo_t*, void*);
#define SIGINFO_ARG , siginfo_t *info, void *ctx #define SIGINFO_ARG , siginfo_t *info, void *ctx
#else #else
@ -535,7 +535,7 @@ static int trap_last_mask;
void void
rb_disable_interrupt(void) rb_disable_interrupt(void)
{ {
#ifndef _WIN32 #if !defined(_WIN32) && !defined(__SYMBIAN32__)
sigset_t mask; sigset_t mask;
sigfillset(&mask); sigfillset(&mask);
sigdelset(&mask, SIGVTALRM); sigdelset(&mask, SIGVTALRM);
@ -547,7 +547,7 @@ rb_disable_interrupt(void)
void void
rb_enable_interrupt(void) rb_enable_interrupt(void)
{ {
#ifndef _WIN32 #if !defined(_WIN32) && !defined(__SYMBIAN32__)
sigset_t mask; sigset_t mask;
sigemptyset(&mask); sigemptyset(&mask);
pthread_sigmask(SIG_SETMASK, &mask, NULL); pthread_sigmask(SIG_SETMASK, &mask, NULL);