ObjFW  Check-in [c1b2e3e604]

Overview
Comment:Add __attribute__((sentinel)).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c1b2e3e6047ce199632690b9957aa757141e4489ef33ed937e0d65b55693ac72
User & Date: js on 2012-10-12 17:59:35
Other Links: manifest | tags
Context
2012-10-13
18:51
Rename -[appendUTF8String:withLength:]. check-in: e5b31cf72f user: js tags: trunk
2012-10-12
17:59
Add __attribute__((sentinel)). check-in: c1b2e3e604 user: js tags: trunk
2012-10-10
10:16
Provide objc_constructInstance() when necessary. check-in: 16ba7ec477 user: js tags: trunk
Changes

Modified src/OFArray.h from [f0be2224cd] to [3cf581ad26].

65
66
67
68
69
70
71
72
73
74
75
76
77
78
79

/**
 * \brief Creates a new OFArray with the specified objects, terminated by nil.
 *
 * \param firstObject The first object in the array
 * \return A new autoreleased OFArray
 */
+ (instancetype)arrayWithObjects: (id)firstObject, ...;

/**
 * \brief Creates a new OFArray with the objects from the specified array.
 *
 * \param array An array
 * \return A new autoreleased OFArray
 */







|







65
66
67
68
69
70
71
72
73
74
75
76
77
78
79

/**
 * \brief Creates a new OFArray with the specified objects, terminated by nil.
 *
 * \param firstObject The first object in the array
 * \return A new autoreleased OFArray
 */
+ (instancetype)arrayWithObjects: (id)firstObject, ... OF_SENTINEL;

/**
 * \brief Creates a new OFArray with the objects from the specified array.
 *
 * \param array An array
 * \return A new autoreleased OFArray
 */
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114

/**
 * \brief Initializes an OFArray with the specified objects.
 *
 * \param firstObject The first object
 * \return An initialized OFArray
 */
- initWithObjects: (id)firstObject, ...;

/**
 * \brief Initializes an OFArray with the specified object and a va_list.
 *
 * \param firstObject The first object
 * \param arguments A va_list
 * \return An initialized OFArray







|







100
101
102
103
104
105
106
107
108
109
110
111
112
113
114

/**
 * \brief Initializes an OFArray with the specified objects.
 *
 * \param firstObject The first object
 * \return An initialized OFArray
 */
- initWithObjects: (id)firstObject, ... OF_SENTINEL;

/**
 * \brief Initializes an OFArray with the specified object and a va_list.
 *
 * \param firstObject The first object
 * \param arguments A va_list
 * \return An initialized OFArray

Modified src/OFDictionary.h from [29c6aaef45] to [180610d08f].

97
98
99
100
101
102
103
104
105
106
107
108
109
110
111

/**
 * \brief Creates a new OFDictionary with the specified keys objects.
 *
 * \param firstKey The first key
 * \return A new autoreleased OFDictionary
 */
+ (instancetype)dictionaryWithKeysAndObjects: (id)firstKey, ...;

/**
 * \brief Initializes an already allocated OFDictionary.
 *
 * \return An initialized OFDictionary
 */
- init;







|







97
98
99
100
101
102
103
104
105
106
107
108
109
110
111

/**
 * \brief Creates a new OFDictionary with the specified keys objects.
 *
 * \param firstKey The first key
 * \return A new autoreleased OFDictionary
 */
+ (instancetype)dictionaryWithKeysAndObjects: (id)firstKey, ... OF_SENTINEL;

/**
 * \brief Initializes an already allocated OFDictionary.
 *
 * \return An initialized OFDictionary
 */
- init;
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/**
 * \brief Initializes an already allocated OFDictionary with the specified keys
 *	  and objects.
 *
 * \param firstKey The first key
 * \return A new initialized OFDictionary
 */
- initWithKeysAndObjects: (id)firstKey, ...;

/**
 * \brief Initializes an already allocated OFDictionary with the specified key
 *	  and va_list.
 *
 * \param firstKey The first key
 * \param arguments A va_list of the other arguments







|







157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/**
 * \brief Initializes an already allocated OFDictionary with the specified keys
 *	  and objects.
 *
 * \param firstKey The first key
 * \return A new initialized OFDictionary
 */
- initWithKeysAndObjects: (id)firstKey, ... OF_SENTINEL;

/**
 * \brief Initializes an already allocated OFDictionary with the specified key
 *	  and va_list.
 *
 * \param firstKey The first key
 * \param arguments A va_list of the other arguments

Modified src/OFObject.h from [b59326f934] to [7924907748].

42
43
44
45
46
47
48






49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73




74
75
76
77
78
79
80
#elif __STDC_VERSION__ < 199901L
# define restrict
#endif

#ifndef __has_feature
# define __has_feature(x) 0
#endif







#if defined(__clang__)
# define OF_HAVE_PROPERTIES
# define OF_HAVE_OPTIONAL_PROTOCOLS
# define OF_HAVE_FAST_ENUMERATION
#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC__) >= 406
# define OF_HAVE_PROPERTIES
# define OF_HAVE_OPTIONAL_PROTOCOLS
# define OF_HAVE_FAST_ENUMERATION
#endif

#if !__has_feature(objc_instancetype)
# define instancetype id
#endif

#if __has_feature(blocks)
# define OF_HAVE_BLOCKS
#endif

#if __has_feature(objc_bool)
# undef YES
# define YES __objc_yes
# undef NO
# define NO __objc_no
#endif





#if __has_feature(objc_arc)
# define OF_RETURNS_RETAINED __attribute__((ns_returns_retained))
# define OF_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained))
# define OF_RETURNS_INNER_POINTER __attribute__((objc_returns_inner_pointer))
# define OF_CONSUMED __attribute__((ns_consumed))
# define OF_WEAK_UNAVAILABLE __attribute__((objc_arc_weak_unavailable))







>
>
>
>
>
>





|



















>
>
>
>







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#elif __STDC_VERSION__ < 199901L
# define restrict
#endif

#ifndef __has_feature
# define __has_feature(x) 0
#endif

#ifdef __GNUC__
# define __GCC_VERSION__ (__GNUC__ * 100 + __GNUC_MINOR__)
#else
# define __GCC_VERSION__ 0
#endif

#if defined(__clang__)
# define OF_HAVE_PROPERTIES
# define OF_HAVE_OPTIONAL_PROTOCOLS
# define OF_HAVE_FAST_ENUMERATION
#elif __GCC_VERSION__ >= 406
# define OF_HAVE_PROPERTIES
# define OF_HAVE_OPTIONAL_PROTOCOLS
# define OF_HAVE_FAST_ENUMERATION
#endif

#if !__has_feature(objc_instancetype)
# define instancetype id
#endif

#if __has_feature(blocks)
# define OF_HAVE_BLOCKS
#endif

#if __has_feature(objc_bool)
# undef YES
# define YES __objc_yes
# undef NO
# define NO __objc_no
#endif

#if defined(__clang__) || __GCC_VERSION__ >= 406
# define OF_SENTINEL __attribute__((sentinel))
#endif

#if __has_feature(objc_arc)
# define OF_RETURNS_RETAINED __attribute__((ns_returns_retained))
# define OF_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained))
# define OF_RETURNS_INNER_POINTER __attribute__((objc_returns_inner_pointer))
# define OF_CONSUMED __attribute__((ns_consumed))
# define OF_WEAK_UNAVAILABLE __attribute__((objc_arc_weak_unavailable))