ObjFW  Check-in [a77925dfb6]

Overview
Comment:It seems id is already defined by clang and newer GCCs.
This fixes the checks for clang.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: a77925dfb6c4e3f6ed01f8bc4644c15b7ad3a2d68944039a2e8a3783015eb78a
User & Date: js on 2011-03-21 14:21:24
Other Links: manifest | tags
Context
2011-03-21
14:38
Move a few methods to OFObject protocol. check-in: 41cd31363f user: js tags: trunk
14:21
It seems id is already defined by clang and newer GCCs.
This fixes the checks for clang.
check-in: a77925dfb6 user: js tags: trunk
13:26
Make use of optional protocols, if available. check-in: 0c9206532f user: js tags: trunk
Changes

Modified configure.ac from [cccd534606] to [fa42e0339c].

30
31
32
33
34
35
36
37
38
39
40
41
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
])
AC_SUBST(NO_CONST_CFSTRINGS)

AC_MSG_CHECKING(whether Objective C compiler supports fast enumeration)
AC_TRY_COMPILE([
	@protocol OFFastEnumeration
	- (int)countByEnumeratingWithState: (void*)state
				   objects: (struct objc_object**)objects
				     count: (int)count;
	@end
], [
	struct objc_object *n = (struct objc_object*)0;
	for (struct objc_object *i in n);
], [
	AC_DEFINE(OF_HAVE_FAST_ENUMERATION, 1,
		[Compiler support for Fast Enumeration])
	AC_MSG_RESULT(yes)
], [
	AC_MSG_RESULT(no)
])

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

	@property (retain, nonatomic) struct objc_object *bar;
	@end
], [
	Foo *foo = (struct objc_object*)0;
	[foo setBar: (struct objc_object*)0];
	[foo bar];
], [
	AC_DEFINE(OF_HAVE_PROPERTIES, 1, [Compiler support for properties])
	AC_SUBST(PROPERTIESTESTS_M, "PropertiesTests.m")
	AC_MSG_RESULT(yes)
], [
	AC_MSG_RESULT(no)







|



|
|















|


|
|







30
31
32
33
34
35
36
37
38
39
40
41
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
])
AC_SUBST(NO_CONST_CFSTRINGS)

AC_MSG_CHECKING(whether Objective C compiler supports fast enumeration)
AC_TRY_COMPILE([
	@protocol OFFastEnumeration
	- (int)countByEnumeratingWithState: (void*)state
				   objects: (id*)objects
				     count: (int)count;
	@end
], [
	id n = (id)0;
	for (id i in n);
], [
	AC_DEFINE(OF_HAVE_FAST_ENUMERATION, 1,
		[Compiler support for Fast Enumeration])
	AC_MSG_RESULT(yes)
], [
	AC_MSG_RESULT(no)
])

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

	@property (retain, nonatomic) id bar;
	@end
], [
	Foo *foo = (id)0;
	[foo setBar: (id)0];
	[foo bar];
], [
	AC_DEFINE(OF_HAVE_PROPERTIES, 1, [Compiler support for properties])
	AC_SUBST(PROPERTIESTESTS_M, "PropertiesTests.m")
	AC_MSG_RESULT(yes)
], [
	AC_MSG_RESULT(no)