aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-01 13:17:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-01 13:17:31 +0000
commit3adadc45b2f6b3b72172d8bae705b0f8a8002f50 (patch)
tree29cecb01a57b2092e6534a96fe976fffbe0aa895
parent4f407a4a493698802981ffe910a3cbbdd11d6e2f (diff)
downloadruby-3adadc45b2f6b3b72172d8bae705b0f8a8002f50.tar.gz
string.c: fallback to crypt_r
* string.c: prefer crypt_r to crypt iff system crypt nor crypt_r are not provided. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--string.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/string.c b/string.c
index 711fd9c39e..ad4a115c42 100644
--- a/string.c
+++ b/string.c
@@ -29,8 +29,11 @@
#include <unistd.h>
#endif
-#ifdef HAVE_CRYPT_R
-#include <crypt.h>
+#if defined HAVE_CRYPT_R
+# include <crypt.h>
+#elif !defined HAVE_CRYPT
+# include "missing/crypt.h"
+# define HAVE_CRYPT_R 1
#endif
#define STRING_ENUMERATORS_WANTARRAY 0 /* next major */