summaryrefslogtreecommitdiff
path: root/missing
diff options
context:
space:
mode:
authorcharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-28 14:23:25 +0000
committercharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-28 14:23:25 +0000
commitaf35f2a61d8027df2e70012ae736f91ee0e41b85 (patch)
treefa349978c1ead289859a0ff7f9119a627d09a86a /missing
parent80b0c6ca3b15a621dbbe129f4770c7a2f404eebe (diff)
* configure.in: check for the whether crt_externs.h is present when compiling
for darwin (this header is missing in the iOS SDK) * eval_intern.h: check HAVE_CRT_EXTERNS_H before including crt_externs.h, if not defined, include missing/crt_externs.h instead * hash.c: ditto * missing/setproctitle.c: ditto * missing/crt_externs.h: declare _NSGetEnviron() function and define environ for iOS git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'missing')
-rw-r--r--missing/crt_externs.h8
-rw-r--r--missing/setproctitle.c10
2 files changed, 15 insertions, 3 deletions
diff --git a/missing/crt_externs.h b/missing/crt_externs.h
new file mode 100644
index 0000000000..cc96d46738
--- /dev/null
+++ b/missing/crt_externs.h
@@ -0,0 +1,8 @@
+#ifndef MISSING_CRT_EXTERNS_H
+#define MISSING_CRT_EXTERNS_H
+
+char ***_NSGetEnviron();
+#undef environ
+#define environ (*_NSGetEnviron())
+
+#endif
diff --git a/missing/setproctitle.c b/missing/setproctitle.c
index d35e70d534..9dcf37560b 100644
--- a/missing/setproctitle.c
+++ b/missing/setproctitle.c
@@ -49,9 +49,13 @@
#include <string.h>
#if defined(__APPLE__)
-#include <crt_externs.h>
-#undef environ
-#define environ (*_NSGetEnviron())
+# ifdef HAVE_CRT_EXTERNS_H
+# include <crt_externs.h>
+# undef environ
+# define environ (*_NSGetEnviron())
+# else
+# include "crt_externs.h"
+# endif
#endif
#define SPT_NONE 0 /* don't use it at all */