]>
git.saurik.com Git - apple/libdispatch.git/blob - src/shims/linux_stubs.h
2 * This source file is part of the Swift.org open source project
4 * Copyright (c) 2015 Apple Inc. and the Swift project authors
6 * Licensed under Apache License v2.0 with Runtime Library Exception
8 * See http://swift.org/LICENSE.txt for license information
9 * See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
13 // forward declarations for functions we are stubbing out
14 // in the intial linux port.
16 #ifndef __DISPATCH__STUBS__INTERNAL
17 #define __DISPATCH__STUBS__INTERNAL
19 #ifndef TAILQ_FOREACH_SAFE
20 #define TAILQ_FOREACH_SAFE(var, head, field, temp) \
21 for ((var) = TAILQ_FIRST((head)); \
22 (var) && ((temp) = TAILQ_NEXT((var), field), 1); (var) = (temp))
27 #define TRASHIT(x) do { (x) = (void *)-1; } while (0)
32 * Stub out defines for some mach types and related macros
35 typedef uint32_t mach_port_t
;
37 #define MACH_PORT_NULL (0)
38 #define MACH_PORT_DEAD (-1)
40 typedef uint32_t mach_error_t
;
42 typedef uint32_t mach_msg_return_t
;
44 typedef uint32_t mach_msg_bits_t
;
46 typedef void *dispatch_mach_msg_t
;
48 typedef uint64_t firehose_activity_id_t
;
50 typedef void *mach_msg_header_t
;
52 // Print a warning when an unported code path executes.
53 #define LINUX_PORT_ERROR() do { \
54 printf("LINUX_PORT_ERROR_CALLED %s:%d: %s\n",\
55 __FILE__,__LINE__,__FUNCTION__); } while (0)
58 * Stub out defines for other missing types
61 // SIZE_T_MAX should not be hardcoded like this here.
63 #define SIZE_T_MAX (~(size_t)0)