ObjFW  Check-in [82b11a2992]

Overview
Comment:Partly revert 4a8704e

This actually caused more trouble than it fixed. The real reason was
that _POSIX_TIMERS wasn't defined and thus nanosleep() would not be
declared by time.h. libogc however also provides nanosleep(), but an
incompatible one that we don't really want. So after _POSIX_TIMERS has
been defined, it would actually conflict, as both declarations would be
used then. This removes the special handling for Wii and uses the
nanosleep() from time.h, which has a declaration that is compatible with
POSIX.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 82b11a29923893b118cb0369568ba0418188512b3fd37545e6445e4f26591de7
User & Date: js on 2014-04-08 18:48:57
Other Links: manifest | tags
Context
2014-04-10
00:03
forwarding/*.S: Include config.h check-in: 9a4792a99e user: js tags: trunk
2014-04-08
18:48
Partly revert 4a8704e check-in: 82b11a2992 user: js tags: trunk
17:01
OFArray_adjacent: Optimize fast enumeration check-in: 4dbca9fc06 user: js tags: trunk
Changes

Modified src/OFThread.m from [0049adfd9b] to [21b3bcf0e5].

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# include <sched.h>
#endif

#if defined(OF_HAVE_THREADS) && defined(__HAIKU__)
# include <kernel/OS.h>
#endif

#ifdef __wii__
# define BOOL OGC_BOOL
# define asm __asm__
# include <ogcsys.h>
# undef BOOL
# undef asm
#endif

#import "OFThread.h"
#import "OFThread+Private.h"
#import "OFRunLoop.h"
#import "OFList.h"
#import "OFDate.h"
#import "OFDictionary.h"
#import "OFAutoreleasePool.h"







<
<
<
<
<
<
<
<







33
34
35
36
37
38
39








40
41
42
43
44
45
46
# include <sched.h>
#endif

#if defined(OF_HAVE_THREADS) && defined(__HAIKU__)
# include <kernel/OS.h>
#endif









#import "OFThread.h"
#import "OFThread+Private.h"
#import "OFRunLoop.h"
#import "OFList.h"
#import "OFDate.h"
#import "OFDictionary.h"
#import "OFAutoreleasePool.h"
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217

	rqtp.tv_sec = (time_t)timeInterval;
	rqtp.tv_nsec = lrint((timeInterval - rqtp.tv_sec) * 1000000000);

	if (rqtp.tv_sec != floor(timeInterval))
		@throw [OFOutOfRangeException exception];

# ifndef __wii__
	nanosleep(&rqtp, NULL);
# else
	/* Wii has an incompatible nanosleep */
	nanosleep(&rqtp);
# endif
#else
	if (timeInterval > UINT_MAX)
		@throw [OFOutOfRangeException exception];

	sleep((unsigned int)timeInterval);
	usleep((useconds_t)lrint(
	    (timeInterval - floor(timeInterval)) * 1000000));







<

<
<
<
<







190
191
192
193
194
195
196

197




198
199
200
201
202
203
204

	rqtp.tv_sec = (time_t)timeInterval;
	rqtp.tv_nsec = lrint((timeInterval - rqtp.tv_sec) * 1000000000);

	if (rqtp.tv_sec != floor(timeInterval))
		@throw [OFOutOfRangeException exception];


	nanosleep(&rqtp, NULL);




#else
	if (timeInterval > UINT_MAX)
		@throw [OFOutOfRangeException exception];

	sleep((unsigned int)timeInterval);
	usleep((useconds_t)lrint(
	    (timeInterval - floor(timeInterval)) * 1000000));