ObjFW  Check-in [13f4c6c678]

Overview
Comment:Add OF_DEALLOC_UNSUPPORTED macro
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 13f4c6c67821ab36c6643590481d34b5a09606cd5b12cbfe0a4cc54b821147c0
User & Date: js on 2016-09-12 00:27:14
Other Links: manifest | tags
Context
2016-10-08
15:57
Explicitly cast objc_msgSend check-in: bc64c479a8 user: js tags: trunk
2016-09-12
00:27
Add OF_DEALLOC_UNSUPPORTED macro check-in: 13f4c6c678 user: js tags: trunk
00:10
of_strptime: Fix parsing of %b check-in: 99158f978b user: js tags: trunk
Changes

Modified configure.ac from [c4ce7cdd7f] to [09d5d7268f].

152
153
154
155
156
157
158


159
160
161
162
163
164
165
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167







+
+







	[OBJCFLAGS="$OBJCFLAGS -Wshorten-64-to-32"])
AX_CHECK_COMPILER_FLAGS(-Wsemicolon-before-method-body -Werror,
	[OBJCFLAGS="$OBJCFLAGS -Wsemicolon-before-method-body"])
AX_CHECK_COMPILER_FLAGS(-Wobjc-missing-property-synthesis -Werror,
	[OBJCFLAGS="$OBJCFLAGS -Wobjc-missing-property-synthesis"])
AX_CHECK_COMPILER_FLAGS(-Wsign-compare -Werror,
	[OBJCFLAGS="$OBJCFLAGS -Wsign-compare"])
AX_CHECK_COMPILER_FLAGS(-Wunreachable-code -Werror,
	[OBJCFLAGS="$OBJCFLAGS -Wunreachable-code"])

