ObjFW  Diff

Differences From Artifact [5232ed313d]:

To Artifact [55432953fa]:

  • File src/exceptions/OFAddressTranslationFailedException.m — part of check-in [48980f2297] at 2015-11-29 11:43:05 on branch trunk — Make properties a requirement and clean up code

    This increases the required GCC version from 4.0 to 4.6 (exception:
    Apple GCC, which already supports this with >= 4.0 starting with OS X
    10.5). Since even GCC 4.6 is really old by now, there is no point in
    still supporting something even older and making the code ugly because
    of that. While some hardware and OS support was dropped from GCC 4.6
    compared to GCC 4.0, there is nothing in there that would be an
    interesting target with the exception of BeOS maybe - but a port to BeOS
    can also be achieved using the Haiku support. The other dropped OSes are
    mostly old versions of OSes while newer ones are still being supported
    (and those newer versions of those OSes still support the same
    hardware). (user: js, size: 3755) [annotate] [blame] [check-ins using]


28
29
30
31
32
33
34


35
36
37
38
39
40
41
#if !defined(HAVE_THREADSAFE_GETADDRINFO) && defined(OF_HAVE_THREADS)
# include "threading.h"

static of_mutex_t mutex;
#endif

@implementation OFAddressTranslationFailedException


#if !defined(HAVE_THREADSAFE_GETADDRINFO) && defined(OF_HAVE_THREADS)
+ (void)initialize
{
	if (self != [OFAddressTranslationFailedException class])
		return;

	if (!of_mutex_new(&mutex))







>
>







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#if !defined(HAVE_THREADSAFE_GETADDRINFO) && defined(OF_HAVE_THREADS)
# include "threading.h"

static of_mutex_t mutex;
#endif

@implementation OFAddressTranslationFailedException
@synthesize host = _host;

#if !defined(HAVE_THREADSAFE_GETADDRINFO) && defined(OF_HAVE_THREADS)
+ (void)initialize
{
	if (self != [OFAddressTranslationFailedException class])
		return;

	if (!of_mutex_new(&mutex))
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
		[self release];
		@throw e;
	}

	return self;
}

- initWithHost: (OFString*)host
	 error: (int)error
{
	self = [super init];

	@try {
		_host = [host copy];
		_error = error;
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- initWithError: (int)error
{
	self = [super init];

	_error = error;

	return self;
}







|
|














|







72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
		[self release];
		@throw e;
	}

	return self;
}

- (instancetype)initWithHost: (OFString*)host
		       error: (int)error
{
	self = [super init];

	@try {
		_host = [host copy];
		_error = error;
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (instancetype)initWithError: (int)error
{
	self = [super init];

	_error = error;

	return self;
}
165
166
167
168
169
170
171
172
173
174
175
176
177
		if (!of_mutex_unlock(&mutex))
			@throw [OFUnlockFailedException exception];
	}
#  endif
# endif
#endif
}

- (OFString*)host
{
	OF_GETTER(_host, true)
}
@end







<
<
<
<
<

167
168
169
170
171
172
173





174
		if (!of_mutex_unlock(&mutex))
			@throw [OFUnlockFailedException exception];
	}
#  endif
# endif
#endif
}





@end