summaryrefslogtreecommitdiff
path: root/dln_find.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-24 14:59:13 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-24 14:59:13 (GMT)
commit10ce32c28fc65f1568b99c0e8fcee0e4568a94bf (patch)
treea6aa6bb1015c4042ba47679d9720f70850b52fd5 /dln_find.c
parent69f47dd0e8bd7435ae9b1e8fb94ac6fd8ec06a7a (diff)
dln_find.c: define S_ISREG
* dln_find.c (dln_find_1): on some platforms, S_ISREG() is not provided. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dln_find.c')
-rw-r--r--dln_find.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/dln_find.c b/dln_find.c
index 4e88d4f..bc83b65 100644
--- a/dln_find.c
+++ b/dln_find.c
@@ -278,6 +278,9 @@ dln_find_1(const char *fname, const char *path, char *fbuf, size_t size,
}
#endif /* _WIN32 or __EMX__ */
+#ifndef S_ISREG
+# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+#endif
if (stat(fbuf, &st) == 0 && S_ISREG(st.st_mode)) {
if (exe_flag == 0) return fbuf;
/* looking for executable */