summaryrefslogtreecommitdiff
path: root/eval_intern.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-19 06:11:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-19 06:11:41 +0000
commitf35308b3ef20be1716660a751087b4e726db2171 (patch)
tree0a81f4109473d2c5746f12c65c9287ef06b5b1e0 /eval_intern.h
parent6d3ceb6ce38f91898dfc388fc96f5401ff3edc52 (diff)
downloadruby-f35308b3ef20be1716660a751087b4e726db2171.tar.gz
* eval_intern.h (translit_char): moved from ruby.c.
* load.c (load_ext): transliterates file separators and back if needed. * symbian/setup (DLN_NEEDS_ALT_SEPARATOR): defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval_intern.h')
-rw-r--r--eval_intern.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/eval_intern.h b/eval_intern.h
index 40f64eca06..ac2999d3b9 100644
--- a/eval_intern.h
+++ b/eval_intern.h
@@ -205,4 +205,20 @@ VALUE rb_vm_top_self();
VALUE rb_vm_cbase(void);
void rb_trap_restore_mask(void);
+#ifndef CharNext /* defined as CharNext[AW] on Windows. */
+#define CharNext(p) ((p) + mblen(p, RUBY_MBCHAR_MAXSIZE))
+#endif
+
+#if defined DOSISH || defined __CYGWIN__
+static inline void
+translit_char(char *p, int from, int to)
+{
+ while (*p) {
+ if ((unsigned char)*p == from)
+ *p = to;
+ p = CharNext(p);
+ }
+}
+#endif
+
#endif /* RUBY_EVAL_INTERN_H */