* include/private/gc_priv.h (DARWIN): Include AvailabilityMacros.h
(unless MAC_OS_X_VERSION_MAX_ALLOWED already defined).
* mach_dep.c (GC_with_callee_saves_pushed): Include sys/ucontext.h
(instead of ucontext.h) if Mac OS X 10.6 or higher.
#endif
#if defined(DARWIN)
+# ifndef MAC_OS_X_VERSION_MAX_ALLOWED
+# include <AvailabilityMacros.h>
+ /* Include this header just to import the above macro. */
+# endif
# if defined(POWERPC)
# if CPP_WORDSZ == 32
# define GC_THREAD_STATE_T ppc_thread_state_t
#if !defined(HAVE_PUSH_REGS) && defined(UNIX_LIKE)
# include <signal.h>
# ifndef NO_GETCONTEXT
-# include <ucontext.h>
+# if defined(DARWIN) \
+ && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 /*MAC_OS_X_VERSION_10_6*/)
+# include <sys/ucontext.h>
+# else
+# include <ucontext.h>
+# endif /* !DARWIN */
# ifdef GETCONTEXT_FPU_EXCMASK_BUG
# include <fenv.h>
# endif