ruby-changes:33533
From: nobu <ko1@a...>
Date: Thu, 17 Apr 2014 17:24:23 +0900 (JST)
Subject: [ruby-changes:33533] nobu:r45614 (trunk): ruby.c: drop older cygwin
nobu 2014-04-17 17:24:15 +0900 (Thu, 17 Apr 2014) New Revision: 45614 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45614 Log: ruby.c: drop older cygwin * ruby.c (push_include_cygwin): drop older cygwin support. * ruby.c (ruby_init_loadpath_safe): ditto, and always use String as libpath buffer on Windows. Modified files: trunk/ruby.c Index: ruby.c =================================================================== --- ruby.c (revision 45613) +++ ruby.c (revision 45614) @@ -257,8 +257,7 @@ push_include_cygwin(const char *path, VA https://github.com/ruby/ruby/blob/trunk/ruby.c#L257 #define CONV_TO_POSIX_PATH(p, lib) \ cygwin_conv_path(CCP_WIN_A_TO_POSIX|CCP_RELATIVE, (p), (lib), sizeof(lib)) #else -#define CONV_TO_POSIX_PATH(p, lib) \ - cygwin_conv_to_posix_path((p), (lib)) +# error no cygwin_conv_path #endif if (CONV_TO_POSIX_PATH(p, rubylib) == 0) p = rubylib; @@ -348,7 +347,7 @@ ruby_init_loadpath_safe(int safe_level) https://github.com/ruby/ruby/blob/trunk/ruby.c#L347 extern const char ruby_initial_load_paths[]; const char *paths = ruby_initial_load_paths; #if defined LOAD_RELATIVE -# if defined HAVE_DLADDR || defined HAVE_CYGWIN_CONV_PATH +# if defined HAVE_DLADDR || defined __CYGWIN__ || defined _WIN32 # define VARIABLE_LIBPATH 1 # else # define VARIABLE_LIBPATH 0 @@ -363,13 +362,9 @@ ruby_init_loadpath_safe(int safe_level) https://github.com/ruby/ruby/blob/trunk/ruby.c#L362 char *p; #if defined _WIN32 || defined __CYGWIN__ -# if VARIABLE_LIBPATH sopath = rb_str_new(0, MAXPATHLEN); libpath = RSTRING_PTR(sopath); GetModuleFileName(libruby, libpath, MAXPATHLEN); -# else - GetModuleFileName(libruby, libpath, sizeof libpath); -# endif #elif defined(__EMX__) _execname(libpath, sizeof(libpath) - 1); #elif defined(HAVE_DLADDR) @@ -394,7 +389,6 @@ ruby_init_loadpath_safe(int safe_level) https://github.com/ruby/ruby/blob/trunk/ruby.c#L389 translit_char(libpath, '\\', '/'); #elif defined __CYGWIN__ { -# if VARIABLE_LIBPATH const int win_to_posix = CCP_WIN_A_TO_POSIX | CCP_RELATIVE; size_t newsize = cygwin_conv_path(win_to_posix, libpath, 0, 0); if (newsize > 0) { @@ -406,11 +400,6 @@ ruby_init_loadpath_safe(int safe_level) https://github.com/ruby/ruby/blob/trunk/ruby.c#L400 libpath = p; } } -# else - char rubylib[FILENAME_MAX]; - cygwin_conv_to_posix_path(libpath, rubylib); - strncpy(libpath, rubylib, sizeof(libpath)); -# endif } #endif p = strrchr(libpath, '/'); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/