AC_MSG_CHECKING(whether Objective C compiler supports properties)
AC_TRY_COMPILE([
	@interface Foo
	{
		id bar;
	}

Modified src/OFArray.m from [b96b2adef7] to [363adf6612].

105
106
107
108
109
110
111
112
113

114
115
116
117
118
119
120
121
122
105
106
107
108
109
110
111


112


113
114
115
116
117
118
119







-
-
+
-
-








- (void)release
{
}

- (void)dealloc
{
	OF_UNRECOGNIZED_SELECTOR

	OF_DEALLOC_UNSUPPORTED
	/* Get rid of a stupid warning */
	[super dealloc];
}
@end

@implementation OFArray
+ (void)initialize
{
	if (self == [OFArray class])

Modified src/OFBlock.m from [ce186b9740] to [a5bedf0289].

447
448
449
450
451
452
453
454
455

456
457
458
459
447
448
449
450
451
452
453


454


455
456







-
-
+
-
-


{
	if (object_getClass(self) == (Class)&_NSConcreteMallocBlock)
		Block_release(self);
}

- (void)dealloc
{
	OF_UNRECOGNIZED_SELECTOR

	OF_DEALLOC_UNSUPPORTED
	/* Get rid of a stupid warning */
	[super dealloc];
}
@end

Modified src/OFConstantString.m from [25ba828e39] to [e1f8d85588].

100
101
102
103
104
105
106
107
108

109
110
111
112
113
114
115
116
117
100
101
102
103
104
105
106


107


108
109
110
111
112
113
114







-
-
+
-
-








- (void)release
{
}

- (void)dealloc
{
	OF_UNRECOGNIZED_SELECTOR

	OF_DEALLOC_UNSUPPORTED
	/* Get rid of a stupid warning */
	[super dealloc];
}
@end

@implementation OFConstantString
+ (void)load
{
#if defined(OF_APPLE_RUNTIME) && !defined(__OBJC2__)
219
220
221
222
223
224
225
226
227

228
229
230
231
232
233
234
235
236
216
217
218
219
220
221
222


223


224
225
226
227
228
229
230







-
-
+
-
-








- (void)release
{
}

- (void)dealloc
{
	OF_UNRECOGNIZED_SELECTOR

	OF_DEALLOC_UNSUPPORTED
	/* Get rid of a stupid warning */
	[super dealloc];
}

/*
 * In all following methods, the constant string is converted to an
 * OFString_UTF8 and the message sent again.
 */

Modified src/OFCountedSet.m from [0fe79da407] to [43d97d6138].

92
93
94
95
96
97
98
99
100

101
102
103
104
105
106
107
108
109
92
93
94
95
96
97
98


99


100
101
102
103
104
105
106







-
-
+
-
-








- (void)release
{
}

- (void)dealloc
{
	OF_UNRECOGNIZED_SELECTOR

	OF_DEALLOC_UNSUPPORTED
	/* Get rid of a stupid warning */
	[super dealloc];
}
@end

@implementation OFCountedSet
+ (void)initialize
{
	if (self == [OFCountedSet class])

Modified src/OFDictionary.m from [034710c781] to [3f825e393b].

116
117
118
119
120
121
122
123
124

125
126
127
128
129
130
131
132
133
116
117
118
119
120
121
122


123


124
125
126
127
128
129
130







-
-
+
-
-








- (void)release
{
}

- (void)dealloc
{
	OF_UNRECOGNIZED_SELECTOR

	OF_DEALLOC_UNSUPPORTED
	/* Get rid of a stupid warning */
	[super dealloc];
}
@end

@implementation OFDictionary
+ (void)initialize
{
	if (self == [OFDictionary class])

Modified src/OFMutableArray.m from [e4d2b4619e] to [59239c1ec5].

144
145
146
147
148
149
150
151
152

153
154
155
156
157
158
159
160
161
144
145
146
147
148
149
150


151


152
153
154
155
156
157
158







-
-
+
-
-








- (void)release
{
}

- (void)dealloc
{
	OF_UNRECOGNIZED_SELECTOR

	OF_DEALLOC_UNSUPPORTED
	/* Get rid of a stupid warning */
	[super dealloc];
}
@end

@implementation OFMutableArray
+ (void)initialize
{
	if (self == [OFMutableArray class])

Modified src/OFMutableDictionary.m from [b571ce2a18] to [df17c135f5].

112
113
114
115
116
117
118
119
120

121
122
123
124
125
126
127
128
129
112
113
114
115
116
117
118


119


120
121
122
123
124
125
126







-
-
+
-
-








- (void)release
{
}

- (void)dealloc
{
	OF_UNRECOGNIZED_SELECTOR

	OF_DEALLOC_UNSUPPORTED
	/* Get rid of a stupid warning */
	[super dealloc];
}
@end

@implementation OFMutableDictionary
+ (void)initialize
{
	if (self == [OFMutableDictionary class])

Modified src/OFMutableSet.m from [fd9f446d87] to [3c0b71dcbf].

96
97
98
99
100
101
102
103
104

105
106
107
108
109
110
111
112
113
96
97
98
99
100
101
102


103


104
105
106
107
108
109
110







-
-
+
-
-








- (void)release
{
}

- (void)dealloc
{
	OF_UNRECOGNIZED_SELECTOR

	OF_DEALLOC_UNSUPPORTED
	/* Get rid of a stupid warning */
	[super dealloc];
}
@end

@implementation OFMutableSet
+ (void)initialize
{
	if (self == [OFMutableSet class])

Modified src/OFMutableString.m from [7c949926c1] to [29e52abbc7].

230
231
232
233
234
235
236
237
238

239
240
241
242
243
244
245
246
247
230
231
232
233
234
235
236


237


238
239
240
241
242
243
244







-
-
+
-
-








- (void)release
{
}

- (void)dealloc
{
	OF_UNRECOGNIZED_SELECTOR

	OF_DEALLOC_UNSUPPORTED
	/* Get rid of a stupid warning */
	[super dealloc];
}
@end

@implementation OFMutableString
+ (void)initialize
{
	if (self == [OFMutableString class])

Modified src/OFNull.m from [f14e01c2e8] to [6d702059e0].

129
130
131
132
133
134
135
136
137

138
139
140
141
129
130
131
132
133
134
135


136


137
138







-
-
+
-
-


- (unsigned int)retainCount
{
	return OF_RETAIN_COUNT_MAX;
}

- (void)dealloc
{
	OF_UNRECOGNIZED_SELECTOR

	OF_DEALLOC_UNSUPPORTED
	/* Get rid of a stupid warning */
	[super dealloc];
}
@end

Modified src/OFSet.m from [44df76d02e] to [5ab931318f].

92
93
94
95
96
97
98
99
100

101
102
103
104
105
106
107
108
109
92
93
94
95
96
97
98


99


100
101
102
103
104
105
106







-
-
+
-
-








- (void)release
{
}

- (void)dealloc
{
	OF_UNRECOGNIZED_SELECTOR

	OF_DEALLOC_UNSUPPORTED
	/* Get rid of a stupid warning */
	[super dealloc];
}
@end

@implementation OFSet
+ (void)initialize
{
	if (self == [OFSet class])

Modified src/OFStdIOStream.m from [3491f0262a] to [9d5e101a97].

198
199
200
201
202
203
204
205
206

207
208
209
210
198
199
200
201
202
203
204


205


206
207







-
-
+
-
-


- (unsigned int)retainCount
{
	return OF_RETAIN_COUNT_MAX;
}

- (void)dealloc
{
	OF_UNRECOGNIZED_SELECTOR

	OF_DEALLOC_UNSUPPORTED
	/* Get rid of a stupid warning */
	[super dealloc];
}
@end

Modified src/OFString.m from [719f50f06e] to [d7680287a6].

489
490
491
492
493
494
495
496
497

498
499
500
501
502
503
504
505
506
489
490
491
492
493
494
495


496


497
498
499
500
501
502
503







-
-
+
-
-








- (void)release
{
}

- (void)dealloc
{
	OF_UNRECOGNIZED_SELECTOR

	OF_DEALLOC_UNSUPPORTED
	/* Get rid of a stupid warning */
	[super dealloc];
}
@end

@implementation OFString
+ (void)initialize
{
	if (self == [OFString class])

Modified src/exceptions/OFAllocFailedException.m from [6b087a6124] to [30de3d682b].

76
77
78
79
80
81
82
83
84

85
86
87
88
89
90
91
92
93
76
77
78
79
80
81
82


83


84
85
86
87
88
89
90







-
-
+
-
-








- (void)release
{
}

- (void)dealloc
{
	OF_UNRECOGNIZED_SELECTOR

	OF_DEALLOC_UNSUPPORTED
	/* Get rid of a stupid warning */
	[super dealloc];
}

- (OFString*)description
{
	return @"Allocating an object failed!";
}
@end

Modified src/macros.h from [a0cafa1d2d] to [54a3501810].

317
318
319
320
321
322
323

















324
325
326
327
328
329
330
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







	} @catch (id e) {				\
		[self release];				\
		@throw e;				\
	}						\
							\
	abort();
#endif
#ifdef __clang__
# define OF_DEALLOC_UNSUPPORTED						\
	[self doesNotRecognizeSelector: _cmd];				\
									\
	abort();							\
									\
	_Pragma("clang diagnostic push ignore \"-Wunreachable-code\"");	\
	[super dealloc];	/* Get rid of a stupid warning */	\
	_Pragma("clang diagnostic pop");
#else
# define OF_DEALLOC_UNSUPPORTED						\
	[self doesNotRecognizeSelector: _cmd];				\
									\
	abort();							\
									\
	[super dealloc];	/* Get rid of a stupid warning */
#endif

#ifdef __cplusplus
extern "C" {
#endif
extern id objc_getProperty(id, SEL, ptrdiff_t, BOOL);
extern void objc_setProperty(id, SEL, ptrdiff_t, id, BOOL, signed char);
#ifdef __cplusplus