[前][次][番号順一覧][スレッド一覧]

ruby-changes:14879

From: nobu <ko1@a...>
Date: Wed, 24 Feb 2010 11:52:29 +0900 (JST)
Subject: [ruby-changes:14879] Ruby:r26747 (trunk): * dln.c (translit_separator): moved back from load.c again.

nobu	2010-02-24 11:52:08 +0900 (Wed, 24 Feb 2010)

  New Revision: 26747

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26747

  Log:
    * dln.c (translit_separator): moved back from load.c again.

  Modified files:
    trunk/ChangeLog
    trunk/dln.c
    trunk/load.c
    trunk/symbian/setup

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 26746)
+++ ChangeLog	(revision 26747)
@@ -1,5 +1,7 @@
-Wed Feb 24 09:54:58 2010  Nobuyoshi Nakada  <nobu@r...>
+Wed Feb 24 11:52:05 2010  Nobuyoshi Nakada  <nobu@r...>
 
+	* dln.c (translit_separator): moved back from load.c again.
+
 	* dln_find.c: split from dln.c.
 
 Wed Feb 24 09:31:33 2010  Nobuyoshi Nakada  <nobu@r...>
Index: load.c
===================================================================
--- load.c	(revision 26746)
+++ load.c	(revision 26747)
@@ -536,17 +536,8 @@
 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
Index: symbian/setup
===================================================================
--- symbian/setup	(revision 26746)
+++ symbian/setup	(revision 26747)
@@ -171,7 +171,7 @@
 @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"
Index: dln.c
===================================================================
--- dln.c	(revision 26746)
+++ dln.c	(revision 26747)
@@ -1218,6 +1218,18 @@
 }
 #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 @@
     char *buf;
     /* Load the file as an object one */
     init_funcname(&buf, file);
+    translit_separator(file);
 
 #ifdef USE_DLN_DLOPEN
 #define DLN_DEFINED

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]