11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
* Alternatively, it may be distributed under the terms of the GNU General
* Public License, either version 2 or 3, which can be found in the file
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#define OF_THREAD_M
#define __NO_EXT_QNX
#include "config.h"
#include <stdlib.h>
#include <math.h>
#include <time.h>
|
>
|
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
* Alternatively, it may be distributed under the terms of the GNU General
* Public License, either version 2 or 3, which can be found in the file
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#define OF_THREAD_M
#define _POSIX_TIMERS
#define __NO_EXT_QNX
#include "config.h"
#include <stdlib.h>
#include <math.h>
#include <time.h>
|
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#ifdef OF_HAVE_SCHED_YIELD
# include <sched.h>
#endif
#ifdef __wii__
# define BOOL OGC_BOOL
# include <ogcsys.h>
# undef BOOL
#endif
#import "OFThread.h"
#import "OFThread+Private.h"
#import "OFRunLoop.h"
#import "OFList.h"
#import "OFDate.h"
|
>
>
|
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
#ifdef __wii__
# define BOOL OGC_BOOL
# define nanosleep ogc_nanosleep
# include <ogcsys.h>
# undef BOOL
# undef nanosleep
#endif
#import "OFThread.h"
#import "OFThread+Private.h"
#import "OFRunLoop.h"
#import "OFList.h"
#import "OFDate.h"
|
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
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
nanosleep(&rqtp);
# endif
#elif defined(OF_NINTENDO_DS)
uint64_t counter;
if (timeInterval > UINT64_MAX / 60)
@throw [OFOutOfRangeException exception];
counter = timeInterval * 60;
|
<
<
<
<
|
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
|
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);
#elif defined(OF_NINTENDO_DS)
uint64_t counter;
if (timeInterval > UINT64_MAX / 60)
@throw [OFOutOfRangeException exception];
counter = timeInterval * 60;
|