* Makefile.direct, mach_dep.c: Add support for NO_GETCONTEXT.
* mach_dep.c: Include signal.h.
* gc_priv.h: Factor out INLINE declaration.
+2008-07-21 Hans Boehm <Hans.Boehm@hp.com>
+ * Makefile.direct, mach_dep.c: Add support for NO_GETCONTEXT.
+ * mach_dep.c: Include signal.h.
+ * gc_priv.h: Factor out INLINE declaration.
+
2008-07-03 Hans Boehm <Hans.Boehm@hp.com> (Really mostly Thiemo Seufer)
* include/private/gcconfig.h: Update MIPS/LINUX config.
# since it will scan inactive but cached NPTL thread stacks completely.
# -DNO_PROC_STAT Causes the collector to avoid relying on Linux'
# /proc/self/stat.
+# -DNO_GETCONTEXT Causes the collector to not assume the existence of
+# the getcontext() function on linux-like platforms. This currently
+# happens implicitly on Darwin, Hurd, or ARM or MIPS hardware.
+# It is explicitly needed for some old versions of FreeBSD.
#
CXXFLAGS= $(CFLAGS)
#if __GNUC__ >= 3
# define EXPECT(expr, outcome) __builtin_expect(expr,outcome)
/* Equivalent to (expr), but predict that usually (expr)==outcome. */
-# define INLINE inline
#else
# define EXPECT(expr, outcome) (expr)
+#endif /* __GNUC__ */
+
+#if __GNUC__ >= 3
+# define INLINE inline
+#else
# define INLINE
#endif /* __GNUC__ */
#endif
#if !defined(HAVE_PUSH_REGS) && defined(UNIX_LIKE)
+# include <signal.h>
# include <ucontext.h>
#endif
+#if defined(UNIX_LIKE) && !defined(NO_GETCONTEXT) && \
+ (defined(DARWIN) || defined(HURD) || defined(ARM32) || defined(MIPS))
+# define NO_GETCONTEXT
+#endif
/* Ensure that either registers are pushed, or callee-save registers */
/* are somewhere on the stack, and then call fn(arg, ctxt). */
/* ctxt is either a pointer to a ucontext_t we generated, or NULL. */
# if defined(HAVE_PUSH_REGS)
GC_push_regs();
-# elif defined(UNIX_LIKE) && !defined(DARWIN) && !defined(ARM32) && \
- !defined(MIPS) && !defined(HURD)
+# elif defined(UNIX_LIKE) && !defined(NO_GETCONTEXT)
/* Older versions of Darwin seem to lack getcontext(). */
/* ARM and MIPS Linux often doesn't support a real */
/* getcontext(). */