ObjFW  Diff

Differences From Artifact [f4f4a8078d]:

To Artifact [6c6b7a9a76]:


27
28
29
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
#define GET_ERR	     GetLastError()
#define GET_SOCK_ERR WSAGetLastError()
#define ERRFMT	     "Error code was: %d"
#define ERRPARAM     err
#endif

#import <objc/objc-api.h>
#ifdef HAVE_OBJC_RUNTIME_H


#import <objc/runtime.h>

#endif

#import "OFExceptions.h"

#if defined(HAVE_SEL_GET_NAME)
#define SEL_NAME(x) sel_get_name(x)
#elif defined(HAVE_SEL_GETNAME)
#define SEL_NAME(x) sel_getName(x)
#else
#error "You need either sel_get_name() or sel_getName()!"
#endif

#ifndef HAVE_ASPRINTF
#import "asprintf.h"
#endif

@implementation OFException
+ newWithClass: (Class)class_
{







|
>
>

>




<
<
<
<
<
<
<
<







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42








43
44
45
46
47
48
49
#define GET_ERR	     GetLastError()
#define GET_SOCK_ERR WSAGetLastError()
#define ERRFMT	     "Error code was: %d"
#define ERRPARAM     err
#endif

#import <objc/objc-api.h>
#ifdef __objc_INCLUDE_GNU
#define SEL_NAME(x) sel_get_name(x)
#else
#import <objc/runtime.h>
#define SEL_NAME(x) sel_getName(x)
#endif

#import "OFExceptions.h"









#ifndef HAVE_ASPRINTF
#import "asprintf.h"
#endif

@implementation OFException
+ newWithClass: (Class)class_
{
149
150
151
152
153
154
155





























156
157
158
159
160
161
162
}

- (void*)pointer
{
	return pointer;
}
@end






























@implementation OFOutOfRangeException
- (const char*)cString
{
	if (string != NULL)
		return string;








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
}

- (void*)pointer
{
	return pointer;
}
@end

@implementation OFNotImplementedException
+ newWithClass: (Class)class_
   andSelector: (SEL)selector_
{
	return [[self alloc] initWithClass: class_
			       andSelector: selector_];
}

- initWithClass: (Class)class_
    andSelector: (SEL)selector_
{
	if ((self = [super initWithClass: class_]))
		selector = selector_;

	return self;
}

- (const char*)cString
{
	if (string != NULL)
		return string;

	asprintf(&string, "The method %s of class %s is not or not fully "
	    "implemented!", SEL_NAME(selector), [class name]);

	return string;
}
@end

@implementation OFOutOfRangeException
- (const char*)cString
{
	if (string != NULL)
		return string;