ObjFW  Check-in [54a34ebd9c]

Overview
Comment:Fix compilation for Wii
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 54a34ebd9c918bd82d92d1566a78314be059c6e61aec337291314e09e27b43bc
User & Date: js on 2014-03-05 00:12:36
Other Links: manifest | tags
Context
2014-03-05
00:15
OFThread.m: Fix missing define for PSP check-in: a4986b3356 user: js tags: trunk
00:12
Fix compilation for Wii check-in: 54a34ebd9c user: js tags: trunk
00:00
Include socket.h before socket_helpers.h check-in: f96fd9d551 user: js tags: trunk
Changes

Modified src/OFThread.m from [3d7fca1f63] to [b62a944b3a].

31
32
33
34
35
36
37








38
39
40
41
42
43
44
#ifdef OF_HAVE_SCHED_YIELD
# 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"







>
>
>
>
>
>
>
>







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifdef OF_HAVE_SCHED_YIELD
# 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"
189
190
191
192
193
194
195

196




197
198
199
200
201
202
203

	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));







>

>
>
>
>







197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216

	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));

Modified tests/TestsAppDelegate.m from [cc72bf91df] to [173f7e8f11].

33
34
35
36
37
38
39

40
41
42

43
44
45
46
47
48
49
# include <pspdebug.h>
# include <pspctrl.h>
PSP_MODULE_INFO("ObjFW Tests", 0, 0, 0);
#endif

#ifdef __wii__
# define BOOL OGC_BOOL

# include <gccore.h>
# include <wiiuse/wpad.h>
# undef BOOL

#endif

enum {
	NO_COLOR,
	RED,
	GREEN,
	YELLOW







>



>







33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# include <pspdebug.h>
# include <pspctrl.h>
PSP_MODULE_INFO("ObjFW Tests", 0, 0, 0);
#endif

#ifdef __wii__
# define BOOL OGC_BOOL
# define asm __asm__
# include <gccore.h>
# include <wiiuse/wpad.h>
# undef BOOL
# undef asm
#endif

enum {
	NO_COLOR,
	RED,
	GREEN,
	YELLOW