ObjFW  Diff

Differences From Artifact [9c302a662d]:

To Artifact [23e21a638e]:


120
121
122
123
124
125
126
127
128
129




130
131
132
133
134
135
136
	    exceptionWithClass: [object class]
			object: object];
}

void
of_method_not_found(id obj, SEL sel)
{
	fprintf(stderr, "Runtime error: Selector %s is not implemented in "
	    "class %s!\n", sel_getName(sel),
	    class_getName(object_getClass(obj)));




	abort();
}

#ifdef OF_OBJFW_RUNTIME
static IMP
forward_handler(id obj, SEL sel)
{







|
|
<
>
>
>
>







120
121
122
123
124
125
126
127
128

129
130
131
132
133
134
135
136
137
138
139
	    exceptionWithClass: [object class]
			object: object];
}

void
of_method_not_found(id obj, SEL sel)
{
	[obj doesNotRecognizeSelector: sel];


	/*
	 * Just in case doesNotRecognizeSelector: returned, even though it must
	 * never return.
	 */
	abort();
}

#ifdef OF_OBJFW_RUNTIME
static IMP
forward_handler(id obj, SEL sel)
{
972
973
974
975
976
977
978






979
980
981
982
983
984
985
	free(PRE_MEM(pointer));
}

- (id)forwardingTargetForSelector: (SEL)selector
{
	return nil;
}







- retain
{
#if defined(OF_ATOMIC_OPS)
	of_atomic_inc_32(&PRE_IVARS->retainCount);
#elif defined(OF_THREADS)
	OF_ENSURE(of_spinlock_lock(&PRE_IVARS->retainCountSpinlock));







>
>
>
>
>
>







975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
	free(PRE_MEM(pointer));
}

- (id)forwardingTargetForSelector: (SEL)selector
{
	return nil;
}

- (void)doesNotRecognizeSelector: (SEL)selector
{
	@throw [OFNotImplementedException exceptionWithClass: [self class]
						    selector: selector];
}

- retain
{
#if defined(OF_ATOMIC_OPS)
	of_atomic_inc_32(&PRE_IVARS->retainCount);
#elif defined(OF_THREADS)
	OF_ENSURE(of_spinlock_lock(&PRE_IVARS->retainCountSpinlock));
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067

1068
1069
1070
1071
1072
1073
1074
1075
1076
1077

1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089

1090
1091
1092
1093
1094
1095
1096

1097
1098
1099
1100
1101
1102
1103

1104
1105
1106
1107
1108
1109
1110
1111

1112
1113
1114
1115
1116
1117

1118
1119
1120
1121
1122
1123
1124

	free((char*)self - PRE_IVARS_ALIGN);
}

/* Required to use properties with the Apple runtime */
- copyWithZone: (void*)zone
{
	if OF_UNLIKELY (zone != NULL)
		@throw [OFNotImplementedException
		    exceptionWithClass: [self class]
			      selector: _cmd];


	return [(id)self copy];
}

- mutableCopyWithZone: (void*)zone
{
	if OF_UNLIKELY (zone != NULL)
		@throw [OFNotImplementedException
		    exceptionWithClass: [self class]
			      selector: _cmd];


	return [(id)self mutableCopy];
}

/*
 * Those are needed as the root class is the superclass of the root class's
 * metaclass and thus instance methods can be sent to class objects as well.
 */
+ (void*)allocMemoryWithSize: (size_t)size
{
	@throw [OFNotImplementedException exceptionWithClass: self
						    selector: _cmd];

}

+ (void*)allocMemoryWithSize: (size_t)size
		       count: (size_t)count
{
	@throw [OFNotImplementedException exceptionWithClass: self
						    selector: _cmd];

}

+ (void*)resizeMemory: (void*)pointer
		 size: (size_t)size
{
	@throw [OFNotImplementedException exceptionWithClass: self
						    selector: _cmd];

}

+ (void*)resizeMemory: (void*)pointer
		 size: (size_t)size
		count: (size_t)count
{
	@throw [OFNotImplementedException exceptionWithClass: self
						    selector: _cmd];

}

+ (void)freeMemory: (void*)pointer
{
	@throw [OFNotImplementedException exceptionWithClass: self
						    selector: _cmd];

}

+ retain
{
	return self;
}








|
<
|
|
>






|
<
|
|
>










<
|
>





<
|
>





<
|
>






<
|
>




<
|
>







1066
1067
1068
1069
1070
1071
1072
1073

1074
1075
1076
1077
1078
1079
1080
1081
1082
1083

1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096

1097
1098
1099
1100
1101
1102
1103

1104
1105
1106
1107
1108
1109
1110

1111
1112
1113
1114
1115
1116
1117
1118

1119
1120
1121
1122
1123
1124

1125
1126
1127
1128
1129
1130
1131
1132
1133

	free((char*)self - PRE_IVARS_ALIGN);
}

/* Required to use properties with the Apple runtime */
- copyWithZone: (void*)zone
{
	if OF_UNLIKELY (zone != NULL) {

		[self doesNotRecognizeSelector: _cmd];
		abort();
	}

	return [(id)self copy];
}

- mutableCopyWithZone: (void*)zone
{
	if OF_UNLIKELY (zone != NULL) {

		[self doesNotRecognizeSelector: _cmd];
		abort();
	}

	return [(id)self mutableCopy];
}

/*
 * Those are needed as the root class is the superclass of the root class's
 * metaclass and thus instance methods can be sent to class objects as well.
 */
+ (void*)allocMemoryWithSize: (size_t)size
{

	[self doesNotRecognizeSelector: _cmd];
	abort();
}

+ (void*)allocMemoryWithSize: (size_t)size
		       count: (size_t)count
{

	[self doesNotRecognizeSelector: _cmd];
	abort();
}

+ (void*)resizeMemory: (void*)pointer
		 size: (size_t)size
{

	[self doesNotRecognizeSelector: _cmd];
	abort();
}

+ (void*)resizeMemory: (void*)pointer
		 size: (size_t)size
		count: (size_t)count
{

	[self doesNotRecognizeSelector: _cmd];
	abort();
}

+ (void)freeMemory: (void*)pointer
{

	[self doesNotRecognizeSelector: _cmd];
	abort();
}

+ retain
{
	return self;
}

1134
1135
1136
1137
1138
1139
1140
1141
1142

1143
1144
1145
1146
1147
1148

1149
1150
1151
1152
1153
1154

1155
1156

+ (void)release
{
}

+ (void)dealloc
{
	@throw [OFNotImplementedException exceptionWithClass: self
						    selector: _cmd];

}

+ copyWithZone: (void*)zone
{
	@throw [OFNotImplementedException exceptionWithClass: self
						    selector: _cmd];

}

+ mutableCopyWithZone: (void*)zone
{
	@throw [OFNotImplementedException exceptionWithClass: self
						    selector: _cmd];

}
@end







<
|
>




<
|
>




<
|
>


1143
1144
1145
1146
1147
1148
1149

1150
1151
1152
1153
1154
1155

1156
1157
1158
1159
1160
1161

1162
1163
1164
1165

+ (void)release
{
}

+ (void)dealloc
{

	[self doesNotRecognizeSelector: _cmd];
	abort();
}

+ copyWithZone: (void*)zone
{

	[self doesNotRecognizeSelector: _cmd];
	abort();
}

+ mutableCopyWithZone: (void*)zone
{

	[self doesNotRecognizeSelector: _cmd];
	abort();
}
@end