|
| 1 | + |
| 2 | +#ifndef __OS_LINUX_BASE__ |
| 3 | +#define __OS_LINUX_BASE__ |
| 4 | + |
| 5 | + |
| 6 | +// marker for hacks we have made to make progress |
| 7 | +#define __LINUX_PORT_HDD__ 1 |
| 8 | + |
| 9 | +/* |
| 10 | + * Stub out defines for some mach types and related macros |
| 11 | + */ |
| 12 | + |
| 13 | +typedef uint32_t mach_port_t; |
| 14 | + |
| 15 | +#define MACH_PORT_NULL 0 |
| 16 | +#define MACH_PORT_DEAD -1 |
| 17 | + |
| 18 | + |
| 19 | +typedef uint32_t mach_error_t; |
| 20 | + |
| 21 | +typedef uint32_t dispatch_mach_msg_t; |
| 22 | + |
| 23 | +typedef uint32_t dispatch_mach_t; |
| 24 | + |
| 25 | +typedef uint32_t dispatch_mach_reason_t; |
| 26 | + |
| 27 | +typedef uint32_t mach_vm_size_t; |
| 28 | + |
| 29 | +typedef uintptr_t mach_vm_address_t; |
| 30 | + |
| 31 | +typedef struct |
| 32 | +{ |
| 33 | +} mach_msg_header_t; |
| 34 | + |
| 35 | + |
| 36 | +typedef void (*dispatch_mach_handler_function_t)(void*); |
| 37 | +typedef void (*dispatch_mach_msg_destructor_t)(void*); |
| 38 | + |
| 39 | +/* |
| 40 | + * Stub out defines for other missing types |
| 41 | + */ |
| 42 | + |
| 43 | +struct kevent64_s |
| 44 | +{ |
| 45 | +}; |
| 46 | + |
| 47 | +/* |
| 48 | + * Stub out misc linking and compilation attributes |
| 49 | + */ |
| 50 | + |
| 51 | +#ifdef OS_EXPORT |
| 52 | +#undef OS_EXPORT |
| 53 | +#endif |
| 54 | +#define OS_EXPORT |
| 55 | + |
| 56 | +#ifdef DISPATCH_EXPORT |
| 57 | +#undef DISPATCH_EXPORT |
| 58 | +#endif |
| 59 | +#define DISPATCH_EXPORT |
| 60 | + |
| 61 | +#ifdef DISPATCH_NONNULL_ALL |
| 62 | +#undef DISPATCH_NONNULL_ALL |
| 63 | +#endif |
| 64 | +#define DISPATCH_NONNULL_ALL |
| 65 | + |
| 66 | +#ifdef OS_WARN_RESULT_NEEDS_RELEASE |
| 67 | +#undef OS_WARN_RESULT_NEEDS_RELEASE |
| 68 | +#endif |
| 69 | + |
| 70 | +#ifdef OS_WARN_RESULT |
| 71 | +#undef OS_WARN_RESULT |
| 72 | +#endif |
| 73 | +#define OS_WARN_RESULT |
| 74 | + |
| 75 | +#ifdef OS_NOTHROW |
| 76 | +#undef OS_NOTHROW |
| 77 | +#endif |
| 78 | +#define OS_NOTHROW |
| 79 | + |
| 80 | + |
| 81 | +// NOTE (Dave), these and similar macros come from Availabity.h on OS X |
| 82 | +#define __OSX_AVAILABLE_BUT_DEPRECATED(a,b,c,d) // |
| 83 | +#define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(a,b,c,d,msg) // |
| 84 | + |
| 85 | + |
| 86 | +// Print a warning when an unported code path executes. |
| 87 | +#define LINUX_PORT_ERROR() do { printf("LINUX_PORT_ERROR_CALLED %s:%d: %s\n",__FILE__,__LINE__,__FUNCTION__); } while (0) |
| 88 | + |
| 89 | + |
| 90 | +// Functions we are stubbing out |
| 91 | +#include<os/stubs.h> |
| 92 | + |
| 93 | + |
| 94 | +#endif /* __OS_LINUX_BASE__ */ |
0 commit comments