Permalink
Browse files

* configure.in: check for the whether crt_externs.h is present when c…

…ompiling

  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
  • Loading branch information...
1 parent 80b0c6c commit af35f2a61d8027df2e70012ae736f91ee0e41b85 @charliesome charliesome committed Dec 28, 2012
Showing with 42 additions and 5 deletions.
  1. +11 −0 ChangeLog
  2. +6 −0 configure.in
  3. +5 −1 eval_intern.h
  4. +5 −1 hash.c
  5. +8 −0 missing/crt_externs.h
  6. +7 −3 missing/setproctitle.c
View
@@ -1,3 +1,14 @@
+Fri Dec 28 23:12:44 2012 Charlie Somerville <charlie@charliesomerville.com>
+
+ * 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
+
Fri Dec 28 21:40:36 2012 Keiju Ishitsuka <keiju@ishitsuka.com>
* lib/irb/context.rb: IRB::Context#new: Check from JobManager
View
@@ -1220,6 +1220,12 @@ main()
LINK_SO="$LINK_SO
$POSTLINK"
fi
+ AC_CACHE_CHECK(whether crt_externs.h is present for extern macro, rb_cv_crt_externs,
+ [AC_TRY_COMPILE([ #include <crt_externs.h> ], [return 0;],
+ rb_cv_crt_externs=yes, rb_cv_crt_externs=no)])
+ if test "$rb_cv_crt_externs" = yes; then
+ AC_DEFINE(HAVE_CRT_EXTERNS_H)
+ fi
],
[hpux*], [ LIBS="-lm $LIBS"
ac_cv_c_inline=no],
View
@@ -28,7 +28,11 @@
#include <setjmp.h>
#ifdef __APPLE__
-#include <crt_externs.h>
+# ifdef HAVE_CRT_EXTERNS_H
+# include <crt_externs.h>
+# else
+# include "missing/crt_externs.h"
+# endif
#endif
#ifndef HAVE_STRING_H
View
@@ -20,7 +20,11 @@
#include "probes.h"
#ifdef __APPLE__
-#include <crt_externs.h>
+# ifdef HAVE_CRT_EXTERNS_H
+# include <crt_externs.h>
+# else
+# include "missing/crt_externs.h"
+# endif
#endif
static VALUE rb_hash_s_try_convert(VALUE, VALUE);
@@ -0,0 +1,8 @@
+#ifndef MISSING_CRT_EXTERNS_H
+#define MISSING_CRT_EXTERNS_H
+
+char ***_NSGetEnviron();
+#undef environ
+#define environ (*_NSGetEnviron())
+
+#endif
@@ -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 */

0 comments on commit af35f2a

Please sign in to comment.