# define GC_HAIKU_THREADS
# elif defined(__OpenBSD__)
# define GC_OPENBSD_THREADS
-# elif (defined(__FreeBSD__) && !defined(SN_TARGET_ORBIS)) \
- || defined(__DragonFly__)
+# elif defined(__DragonFly__) || defined(__FreeBSD_kernel__) \
+ || (defined(__FreeBSD__) && !defined(SN_TARGET_ORBIS))
# define GC_FREEBSD_THREADS
# elif defined(__NetBSD__)
# define GC_NETBSD_THREADS
/* of compilers. */
/* This may also be desirable if it is possible but expensive to */
/* retrieve the call chain. */
-#if (defined(__linux__) || defined(__NetBSD__) || defined(__OpenBSD__) \
- || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__HAIKU__) \
+#if (defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD__) \
+ || defined(__FreeBSD_kernel__) || defined(__HAIKU__) \
+ || defined(__NetBSD__) || defined(__OpenBSD__) \
|| defined(HOST_ANDROID) || defined(__ANDROID__)) \
&& !defined(GC_CAN_SAVE_CALL_STACKS)
# define GC_ADD_CALLER