ObjFW  Check-in [be8db49635]

Overview
Comment:Remove defines we no longer need

Now that we require GCC >= 4.6, those features are always available.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: be8db496356053a2d984e54b61d59b96dba3445e127c33b9df297a08505b87e2
User & Date: js on 2015-11-29 14:26:44
Other Links: manifest | tags
Context
2015-11-29
18:46
Fix compilation of ObjC++ check-in: 5826fb0441 user: js tags: trunk
14:26
Remove defines we no longer need check-in: be8db49635 user: js tags: trunk
14:23
Clean up class extensions check-in: 2aca549d60 user: js tags: trunk
Changes

Modified Doxyfile from [acb8142762] to [6815d9887c].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
PROJECT_NAME = "ObjFW"
OUTPUT_DIRECTORY = docs/
INPUT = src src/exceptions
FILE_PATTERNS = *.h *.m
HTML_OUTPUT = .
GENERATE_LATEX = NO
HIDE_UNDOC_CLASSES = YES
HIDE_UNDOC_MEMBERS = YES
PREDEFINED = DOXYGEN			\
	     OF_HAVE_BLOCKS		\
	     OF_HAVE_FILES		\
	     OF_HAVE_OPTIONAL_PROTOCOLS	\
	     OF_HAVE_PROPERTIES		\
	     OF_HAVE_SOCKETS		\
	     OF_HAVE_THREADS		\
	     OF_METHOD_NORETURN		\
	     OF_NO_RETURN		\
	     OF_NO_RETURN_FUNC		\
	     OF_SENTINEL		\
	     OF_REQUIRES_SUPER		\
	     OF_RETURNS_RETAINED	\
	     OF_RETURNS_NOT_RETAINED	\
	     OF_RETURNS_INNER_POINTER	\
	     OF_ROOT_CLASS		\
	     OF_CONSUMED		\
	     OF_WEAK_UNAVAILABLE
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
IGNORE_PREFIX = OF of_











<
<


<













1
2
3
4
5
6
7
8
9
10
11


12
13

14
15
16
17
18
19
20
21
22
23
24
25
26
PROJECT_NAME = "ObjFW"
OUTPUT_DIRECTORY = docs/
INPUT = src src/exceptions
FILE_PATTERNS = *.h *.m
HTML_OUTPUT = .
GENERATE_LATEX = NO
HIDE_UNDOC_CLASSES = YES
HIDE_UNDOC_MEMBERS = YES
PREDEFINED = DOXYGEN			\
	     OF_HAVE_BLOCKS		\
	     OF_HAVE_FILES		\


	     OF_HAVE_SOCKETS		\
	     OF_HAVE_THREADS		\

	     OF_NO_RETURN		\
	     OF_NO_RETURN_FUNC		\
	     OF_SENTINEL		\
	     OF_REQUIRES_SUPER		\
	     OF_RETURNS_RETAINED	\
	     OF_RETURNS_NOT_RETAINED	\
	     OF_RETURNS_INNER_POINTER	\
	     OF_ROOT_CLASS		\
	     OF_CONSUMED		\
	     OF_WEAK_UNAVAILABLE
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
IGNORE_PREFIX = OF of_

Modified src/macros.h from [d6041f701d] to [bcbd739063].

97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122

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

#if defined(__clang__) || __GCC_VERSION__ >= 406 || defined(OBJC_NEW_PROPERTIES)
# define OF_HAVE_PROPERTIES
# define OF_HAVE_OPTIONAL_PROTOCOLS
# if defined(__clang__) || __GCC_VERSION__ >= 406 || defined(OF_APPLE_RUNTIME)
#  define OF_HAVE_FAST_ENUMERATION
# endif
# define OF_HAVE_CLASS_EXTENSIONS
# define OF_PRIVATE_CATEGORY
#else
# define OF_PRIVATE_CATEGORY Private
#endif

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

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







<
<
<
<
<
<
<
<
<
<
<
<







97
98
99
100
101
102
103












104
105
106
107
108
109
110

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













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

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

Modified tests/OFArrayTests.m from [a0e388f1bc] to [db4b803ef8].

196
197
198
199
200
201
202
203
204
205
206
207
208
209
210

	[enumerator reset];
	[m[0] removeObjectAtIndex: 0];

	EXPECT_EXCEPTION(@"Detection of mutation during enumeration",
	    OFEnumerationMutationException, [enumerator nextObject])

