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

ruby-changes:29702

From: nobu <ko1@a...>
Date: Wed, 3 Jul 2013 14:12:13 +0900 (JST)
Subject: [ruby-changes:29702] nobu:r41754 (trunk): dir.c: do_lstat alias

nobu	2013-07-03 14:12:03 +0900 (Wed, 03 Jul 2013)

  New Revision: 41754

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

  Log:
    dir.c: do_lstat alias
    
    * dir.c (do_lstat): make an alias of do_stat instead of two same
      functions, when no lstat is available.

  Modified files:
    trunk/dir.c

Index: dir.c
===================================================================
--- dir.c	(revision 41753)
+++ dir.c	(revision 41754)
@@ -63,10 +63,6 @@ char *strchr(char*,char); https://github.com/ruby/ruby/blob/trunk/dir.c#L63
 
 #include "ruby/util.h"
 
-#if !defined HAVE_LSTAT && !defined lstat
-#define lstat stat
-#endif
-
 /* define system APIs */
 #ifdef _WIN32
 #undef chdir
@@ -1045,6 +1041,7 @@ do_stat(const char *path, struct stat *p https://github.com/ruby/ruby/blob/trunk/dir.c#L1041
     return ret;
 }
 
+#if defined HAVE_LSTAT || defined lstat
 static int
 do_lstat(const char *path, struct stat *pst, int flags)
 {
@@ -1054,6 +1051,9 @@ do_lstat(const char *path, struct stat * https://github.com/ruby/ruby/blob/trunk/dir.c#L1051
 
     return ret;
 }
+#else
+#define do_lstat do_stat
+#endif
 
 static DIR *
 do_opendir(const char *path, int flags, rb_encoding *enc)

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

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