diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-24 02:52:08 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-24 02:52:08 +0000 |
commit | 37e11f3cce5dc533379117d216c09120b6546c26 (patch) | |
tree | d7bd385b2c33db30d80e573f9a370a2f4521e812 | |
parent | 9afa9ba9673370d98d433ba24c06282ca8f1e5e8 (diff) | |
download | ruby-37e11f3cce5dc533379117d216c09120b6546c26.tar.gz |
* dln.c (translit_separator): moved back from load.c again.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | dln.c | 13 | ||||
-rw-r--r-- | load.c | 11 | ||||
-rw-r--r-- | symbian/setup | 2 |
4 files changed, 18 insertions, 12 deletions
@@ -1,4 +1,6 @@ -Wed Feb 24 09:54:58 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> +Wed Feb 24 11:52:05 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * dln.c (translit_separator): moved back from load.c again. * dln_find.c: split from dln.c. @@ -1218,6 +1218,18 @@ aix_loaderror(const char *pathname) } #endif +#if defined(DLN_NEEDS_ALT_SEPARATOR) && DLN_NEEDS_ALT_SEPARATOR +#define translit_separator(src) do { \ + char *tmp = ALLOCA_N(char, strlen(src) + 1), *p = tmp, c; \ + do { \ + *p++ = ((c = *file++) == '/') ? DLN_NEEDS_ALT_SEPARATOR : c; \ + } while (c); \ + str = tmp; \ + } while (0) +#else +#define translit_separator(str) (void)(str) +#endif + void* dln_load(const char *file) { @@ -1264,6 +1276,7 @@ dln_load(const char *file) char *buf; /* Load the file as an object one */ init_funcname(&buf, file); + translit_separator(file); #ifdef USE_DLN_DLOPEN #define DLN_DEFINED @@ -536,17 +536,8 @@ load_failed(VALUE fname) static VALUE load_ext(VALUE path) { - VALUE result; - SCOPE_SET(NOEX_PUBLIC); -#if defined DLN_NEEDS_ALT_SEPARATOR && DLN_NEEDS_ALT_SEPARATOR - translit_char(RSTRING_PTR(path), '/', '\\'); -#endif - result = (VALUE)dln_load(RSTRING_PTR(path)); -#if defined DLN_NEEDS_ALT_SEPARATOR && DLN_NEEDS_ALT_SEPARATOR - translit_char(RSTRING_PTR(path), '\\', '/'); -#endif - return result; + return (VALUE)dln_load(RSTRING_PTR(path)); } VALUE diff --git a/symbian/setup b/symbian/setup index c9e153cb62..04d30858af 100644 --- a/symbian/setup +++ b/symbian/setup @@ -171,7 +171,7 @@ define config_h @echo>>$(1) #define DLEXT_MAXLEN 4 @echo>>$(1) #define DLEXT ".dll" @echo>>$(1) #define EXECUTABLE_EXTS ".exe",".com",".cmd",".bat" -@echo>>$(1) #define DLN_NEEDS_ALT_SEPARATOR 1 +@echo>>$(1) #define DLN_NEEDS_ALT_SEPARATOR '\\' @echo>>$(1) #define RUBY_LIB_VERSION_STYLE 3 @echo>>$(1) #define RUBY_LIB_PREFIX "C:/Data/Ruby/lib" @echo>>$(1) #define RUBY_SITE_LIB "E:/Data/Ruby/lib" |