#ifdef OF_HAVE_FAST_ENUMERATION
	m[0] = [[a[0] mutableCopy] autorelease];
	ok = true;
	i = 0;

	for (OFString *s in m[0]) {
		if (![s isEqual: c_ary[i]])
			ok = false;







<







196
197
198
199
200
201
202

203
204
205
206
207
208
209

	[enumerator reset];
	[m[0] removeObjectAtIndex: 0];

	EXPECT_EXCEPTION(@"Detection of mutation during enumeration",
	    OFEnumerationMutationException, [enumerator nextObject])


	m[0] = [[a[0] mutableCopy] autorelease];
	ok = true;
	i = 0;

	for (OFString *s in m[0]) {
		if (![s isEqual: c_ary[i]])
			ok = false;
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
	} @catch (OFEnumerationMutationException *e) {
		ok = true;
	}

	TEST(@"Detection of mutation during Fast Enumeration", ok)

	[m[0] removeLastObject];
#endif

#ifdef OF_HAVE_BLOCKS
	{
		__block bool ok = true;
		__block size_t count = 0;
		OFArray *cmp = a[0];
		OFMutableArray *a2;







<







238
239
240
241
242
243
244

245
246
247
248
249
250
251
	} @catch (OFEnumerationMutationException *e) {
		ok = true;
	}

	TEST(@"Detection of mutation during Fast Enumeration", ok)

	[m[0] removeLastObject];


#ifdef OF_HAVE_BLOCKS
	{
		__block bool ok = true;
		__block size_t count = 0;
		OFArray *cmp = a[0];
		OFMutableArray *a2;

Modified tests/OFDictionaryTests.m from [9df1f8a4e7] to [3cc771ecbe].

90
91
92
93
94
95
96
97
98
99
100
101
102
103
104

	EXPECT_EXCEPTION(@"Detection of mutation during enumeration",
	    OFEnumerationMutationException, [key_enum nextObject]);

	[dict setObject: values[0]
		 forKey: keys[0]];

#ifdef OF_HAVE_FAST_ENUMERATION
	size_t i = 0;
	bool ok = true;

	for (OFString *key in dict) {
		if (i > 1 || ![key isEqual: keys[i]]) {
			ok = false;
			break;







<







90
91
92
93
94
95
96

97
98
99
100
101
102
103

	EXPECT_EXCEPTION(@"Detection of mutation during enumeration",
	    OFEnumerationMutationException, [key_enum nextObject]);

	[dict setObject: values[0]
		 forKey: keys[0]];


	size_t i = 0;
	bool ok = true;

	for (OFString *key in dict) {
		if (i > 1 || ![key isEqual: keys[i]]) {
			ok = false;
			break;
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
	} @catch (OFEnumerationMutationException *e) {
		ok = true;
	}

	TEST(@"Detection of mutation during Fast Enumeration", ok)

	[dict removeObjectForKey: @""];
#endif

#ifdef OF_HAVE_BLOCKS
	{
		__block size_t i = 0;
		__block bool ok = true;

		[dict enumerateKeysAndObjectsUsingBlock:







<







121
122
123
124
125
126
127

128
129
130
131
132
133
134
	} @catch (OFEnumerationMutationException *e) {
		ok = true;
	}

	TEST(@"Detection of mutation during Fast Enumeration", ok)

	[dict removeObjectForKey: @""];


#ifdef OF_HAVE_BLOCKS
	{
		__block size_t i = 0;
		__block bool ok = true;

		[dict enumerateKeysAndObjectsUsingBlock:

Modified tests/OFListTests.m from [e8f2de8a74] to [c4bfbb1bc1].

119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
	[list removeListObject: [list firstListObject]];

	EXPECT_EXCEPTION(@"Detection of mutation during enumeration",
	    OFEnumerationMutationException, [enumerator nextObject])

	[list prependObject: strings[0]];

#ifdef OF_HAVE_FAST_ENUMERATION
	loe = [list firstListObject];
	i = 0;
	ok = true;

	for (OFString *obj in list) {
		if (![obj isEqual: loe->object])
			ok = false;







<







119
120
121
122
123
124
125

126
127
128
129
130
131
132
	[list removeListObject: [list firstListObject]];

	EXPECT_EXCEPTION(@"Detection of mutation during enumeration",
	    OFEnumerationMutationException, [enumerator nextObject])

	[list prependObject: strings[0]];


	loe = [list firstListObject];
	i = 0;
	ok = true;

	for (OFString *obj in list) {
		if (![obj isEqual: loe->object])
			ok = false;
149
150
151
152
153
154
155
156
157
158
159
160
			[list removeListObject: [list lastListObject]];
		}
	} @catch (OFEnumerationMutationException *e) {
		ok = true;
	}

	TEST(@"Detection of mutation during Fast Enumeration", ok)
#endif

	[pool drain];
}
@end







<




148
149
150
151
152
153
154

155
156
157
158
			[list removeListObject: [list lastListObject]];
		}
	} @catch (OFEnumerationMutationException *e) {
		ok = true;
	}

	TEST(@"Detection of mutation during Fast Enumeration", ok)


	[pool drain];
}
@end

Modified tests/OFSetTests.m from [ae430dfeb5] to [bc85efc808].

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

@implementation TestsAppDelegate (OFSetTests)
- (void)setTests
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFSet *set1, *set2;
	OFMutableSet *mutableSet;
#ifdef OF_HAVE_FAST_ENUMERATION
	bool ok;
	size_t i;
#endif

	TEST(@"+[setWithArray:]",
	    (set1 = [OFSet setWithArray: [OFArray arrayWithObjects: @"foo",
	    @"bar", @"baz", @"foo", @"x", nil]]))

	TEST(@"+[setWithObjects:]",
	    (set2 = [OFSet setWithObjects: @"foo", @"bar", @"baz", @"bar", @"x",







<


<







28
29
30
31
32
33
34

35
36

37
38
39
40
41
42
43

@implementation TestsAppDelegate (OFSetTests)
- (void)setTests
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFSet *set1, *set2;
	OFMutableSet *mutableSet;

	bool ok;
	size_t i;


	TEST(@"+[setWithArray:]",
	    (set1 = [OFSet setWithArray: [OFArray arrayWithObjects: @"foo",
	    @"bar", @"baz", @"foo", @"x", nil]]))

	TEST(@"+[setWithObjects:]",
	    (set2 = [OFSet setWithObjects: @"foo", @"bar", @"baz", @"bar", @"x",
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
	    nil]])

	TEST(@"-[unionSet:]",
	    R([mutableSet unionSet: [OFSet setWithObjects: @"x", @"bar",
	    nil]]) && [mutableSet isEqual: [OFSet setWithObjects: @"baz",
	    @"bar", @"x", nil]])

#ifdef OF_HAVE_FAST_ENUMERATION
	ok = true;
	i = 0;

	for (OFString *s in set1) {
		switch (i) {
		case 0:
			if (![s isEqual: @"x"])







<







85
86
87
88
89
90
91

92
93
94
95
96
97
98
	    nil]])

	TEST(@"-[unionSet:]",
	    R([mutableSet unionSet: [OFSet setWithObjects: @"x", @"bar",
	    nil]]) && [mutableSet isEqual: [OFSet setWithObjects: @"baz",
	    @"bar", @"x", nil]])


	ok = true;
	i = 0;

	for (OFString *s in set1) {
		switch (i) {
		case 0:
			if (![s isEqual: @"x"])
128
129
130
131
132
133
134
135
136
137
138
139
		for (OFString *s in mutableSet)
			[mutableSet removeObject: s];
	} @catch (OFEnumerationMutationException *e) {
		ok = true;
	}

	TEST(@"Detection of mutation during Fast Enumeration", ok);
#endif

	[pool drain];
}
@end







<




125
126
127
128
129
130
131

132
133
134
135
		for (OFString *s in mutableSet)
			[mutableSet removeObject: s];
	} @catch (OFEnumerationMutationException *e) {
		ok = true;
	}

	TEST(@"Detection of mutation during Fast Enumeration", ok);


	[pool drain];
}
@end

Modified tests/TestsAppDelegate.m from [8ae7c85a0a] to [3fc0278a36].

368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
	[self serializationTests];
#endif
	[self JSONTests];
#ifdef OF_HAVE_PLUGINS
	[self pluginTests];
#endif
	[self forwardingTests];
#ifdef OF_HAVE_PROPERTIES
	[self propertiesTests];
#endif

#if defined(OF_WII)
	[self outputString: @"Press home button to exit!\n"
		   inColor: NO_COLOR];
	for (;;) {
		WPAD_ScanPads();








<

<







368
369
370
371
372
373
374

375

376
377
378
379
380
381
382
	[self serializationTests];
#endif
	[self JSONTests];
#ifdef OF_HAVE_PLUGINS
	[self pluginTests];
#endif
	[self forwardingTests];

	[self propertiesTests];


#if defined(OF_WII)
	[self outputString: @"Press home button to exit!\n"
		   inColor: NO_COLOR];
	for (;;) {
		WPAD_ScanPads();