2 * Copyright (c) 2008 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 Copyright 2005-2007, Apple Inc. All rights reserved.
27 #if !defined(AUTO_STUBS_H)
28 #define AUTO_STUBS_H 1
33 #include <malloc/malloc.h>
34 #include <objc/objc.h>
36 /* Stubs for functions in libauto. */
38 typedef malloc_zone_t auto_zone_t
;
40 enum { AUTO_TYPE_UNKNOWN
= -1, AUTO_UNSCANNED
= 1, AUTO_OBJECT
= 2, AUTO_MEMORY_SCANNED
= 0, AUTO_MEMORY_UNSCANNED
= AUTO_UNSCANNED
, AUTO_OBJECT_SCANNED
= AUTO_OBJECT
, AUTO_OBJECT_UNSCANNED
= AUTO_OBJECT
| AUTO_UNSCANNED
};
41 typedef unsigned long auto_memory_type_t
;
43 CF_INLINE
void *auto_zone(void) { return 0; }
44 CF_INLINE
void *auto_zone_allocate_object(void *zone
, size_t size
, auto_memory_type_t type
, boolean_t rc
, boolean_t clear
) { return 0; }
45 CF_INLINE
const void *auto_zone_base_pointer(void *zone
, const void *ptr
) { return 0; }
46 CF_INLINE
void auto_zone_retain(void *zone
, void *ptr
) {}
47 CF_INLINE
unsigned int auto_zone_release(void *zone
, void *ptr
) { return 0; }
48 CF_INLINE
unsigned int auto_zone_retain_count(void *zone
, const void *ptr
) { return 0; }
49 CF_INLINE
void auto_zone_set_layout_type(void *zone
, void *ptr
, auto_memory_type_t type
) {}
50 CF_INLINE
void auto_zone_write_barrier_range(void *zone
, void *address
, size_t size
) {}
51 CF_INLINE boolean_t
auto_zone_is_finalized(void *zone
, const void *ptr
) { return 0; }
52 CF_INLINE
size_t auto_zone_size(void *zone
, const void *ptr
) { return 0; }
53 CF_INLINE
void auto_register_weak_reference(void *zone
, const void *referent
, void **referrer
, uintptr_t *counter
, void **listHead
, void **listElement
) {}
54 CF_INLINE
void auto_unregister_weak_reference(void *zone
, const void *referent
, void **referrer
) {}
55 CF_INLINE
void auto_zone_register_thread(void *zone
) {}
56 CF_INLINE
void auto_zone_unregister_thread(void *zone
) {}
57 CF_INLINE boolean_t
auto_zone_is_valid_pointer(void *zone
, const void *ptr
) { return 0; }
58 CF_INLINE auto_memory_type_t
auto_zone_get_layout_type(auto_zone_t
*zone
, void *ptr
) { return AUTO_UNSCANNED
; }
60 CF_INLINE
void objc_collect_if_needed(unsigned long options
) {}
61 CF_INLINE BOOL
objc_collecting_enabled(void) { return 0; }
62 CF_INLINE id
objc_allocate_object(Class cls
, int extra
) { return 0; }
63 CF_INLINE id
objc_assign_strongCast(id val
, id
*dest
) { return (*dest
= val
); }
64 CF_INLINE id
objc_assign_global(id val
, id
*dest
) { return (*dest
= val
); }
65 CF_INLINE id
objc_assign_ivar(id val
, id dest
, unsigned int offset
) { id
*d
= (id
*)((char *)dest
+ offset
); return (*d
= val
); }
66 CF_INLINE
void *objc_memmove_collectable(void *dst
, const void *src
, size_t size
) { return memmove(dst
, src
, size
); }
67 CF_INLINE BOOL
objc_is_finalized(void *ptr
) { return 0; }
69 #endif /* ! AUTO_STUBS_H */