+#if !defined(__APPLE_API_PRIVATE) || !defined(MACH_KERNEL_PRIVATE)
+/*
+ * For kernel code that resides outside of mach
+ * we define empty structs so that everything will
+ * remain strongly typed, without giving out
+ * implementation details.
+ */
+struct ipc_port ;
+
+#endif /* !__APPLE_API_PRIVATE || !MACH_KERNEL_PRIVATE */
+
+typedef struct ipc_port *ipc_port_t;
+typedef ipc_port_t port_t;
+
+#define IPC_PORT_NULL ((ipc_port_t) 0)
+#define IPC_PORT_DEAD ((ipc_port_t)~0)
+#define IPC_PORT_VALID(port) (((port) != IPC_PORT_NULL) && \
+ ((port) != IPC_PORT_DEAD))