ObjFW  Diff

Differences From Artifact [0f6e6aa5d7]:

To Artifact [ec9da598dc]:


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# include <sched.h>
#endif
#include "unistd_wrapper.h"

#include "platform.h"

#ifdef OF_AMIGAOS
# ifdef OF_AMIGAOS4
#  define __USE_INLINE__
#  define __NOLIBBASE__
#  define __NOGLOBALIFACE__
# endif
# include <proto/exec.h>
# include <proto/dos.h>
#endif

#ifdef OF_WII
# define nanosleep ogc_nanosleep
# include <ogcsys.h>







<
<
<
<
<







29
30
31
32
33
34
35





36
37
38
39
40
41
42
# include <sched.h>
#endif
#include "unistd_wrapper.h"

#include "platform.h"

#ifdef OF_AMIGAOS





# include <proto/exec.h>
# include <proto/dos.h>
#endif

#ifdef OF_WII
# define nanosleep ogc_nanosleep
# include <ogcsys.h>
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115

#ifdef OF_HAVE_ATOMIC_OPS
# import "atomic.h"
#endif

#ifdef OF_DJGPP
# define lrint(x) rint(x)
#endif

#ifdef OF_AMIGAOS4
extern struct ExecIFace *IExec;
static struct Library *DOSBase = NULL;
static struct DOSIFace *IDOS = NULL;

OF_DESTRUCTOR()
{
	if (IDOS != NULL)
		DropInterface((struct Interface *)IDOS);

	if (DOSBase != NULL)
		CloseLibrary(DOSBase);
}
#endif

#if defined(OF_HAVE_THREADS)
# import "tlskey.h"

static of_tlskey_t threadSelfKey;
static OFThread *mainThread;







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







82
83
84
85
86
87
88















89
90
91
92
93
94
95

#ifdef OF_HAVE_ATOMIC_OPS
# import "atomic.h"
#endif

#ifdef OF_DJGPP
# define lrint(x) rint(x)















#endif

#if defined(OF_HAVE_THREADS)
# import "tlskey.h"

static of_tlskey_t threadSelfKey;
static OFThread *mainThread;
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
		return nil;

	if (thread->_threadDictionary == nil)
		thread->_threadDictionary = [[OFMutableDictionary alloc] init];

	return thread->_threadDictionary;
}
#elif defined(OF_AMIGAOS4)
+ (void)initialize
{
	if (self != [OFThread class])
		return;

	if ((DOSBase = OpenLibrary("dos.library", 36)) == NULL)
		@throw [OFInitializationFailedException
		    exceptionWithClass: self];

	if ((IDOS = (struct DOSIFace *)
	    GetInterface(DOSBase, "main", 1, NULL)) == NULL)
		@throw [OFInitializationFailedException
		    exceptionWithClass: self];
}
#endif

#ifdef OF_HAVE_SOCKETS
+ (OFDNSResolver *)DNSResolver
{
# ifdef OF_HAVE_THREADS
	OFThread *thread = of_tlskey_get(threadSelfKey);







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







186
187
188
189
190
191
192















193
194
195
196
197
198
199
		return nil;

	if (thread->_threadDictionary == nil)
		thread->_threadDictionary = [[OFMutableDictionary alloc] init];

	return thread->_threadDictionary;
}















#endif

#ifdef OF_HAVE_SOCKETS
+ (OFDNSResolver *)DNSResolver
{
# ifdef OF_HAVE_THREADS
	OFThread *thread = of_tlskey_get(threadSelfKey);