ruby-changes:50377
From: nobu <ko1@a...>
Date: Tue, 20 Feb 2018 16:51:28 +0900 (JST)
Subject: [ruby-changes:50377] nobu:r62493 (trunk): mjit.c: fix compile error
nobu 2018-02-20 16:51:22 +0900 (Tue, 20 Feb 2018) New Revision: 62493 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62493 Log: mjit.c: fix compile error * mjit.c (check_tmpdir): W_OK and S_ISDIR may not defined on Windows. Modified files: trunk/mjit.c Index: mjit.c =================================================================== --- mjit.c (revision 62492) +++ mjit.c (revision 62493) @@ -1268,6 +1268,9 @@ check_tmpdir(const char *dir) https://github.com/ruby/ruby/blob/trunk/mjit.c#L1268 if (!dir) return FALSE; if (stat(dir, &st)) return FALSE; +#ifndef S_ISDIR +# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +#endif if (!S_ISDIR(st.st_mode)) return FALSE; #ifndef _WIN32 # ifndef S_IWOTH @@ -1280,8 +1283,9 @@ check_tmpdir(const char *dir) https://github.com/ruby/ruby/blob/trunk/mjit.c#L1283 return FALSE; # endif } + if (access(dir, W_OK)) return FALSE; #endif - return access(dir, W_OK) == 0; + return TRUE; } static char * -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/